这是汇编代码:
ldc 5 // a
ldc 12 // b
bsr sumsquare
ajs -2 // delete parameters
ldr RR // result on the stack
stl 1 // store in a variable
....
sumsquare:
link 1 // 1 local variable
ldl -3 // a
ldl -3 // a
mul // a*a
ldl -2 // b
ldl -2 // b
mul // b*b
add // a*a + b*b
stl 1 // x
ldl 1 // x
str RR // store in RR (=result register)
unlink 1
ret
我想更改这段代码,将方法 sumsquare 的结果传递回堆栈。如果我是对的,我所要做的就是不要将其存储在 RR 中,而是将其立即存储在变量 a 和 b 所在的堆栈中。所以我必须使用其他东西而不是 str RR。