写一段arm汇编程序,对包含10个元素的整数数组进行从大到小的排序
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
咱小学文化给你编一个吧
结果放在0x20000200
.section .data
shuzu: .int 77, 55, 44, 33, 11, 22, 66, 88, 99, 100
.section .text
fuzhi:
mov r4, # 0x24
mov r3, # 0
mov r5, # 0
ldr r0, = shuzu
bijiao1:
cmp r5, # 0x28
beq tiaochu
ldr r1, [r0, r5]
bijiao:
ldr r2, [r0, r3]
cmp r1, r2
beq jisuan
bhi dayu
jisuan:
add r3, # 4
cmp r3, # 0x28
bne bijiao
bl jieguo
mov r3, # 0
add r5, # 4
b bijiao1
dayu:
sub r4, # 4
b jisuan
jieguo:
ldr r6, = 0x20000200
str r1, [r6, r4]
mov r4, # 0x24
bx lr
tiaochu:
b tiaochu