Someone1123123
Someone1123123

Reputation: 11

Weird Arm LSL Instruction

While looking some arm stuff in ida i came across this code

LSLS R3, R1

I know this is the left shift instruction but according to the arm website it should have Rs or #sh after it.

What does this mean? Is it just LSLS R3, R1, #0?

Upvotes: 1

Views: 6794

Answers (2)

Tupik Tupitochka
Tupik Tupitochka

Reputation: 1

in Thumb, LSL(S) third operand can't be #0.

Restrictions in Thumb code Thumb instructions must not use PC or SP. You cannot specify zero for the value in an LSL instruction in an IT block.sh https://developer.arm.com/documentation/dui0473/m/arm-and-thumb-instructions/lsl?lang=en

Upvotes: 0

Dric512
Dric512

Reputation: 3729

This is just a shortcut for:

LSLS r3, r3, r1

This is because in Thumb, the destination and first source registers need to be the same for most instructions.

Upvotes: 3

Related Questions