这是我的汇编代码,当我运行它时会出现一个随机的8,我不知道如何摆脱它。
B main
number DEFW 4
verse DEFB " men went to mow\nWent to mow a meadow\n",0
verse2 DEFB " men,"
ALIGN
main ADR R0,number ;puts address of number into R0
SWI 4 ;prints value in number
ADR R0,verse
SWI 3 ;prints verse
ADR R0,number
SWI 4 ;prints value number
ADR R0,verse2 ;places the address of verse to R0
SWI 3 ;prints verse2
SWI 2
答案 0 :(得分:5)
你没有像verse2
一样终止你的verse
,所以它会一直打印文本,直到找到0字节为止。
8可能是第一条指令的一部分,它可能以0x38 0x00 ...
开始,0x38是'8'的ASCII码。
不确定SWI 3
在非紧急情况下是做什么的,但也许在@31范围内的1-31范围值中有记忆,并且被忽略了。