Hello all,
I am trying to use cortex m3 assembly language and found that the instructions lsl and lsr are not shifting the data as understood. I am getting a half word into a register and shifting the register by using lsl and storing the shifted data back. From the description of the instruction, if I shift left data say by 3, then the result should have the three LSBs reset (000) with the other bits shifted towards msb. This is not happening. Some times I see LSB set to 1 some times the data shifts properly. Can some one clarify please? Thank you.
I am trying to use cortex m3 assembly language and found that the instructions lsl and lsr are not shifting the data as understood. I am getting a half word into a register and shifting the register by using lsl and storing the shifted data back. From the description of the instruction, if I shift left data say by 3, then the result should have the three LSBs reset (000) with the other bits shifted towards msb. This is not happening. Some times I see LSB set to 1 some times the data shifts properly. Can some one clarify please? Thank you.
Last edited: