Pseudocode:
if x > 1 then
y = x + x;
x = 0;
endif;
y = y + 1;
I am tracing the MARIE code below based from the pseudocode:
ORG 100
IF, LOAD X
SUBT ONE / What is this for?
SKIPCOND 800
JUMP ENDIF
THEN, LOAD X
ADD X
STORE Y
LOAD ZERO
STORE X
ENDIF, LOAD Y
ADD ONE
STORE Y
HALT
X, DEC ?
Y, DEC ?
ONE, DEC 1
ZERO, DEC 0
Why is the SUBT ONE needed there?