area word,code,readonly
entry
init
ldr r0,=src
ldr r1,=4
str r1,[r0],#4
ldr r1,=3
str r1,[r0],#4
ldr r1,=1
str r1,[r0],#4
ldr r1,=5
str r1,[r0],#4
ldr r1,=2
str r1,[r0]
start
ldr r0,=src
ldr r1,=0x05
mov r2,#1
mov r4,r0
fetch_outer
ldr r6,[r4],#0x04
add r3,r2,#1
mov r5,r4
fetch_inner
ldr r7,[r5],#0x04
cmp r6,r7
ble no_swap
nop
sub r4,r4,#4
sub r5,r5,#4
swp r6,r7,[r4]
str r6,[r5],#4
mov r6,r7
add r4,r4,#4
no_swap
add r3,r3,#1
cmp r3,r1
ble fetch_inner
add r2,r2,#1
cmp r2,r1
bne fetch_outer
stop
mov r0, #0x18
ldr r1, =0x20026
swi 0x123456
area blockdata,data,readwrite
src DCD 105, -7, 235, 61, 28
end
冒泡arm汇编实现
最新推荐文章于 2023-10-26 14:04:02 发布