Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- TASM 2.x / MASM 6.x Assembly Language - <b>bsr bit scan reverse (386) flags: o d i t s z a p c</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
BSR               Bit Scan Reverse (386)             Flags: O D I T S Z A P C
                                                                      *
BSR destination, source

           Logic:        if a set bit is found in source
                           ZF . 1
                           destination . bit index of first set bit
                         else
                           ZF . 0

     This instruction scans an operand for the first set bit. BSF scans
     forward and BSR scans backwards. If a set bit is found in source,
     then the bit's index is placed in destination.

  --------------------------------------------------------------------------
   Operands                   Clocks   Transfers  Bytes  Example
   BSR  register, register                 -        3    BSR AX, DX
   BSR  register, memory                   -        3    BSR AX, MEMLOC5
  --------------------------------------------------------------------------

        Note:          Both registers and memory locations can be either
                       16 bits or 32 bits, but they must be the same length if
                       used in the same instruction.

See Also: BSF BT BTC BTR BTS

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson