Results 1 to 6 of 6

Thread: what is the result ?

  1. #1

    what is the result ?

    MOV R0, #0xA
    LSL R0, R0, #0x1C
    LSR R0, R0, #0x1B

    what is result after this shifting ?

    thanx

  2. #2
    Join Date
    Jul 2003
    Location
    The Netherlands
    Posts
    254
    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..

  3. #3
    Ok thenx, then result is ZERO.

  4. #4
    Join Date
    Jul 2003
    Location
    The Netherlands
    Posts
    254
    MOV R0, #0xA
    R0=00000000000000000000000000001010
    LSL R0, R0, #0x1C
    R0=10100000000000000000000000000000
    LSR R0, R0, #0x1B
    R0=00000000000000000000000000010100

    No, the result is 20

  5. #5
    And in thumb is this also ZERO ?

  6. #6
    the ida have the bug, i try 1c 1b left and right shift, and ida give bad result...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •