106
15. PROGRAMMABLE LED
The ZT 8904 includes two Light-Emitting Diodes (LEDs) located immediately below the
board extractor. The green LED is for the optional IDE disk drive; the red LED is general
purpose. The red LED is software programmable through the LED bit in
System
Register 2
. Writing a logical 0 to the LED bit turns the LED off and writing a logical 1 to
the LED bit turns the LED on. The LED is turned off after a power cycle or a reset.
The LED bit is in the same register as the multiple master interrupt. The following code
demonstrates how to turn the red LED on and off without corrupting the multiple master
interrupt.
;-------------------------------------------------------------
; The multiple master interrupt is a bidirectional
; bit. The current software state of multiple
; master interrupt is maintained in a separate
: multiple master state bit. Input_7d updates the
; multiple master bit with the current software
; state maintained in the multiple master state bit.
;-------------------------------------------------------------
input_7d
macro
local
star_int_on
in
al,7dh
mov
ah,al
push dx
mov
dx,f42eh
in
al,dx
pop
dx
test al,01h
jnz
star_int_on
and ah,not 01h
star_int_on:
mov
al,ah
endm
;-------------------------------------------------------------
; led_on turns on the led.
;-------------------------------------------------------------
led_on:
pushf
cli
input_7d
or
al,80h
out
07dh,al
popf
ret