Rewrite the code with local variables only and add trace tags to the code.
Rewrite the code with local variables only and add trace tags to the code.
BR main // branch to main loop
x: .BLOCK 2 // storage for x
Y: .BLOCK 2 // storage for y
Temp: EQUATE 0 // set Temp=0 local variable #2d
Main:
LDWA 3,i // input i=3
STWA x,d //Store x
LDWA 8,i // i=8
STWA y,d //store y
SUBSP 2,i // subtract from stack pointer
STWA temp,s //store word to stack
LDWA x,d // Load word accumulator d to x
STWA y,d // Store word accumulator d to y
LDWA temp,S // Load word accumulator temp to stack
STWA x,d // store d to x
ADDSP 2,i // add to stack pointer
STOP // stop execution
.END

Step by step
Solved in 2 steps









