I write the code as following to evaluate the expression n = n / 2
asrs r0, r0, #1
But, I found the GCC will translate the expression n = n / 2 into the following instruction
lsrs r1, r0, #31
adds r0, r1, r0
Why does it need to add the sign bit?
Greetings,,
did you defined (n) to be unsigned ?
Regards,,