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>bound check array bounds (186/286/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]
BOUND             Check Array Bounds (186/286/386)   Flags: O D I T S Z A P C

BOUND destination, source

           Logic:   if (destination < source[0] | destination > source[1])
                        INT 5

     This instruction checks the bounds on arrays. It verifies that a signed
     index value is within the bounds of an array. The destination must be
     a register holding the index to be checked. The source must be a
     memory location holding the starting and ending indices of the array.

     If the given index is out of bounds, an INT 5 is generated.

  --------------------------------------------------------------------------
   Operands                   Clocks   Transfers  Bytes  Example
   BOUND reg16,mem32          13 (286)     -        2    BOUND AX,DS:TOP
   BOUND reg32,mem64 (386)    10 (386)     -        2    BOUND EAX,MEMLOC5
  --------------------------------------------------------------------------

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