2: LABEL 2
WRITE @ 100C3 = 30
WRITE @ 100C1 = 0
WRITE @ 100C0 = FF
WRITE @ 100C1 = 4
WRITE @ 100C0 = EO			!free-run/high & low pulse
WRITE @ 100C3 = 38
GOTO 3

3: LABEL 3
WRITE @ 100C1 = 0
WRITE @ 100C0 = 0			!pia port a to input
WRITE @ 100C1 = 4
READ @ 100C0				!read port a
INC REG1
REGE = REGE AND E0			!mask off all but probe level status
IF REGE = 60 GOTO 4			!check for low & invalid
IF REGE = A0 GOTO 5			!check for high & invalid
IF REGE = E0 GOTO 6			!check for low, invalid, high
GOTO 0

4: LABEL 4
DPY-#PULSE LOW <GREEN>
EXECUTE PROGRAM 13
IF REG1 = 1 GOTO 1
IF REG1 = 2 GOTO 2
GOTO 0

5: LABEL 5
DPY-PULSE HIGH <RED>#
EXECUTE PROGRAM 13
IF REG1 = 1 GOTO 1
IF REG1 = 2 GOTO 2
GOTO 0

6: LABEL 6
DPY-#PULSE HIGH AND LOW <BOTH>
EXECUTE PROGRAM 13
IF REG1 = 1 GOTO 1
IF REG1 = 2 GOTO 2
GOTO 0