add r1, r1, r0, lsl #3
I am not sure about the operation executed with this instruction. Does it mean:
Thanks in advance.
Most of the arithmetic and logical instructions in the Thumb and Thumb-2 instruction sets take three arguments. The first is the destination register, the second is the first operand (also a register), and the third is the flexible second operand. (If the destination register is omitted, the first operand is used as the destination.)
In almost all cases, the flexible second operand can be:
ASR #n
(arithmetic shift right)LSL #n
(logical shift left)LSR #n
(logical shift right)ROR #n
(rotate right)RRX
(rotate right one bit through carry)#constant
, where #constant
can be:
0x00XY00XY
0xXY00XY00
0xXYXYXYXY
So in your case, r0, lsl #3
is the second operand to the add
instruction, and so the shift is performed before the add.
For more information see the ARM developer documentation.