1

I have this code written in MARIE assembly language:

Org 100
Load X
Subt Y
Store Z
if,     Skipcond 000
Jump Else
Then,   Clear
ADD Z
Else,   Output
Halt
X,  DEC 10
Y,  DEC 15
Z,  DEC 10

and when I run this code in MARIE it gives the output = FFFB, and I don't know how the output becomes FFFB because in the Skipcond 000 instruction we should skip Jump Else instruction (as the AC value is negative) and go to clear instruction which will make the AC = 0 and then add z which will make the value of AC = 10 in decimal or A in hexa.

any help will be appreciated.

user2521365
  • 131
  • 3
  • 17

1 Answers1

0

You might want to use Skipcond 800 instead of Skipcond 000. That's what makes the program wrong. Or you can change the values of all the variables to DEC 10