How to return a number larger than 8 bits from main()?
问题 So as far as I can tell, the exit code returned from r0 only uses the lowest 8 bits of this register. How wouuld I return a value higher than 8 bits? Here is the ARMv7 code: @ looping.s @ calculates sum of integers from 1 to 100 .text .balign 4 .global main main: MOV r1, #0 @ r1 = 0 as sum MOV r2, #0 @ r2 = 0 as counter loop: ADD r2, r2, #1 @ counter = counter + 1 ADD r1, r1, r2 @ sum = sum + counter CMP r2, #100 @ counter - 100 BLT loop @ if counter < 100 go to start of loop MOV r0, r1 @