943,983 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 2424
  • Assembly RSS
Mar 27th, 2006
0

Give a try....

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
Dabdob is offline Offline
26 posts
since Dec 2005
Mar 27th, 2006
0

Re: Give a try....

What assembler are you using?
Administrator
Reputation Points: 6442
Solved Threads: 1393
Bad Cop
Narue is offline Offline
11,807 posts
since Sep 2004
Mar 27th, 2006
0

Re: Give a try....

Quote originally posted by Narue ...
What assembler are you using?
I use MASM Version 8.2
Reputation Points: 10
Solved Threads: 0
Light Poster
Dabdob is offline Offline
26 posts
since Dec 2005
Mar 29th, 2006
0

Re: Give a try....

Guys,
Do you think there is other way to write the above prgram??what's it?
Reputation Points: 10
Solved Threads: 0
Light Poster
Dabdob is offline Offline
26 posts
since Dec 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: copy string and convert to upper case
Next Thread in Assembly Forum Timeline: Question on my code in tower of hanoi





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC