PDA

View Full Version : what is the result ?



OrbiTel gSm
14-08-2003, 10:13 AM
MOV R0, #0xA
LSL R0, R0, #0x1C
LSR R0, R0, #0x1B

what is result after this shifting ?

thanx

wumpus
14-08-2003, 01:21 PM
This is the classic 'shift right shift left' pattern to drop part of the bits of a register.

Remember the registers are 32bit(0x20) wide, so everything you shift beyond that range is lost (cleared to 0)

That should help you..

OrbiTel gSm
14-08-2003, 02:33 PM
Ok thenx, then result is ZERO.

wumpus
14-08-2003, 10:59 PM
MOV R0, #0xA
R0=00000000000000000000000000001010
LSL R0, R0, #0x1C
R0=10100000000000000000000000000000
LSR R0, R0, #0x1B
R0=00000000000000000000000000010100

No, the result is 20

OrbiTel gSm
15-08-2003, 06:53 AM
And in thumb is this also ZERO ?

OrbiTel gSm
17-08-2003, 03:02 PM
the ida have the bug, i try 1c 1b left and right shift, and ida give bad result...