ARM day1 4-18
1、
.text
.global _start
_start:
mov r0,#0x15
mov r1,#0x15
cmp r0,r1
beq stopsubhi r0,r0,r1
subcc r1,r1,r0stop:
b stop
.end
2、
.text
.global _start
_start:mov r0,#0x0
mov r1,#0x1
bl sum
sum:
cmp r1,#0x65
beq stop
add r0,r0,r1
add r1,r1,#0x1
mov pc,lr
stop:
b stop
.end
结果
3、
str r1,[r0,#4]
str r2,[r0],#4
先将R2 的值写到r0的地址空间中,r0的地址在偏移4
str r3,[r0,#4]!
先将r0向后偏移4,再存储