我想比较一个包含100个数字的数组,并将它们从大到小打印出来。这是我使用的代码:
loop:
cmp r2, #100
bleq compNum
moveq r5, #0
ldr r0,=formatoF
bl scanf
mov r3, r1, lsl #1
str r2, [r3]
add r2, r2, #1
b loop
compNum:
cmp r5, #100
bleq fin
mov r4, [r3], lsl #1
ldr r0, =formatNum
ldr r1, [r3], lsl #1
bl printf
add r5, r5, #1
b compNum
但是当我尝试编译它时,会显示以下消息:
subR.s:18: Error: immediate expression requires a # prefix -- `mov r4,[r3],lsl#1'
subR.s:21: Error: immediate expression requires a # prefix -- `ldr r1,[r3],lsl#1'
我如何比较它们并打印出来?