| | |
Give a try....
![]() |
•
•
Join Date: Dec 2005
Posts: 26
Reputation:
Solved Threads: 0
Q-write an Assembly code that read a student ID, Name, TMA1, TMA2, Midterm and Final....
The output of this programm should be like:
ID Name Total of Marks Result
2345 ABCD 78 pass
2456 Bulin 30 Fail
The code:"i am not sure if the code is right?" you give a try and see :p
Get AX
Mov [0000], AX ; This is for the student ID
Get AX
Mov [0001],AX ; This is for the student name
Get AX
Mov BX,AX ; This is for student TMA1
Get AX
Mov CX,AX ; This is for student TMA2
Get AX
Mov DX,AX ; This is for student Midterm
Get AX ; This is for student Final
Add AX,DX
Add AX,CX
Add AX,BX
Mov[0002], AX
Comp [0002],50
JP Z1 '; This control and Z1 is lable
Mov [0003],"Pass"
JMP k2
mov[0003], "Fail"
Mov AX, [0000]
Put AX,
Mov AX, [0001]
Put AX,
Mov AX, [0002]
Put AX,
Mov AX, [0003]
put AX
End
Comments:
[0000] student ID = 2345
[0001] student name = ABCD
[0002] Student Total = 78
[0003] Student "Pass"
:o Hope it works with you...
Cheers
The output of this programm should be like:
ID Name Total of Marks Result
2345 ABCD 78 pass
2456 Bulin 30 Fail
The code:"i am not sure if the code is right?" you give a try and see :p
Get AX
Mov [0000], AX ; This is for the student ID
Get AX
Mov [0001],AX ; This is for the student name
Get AX
Mov BX,AX ; This is for student TMA1
Get AX
Mov CX,AX ; This is for student TMA2
Get AX
Mov DX,AX ; This is for student Midterm
Get AX ; This is for student Final
Add AX,DX
Add AX,CX
Add AX,BX
Mov[0002], AX
Comp [0002],50
JP Z1 '; This control and Z1 is lable
Mov [0003],"Pass"
JMP k2
mov[0003], "Fail"
Mov AX, [0000]
Put AX,
Mov AX, [0001]
Put AX,
Mov AX, [0002]
Put AX,
Mov AX, [0003]
put AX
End
Comments:
[0000] student ID = 2345
[0001] student name = ABCD
[0002] Student Total = 78
[0003] Student "Pass"
:o Hope it works with you...
Cheers
![]() |
Similar Threads
- We only give homework help to those who show effort (Computer Science)
- YAHOO DSL w/NETGEAR router wont give me connection (Networking Hardware Configuration)
- Tic-Tac-Toe (C++)
- Can anybody give answers for these 2 queries ??!!?? (Visual Basic 4 / 5 / 6)
- YAHOO DSL w/NETGEAR router wont give me connection (Networking Hardware Configuration)
- Please give me reviews of my site (Website Reviews)
- I GIVE UP, how do I modify this code to call from one form to the other and back (C++)
Other Threads in the Assembly Forum
- Previous Thread: copy string and convert to upper case
- Next Thread: Question on my code in tower of hanoi
| Thread Tools | Search this Thread |






