Cortex M3 LSL instruction

Discussion in 'Embedded Systems and Microcontrollers' started by Nayani, Jun 5, 2014.

  1. Nayani

    Thread Starter New Member

    Feb 15, 2013
    2
    0
    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.
     
    Last edited: Jun 5, 2014
  2. Potato Pudding

    Well-Known Member

    Jun 11, 2010
    684
    92
    Rotate with Carry.
     
  3. Nayani

    Thread Starter New Member

    Feb 15, 2013
    2
    0
    First off, manual says clearly 00s will be entered depending on left or right shift. Byte shift seems to perform properly.
     
Loading...