Application Examples
;***********************************************************
;*
*
;*
PROCEDURES
*
;*
*
;***********************************************************
;
;
INIT_PIC
PROC
;
; THIS PROCEDURE IS CALLED TO INITIALIZE THE 8259A PIC.
;
THE PIC IS INITIALIZED TO: SINGLE MODE, EDGE TRIG-
;
GERED, INTERRUPT TYPES 8 - 15 D FOR IRQS 0-7 RE-
;
SPECTIVELY, 8088 MODE, NORMAL (NON-SPECIFIC) END-
;
OF-INTERRUPT, IRQ LINES 0-7 ENABLED.
;
MOV
DX,PORT_A_8809A ; ADDRESS THE FIRST BYTE
MOV
AL,ICW1_8809A
; WRITE 1ST ICW
OUT
DX,AL
; OUTPUT 1ST ICW
MOV
DX,PORT_B_8809A
MOV
AL,ICW2_8809A
OUT
DX,AL
; WRITE 2ND ICW
MOV
AL,ICW3_8809A
OUT
DX,AL
; WRITE 3RD ICW
MOV
AL,ICW4_8809A
; WRITE 4TH ICW
OUT
DX,AL
; OUTPUT 4TH ICW
MOV
AL,OCW1_8809A
; WRITE OCW1 (ASSUMES
; STD DOS USE)
OUT
DX,AL
; OUTPUT MASK
RET
INIT_PIC
ENDP
;
;
INIT_TMR2
PROC
;
; THIS PROCEDURE IS CALLED TO INITIALIZE THE COUNTER/TIMER 2
;
IN THE 8254.
ONLY TIMER 2 WILL BE USED AS A RATE
;
GENERATOR, IDENTICAL TO THE WAY STD DOS USES IT.
;
THE INTERRUPT WILL OCCUR ONCE EVERY 55 MSEC.
;
; INPUTS:
NONE
; OUTPUTS:
NONE
; CALLS:
NONE
; DESTROYS:
;
MOV
AX,TMR2_MODE2
; INITIALIZE TIMER 2
PUT
CNTRL_WORD
; FOR MODE 2
MOV
AL,0
; FREQUENCY = MINIMUM
PUT
TIMER2
; SEND LEAST SIG BYTE FIRST
PUT
TIMER2
; SEND MOST SIG BYTE
RET
;
INIT_TMR2
ENDP
;
4-11