
Instruction Set
4-19
BOUND*Check Array Index Against Bounds
BOUND
What It Does
BOUND determines whether an integer falls between two boundaries.
Syntax
Description
BOUND ensures that a signed array index is within the limits specified by a block of memory
between an upper and lower bound. The first operand (from the specified register) must
be greater than or equal to the lower bound value, but not greater than the upper bound.
The lower bound value is stored at the address specified by the second operand. The upper
bound value is stored at a consecutive higher memory address (+2). If the first operand is
out of the specified bounds, BOUND issues an Interrupt 5 Request. The saved IP points
to the BOUND instruction.
Operation It Performs
Flag Settings After Instruction
* – This instruction was not available on the original 8086/8088 systems.
Form
Opcode
Description
Clocks
Am186 Am188
BOUND
r16,m16&16
62
/r
Check to see if word register is within bounds
33–35
33–35
BOUND
index,bounds
if ((
index < [bounds]) || (index > [ 2]))
/* integer is outside of boundaries */
interrupt(5);
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Processor Status
Flags Register
reserved
OF DF
IF TF SF ZF
AF
PF
CF
? = undefined; – = unchanged
–
–
–
–
–
– res – res – res –
Summary of Contents for Am186 Series
Page 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Page 10: ...Table of Contents x...
Page 18: ...Programming 1 8...
Page 40: ...Instruction Set Listing 3 14...