• Welcome to Valhalla Legends Archive.
 

Check for my exam

Started by R.a.B.B.i.T, January 13, 2005, 05:51 PM

Previous topic - Next topic

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:
Quotey = 8 + 5 - 6 - 3 + 2
My code was this:
LDA Bh
ADD Ch
SUB Dh
SUB Eh
ADD Fh
OUT
HLT
and my finished memory block was0 . 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


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 ...