TEST
Directive. Test state of input/output/pin space of LPT port.
Syntax
test <i/o space> <address>
test <i | q | pin> <address>
test i <address> ; Test specified input signal
test q <address> ; Test specified output signal
test pin <address> ; Test specified pin of LPT port
Parameters
i/o space
- i — INPUT space
- q — OUTPUT space
- pin — The PIN space
address
- Index number of specified signal or pin
Remarks
The INPUT space
Address |
LPT pin |
i 1 |
10 |
i 2 |
11 |
i 3 |
12 |
i 4 |
13 |
i 5 |
15 |
The OUTPUT space
Address |
LPT pin |
|
Address |
LPT pin |
q 1 |
2 |
|
q 7 |
8 |
q 2 |
3 |
|
q 8 |
9 |
q 3 |
4 |
|
q 9 |
1 |
q 4 |
5 |
|
q 10 |
14 |
q 5 |
6 |
|
q 11 |
16 |
q 6 |
7 |
|
q 12 |
17 |
The PIN space
Address |
LPT pin |
pin 1 |
1 |
pin 2 |
2 |
pin 3 |
3 |
. . . |
... |
pin 24 |
24 |
pin 25 |
25 |
10 ; Set initial state
CYCLE: ; Define the label CYCLE
test i 1 ; Test input bit 379h:6 (Pin 10)
jz SIGNALED ; Jump if tested bit in zero state
shift +1 ; Rotate state clockwise
goto CYCLE ; Goto the CYCLE label
SIGNALED:
shift -1 ; Rotate state unclockwise
goto CYCLE ; Goto the CYCLE label