这是我的汇编程序代码,当我运行它时出现随机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
Run Code Online (Sandbox Code Playgroud)
你没有verse2像你那样终止你的行为verse,所以它将继续打印文本,直到它找到0字节.
8可能是第一条指令的一部分,它可能0x38 0x00 ...以"8"为ASCII码代码开始.
不确定SWI 3在非紧急情况下会发生什么情况,但也许在任何地方都存在1-31范围值的内存,并且会被忽略.