Why can't I move #1001 into r5 on arm?
问题 I have an RPi4 and I'm trying to write some code in assembly to loop 1000 times. The code works fine when I set a lower number of loops, but when I try to set it 1001, gcc says: loop.s: Assembler messages: loop.s:15: Error: invalid constant (3e9) after fixup Here's the code: .data ms3: .asciz "%d\n" .text .global main .extern printf main: push {ip, lr} mov r1, #0 mov r5, #1001 loop1000: push {r1} ldr r0, =ms3 bl printf pop {r1} add r1, #1 cmp r1, r5 bne loop1000 pop {ip, pc} 回答1: Assembly