推荐一个可以调试armv7汇编的在线IDE: CPUlator ARMv7 System Simulator (01xz.net)
https://cpulator.01xz.net/?sys=arm
在editor中填入:
.text
.global _start
_start:
ldr r1, =src
ldr r0, =dst
ldr r3, =len
move:
cmp r3, #1
bcc end
ldrb r2, [r1]
strb r2, [r0]
adds r1, r1, #1
adds r0, r0, #1
subs r3, r3, #1
b move
end:
mov r0, #0
.data
src:
.asciz "hello world"
len = .-src
dst:
.asciz "0000000000000"
点击 compile and load按钮, 或者按f5,进入调试页面
按F2步进调试,可以查看寄存器,内存,symbols等内容,非常方便
参考资料:
ARM assembly hello world tutorial (kerseykyle.com)
http://kerseykyle.com/articles/ARM-assembly-hello-world
ARM Cortex A9_百度百科 (baidu.com)
https://baike.baidu.com/item/ARM%20Cortex%20A9/10850753