Instruction Set
4-244
TEST
TEST
Examples
This example tests the value of a bit that a particular device sets to 1 when an error occurs.
If the tested bit is 1, the microcontroller jumps to an instruction sequence designed to reset
the device. Otherwise, the microcontroller continues with the following instruction.
Tips
If you want a procedure to branch depending on the value of one or more bits, use TEST
to test those bits and affect ZF, and then use JZ or JNZ.
Related Instructions
If you want to
See
Clear particular bits of a component to 0
AND
Compare two values using subtraction and set the flags accordingly
CMP
DEVICE5
EQU
00100000b
; device 5 mask
DEVICES
DB
?
; test for device error
; update device status bits
...
TEST
DEVICES,DEVICE5
; did device 5 log an error?
JNZ
RESET5
; if so, try to reset device 5
...
RESET5:
...
Содержание 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...