參考資訊:
https://developer.arm.com/docs/100069/0606/condition-codes/carry-flag
For non-additions/subtractions that incorporate a shift operation, C is set to the last bit shifted out of the value by the shifter.
指令 | Carry Flag |
---|---|
ldr r0, =0x00000000 movs r1, r0, lsr#1 | C=0 |
ldr r0, =0x00000001 movs r1, r0, lsr#1 | C=1 |
ldr r0, =0x40000000 movs r1, r0, lsl#2 | C=1 |
ldr r0, =0x00000000 orrs r1, r0, lsr#1 | C=0 |
ldr r0, =0x00000001 orrs r1, r0, lsr#1 | C=1 |
ldr r0, =0x40000000 orrs r1, r0, lsl#2 | C=1 |