Valhalla Legends Forums Archive | Advanced Programming | Check for my exam

AuthorMessageTime
R.a.B.B.i.T
On my exam was a problem where I had to write a simple assembly program for an 8-bit, 16 memory address SAP-1 computer, and I want to make sure I got it right:[quote]y = 8 + 5 - 6 - 3 + 2[/quote]
My code was this:
[code]LDA Bh
ADD Ch
SUB Dh
SUB Eh
ADD Fh
OUT
HLT[/code]and my finished memory block was[code]0 . 0000 1011
1 . 0001 1100
2 . 0010 1101
3 . 0010 1110
4 . 0001 1111
5 . 1110 XXXX
6 . 1111 XXXX
7 . XXXX XXXX
8 . XXXX XXXX
9 . XXXX XXXX
A . XXXX XXXX
B . 0000 1000
C . 0000 0101
D . 0000 0110
E . 0000 0011
F . 0000 0010[/code]

I'm not that great at ASM, and I was wondering if anyone can tell me if I got it right?

[edit]
Whoops, wrong board ...
January 13, 2005, 11:51 PM

Search