Application Examples
INIT_UART
PROC
;
; THIS PROCEDURE IS CALLED TO INITIALIZE A UART.
THE FOL-
;
LOWING PARAMETERS ARE INITIALIZED:
;
;
8-BIT CHARACTER LENGTH
;
1-START/STOP BIT
;
9600-BAUD
;
NO PARITY
;
NO INTERRUPTS
;
; INPUTS:
UART - BASE ADDRESS OF UART TO BE INIT
; OUTPUTS:
NONE
; CALLS:
NONE
; DESTROYS:
AX,DX,F/FS
;
MOV
AL,WL8+DLAB
; 8-BIT, DLAB
PUT
UART1+PORT_LINEC ; OUTPUT LINE CONTROL
MOV
DX,UART1
; GET UART
ADD
DX,PORT_DLALB
MOV
AX,BD962
; 9600 BAUD
OUT
DX,AX
; WRITE LSB & MSB
GET
UART1+PORT_LINEC ; RESET DLAB
AND
AL,7FH
; ISOLATE INIT CODE
OUT
DX,AL
; WRITE LINE CONTROL
MOV
AL,0
; DISABLE ALL INTERRUPTS
; INITIALLY
PUT
UART1+PORT_INTEN ; IN THE INTERRUPT ENABLE REG
RET
INIT_UART
ENDP
;
4-25