存储两个数字后,如何将它们一起添加并显示答案?
这是我到目前为止所做的,我只需要在最后输出答案。任何帮助将不胜感激:
.orig x3000
lea r0, LN1
puts
lea r2, NO1
LOOP1
getc
str r0, r2, 0
add r2, r2, 1
add r1, r0, -10
brz OUT1
out
brnzp LOOP1
OUT1
lea r0, LN2
puts
lea r2, NO2
LOOP2
getc
str r0, r2, 0
add r2, r2, 1
add r1, r0, -10
brz OUT2
out
brnzp LOOP2
OUT2
lea r0, LN3
puts
halt
NO1 .blkw 15
NO2 .blkw 15
LN3 .stringz "\nSum: "
LN1 .stringz "\nEnter first number: "
LN2 .stringz "\nEnter second number: "
.end