944,144 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 8226
  • Assembly RSS
Dec 6th, 2006
0

need help on pep/8 machine language program

Expand Post »
sorry, i don't know which forum i should post this question.

Q) a machine language program to input 2 numbers then adds 2 numbers then output the single-character result.

this is what i got so far but it doesn't work..any help plz~~

Assembly Syntax (Toggle Plain Text)
  1. 0000 4900FE ;Get input from the user and store it @ 00FE
  2. 0003 4900FF ;Get input from the user and store it @ 00FF
  3. 0006 910022 ;Convert second input to decimal
  4. 0009 F100FA ;Store second decimal
  5. 000C D100FE ;Load first input into memory
  6. 000F 910022 ;Convert first input to decimal
  7. 0012 7100FA ;Add two numbers
  8. 0015 A10020 ;convert sum to character
  9. 0018 F1001F ;store the character
  10. 001B 51001F ;output the character
  11. 001E 00 ; stop
  12. 001F 00 ; character to output
  13. 0020 0030 ; convert mask to ASCII from decimal
  14. 0022 000F ; convert mask to decimal from ASCII
  15.  
  16. Hex Version for the Loader in Pep/8 simulator
  17.  
  18. 49 00 FE 49 00 FF 91 00 22 F1 00 FA D1 00 FE 91 00 22 71 00 FA A1 00 20 F1 00 1F 51 00 1F 00 00 00 30 00 0F zz
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
jack223 is offline Offline
27 posts
since Nov 2005
Dec 7th, 2006
0

Re: need help on pep/8 machine language program

for what purpose? And why not just store and add the hex, then if you want convert only the answer to dec for std out.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Day Brown is offline Offline
23 posts
since Nov 2006
Apr 7th, 2007
0

Re: need help on pep/8 machine language program

Click to Expand / Collapse  Quote originally posted by Day Brown ...
for what purpose? And why not just store and add the hex, then if you want convert only the answer to dec for std out.

Did anyone ever figure out why this did not work?
Reputation Points: 10
Solved Threads: 0
Unverified User
skeet123 is offline Offline
20 posts
since Nov 2004
Apr 7th, 2007
0

Re: need help on pep/8 machine language program

Click to Expand / Collapse  Quote originally posted by skeet123 ...
Did anyone ever figure out why this did not work?
i DIDNT even think about it. As I infer in another post, with today's DRAM and CPU speed, simplicity is far more important, and nothing is simpler than a lookup table.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Day Brown is offline Offline
23 posts
since Nov 2006
Apr 11th, 2007
0

Re: need help on pep/8 machine language program

I am trying to get this problem worked out but still not able get it right.

0000 4900FE ;Get input from the user and store it @ 00FE
0003 4900FF ;Get input from the user and store it @ 00FF
0006 D100FE ;load first input to memory
0009 910025 ;Convert first input to decimal
000C F100FE ;Store first decimal
000F D100FF ;Load second input into memory
0012 910025 ;Convert second input to decimal
0015 7100FE ;Add two numbers
0018 A10023 ;convert sum to character
001B F100FF ;store the character
001E 5100FF ;output the character
0021 00 ; stop
0022 00 ; character to output
0023 0030 ; convert mask to ASCII from decimal
0025 000F ; convert mask to decimal from ASCII



49 00 FE 49 00 FF D1 00 FE 91 00 25 F1 00 FE D1
00 FF 91 00 25 71 00 FE A1 00 23 F1 00 FF 51 00
FF 00 00 00 30 00 0F zz

My input is:
5
2

Output:
4


Any help would be appreciated.
Reputation Points: 10
Solved Threads: 0
Unverified User
skeet123 is offline Offline
20 posts
since Nov 2004
Apr 12th, 2007
0

Re: need help on pep/8 machine language program

Click to Expand / Collapse  Quote originally posted by skeet123 ...
I am trying to get this problem worked out but still not able get it right.

0000 4900FE ;Get input from the user and store it @ 00FE
0003 4900FF ;Get input from the user and store it @ 00FF
0006 D100FE ;load first input to memory
0009 910025 ;Convert first input to decimal
000C F100FE ;Store first decimal
000F D100FF ;Load second input into memory
0012 910025 ;Convert second input to decimal
0015 7100FE ;Add two numbers
0018 A10023 ;convert sum to character
001B F100FF ;store the character
001E 5100FF ;output the character
0021 00 ; stop
0022 00 ; character to output
0023 0030 ; convert mask to ASCII from decimal
0025 000F ; convert mask to decimal from ASCII



49 00 FE 49 00 FF D1 00 FE 91 00 25 F1 00 FE D1
00 FF 91 00 25 71 00 FE A1 00 23 F1 00 FF 51 00
FF 00 00 00 30 00 0F zz

My input is:
5
2

Output:
4


Any help would be appreciated.
Do all the math in hex. Only convert to decimal at output.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Day Brown is offline Offline
23 posts
since Nov 2006

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: better way or technique to write this
Next Thread in Assembly Forum Timeline: Help with program to convert hex to dec





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


Follow us on Twitter


© 2011 DaniWeb® LLC