Instruction Set
4-20
BOUND
BOUND
Examples
This example compares a word in a table to the value in AX. Before the comparison, BOUND
checks to see if the table index is within the range of the table. If it is not, the microcontroller
generates Interrupt 5.
Tips
Use BOUND to check a signed index value to see if it falls within the range of an array.
Related Instructions
If you want to
See
Compare two components using subtraction and set the flags accordingly
CMP
Generate an interrupt
INT
BOUNDARIES
DW
0,256
TABLE
DW
4096 DUP (?)
; search table for value in AX
; fill table with values and load AX with search key
CALL
FILL_TABLE
CALL
GET_KEY
; load SI with index
...
; check index before comparison
BOUND
SI,BOUNDARIES
; if out of bounds, call interrupt 5
CMP
TABLE[SI],AX
; compare components
...
Содержание Am186 Series
Страница 1: ...Am186 and Am188 Family Instruction Set Manual February 1997...
Страница 10: ...Table of Contents x...
Страница 18: ...Programming 1 8...
Страница 40: ...Instruction Set Listing 3 14...