 .model small
 .stack 100
 
 .DATA
 FIFO EQU 03FAH
 LCONTROL EQU 03FBh
 LSTATUS EQU 03FDH
 BUFFER EQU 03F8H
 .CODE
 .STARTUP
 
 MOV AL,80H
 MOV DX,LCONTROL
 OUT DX,AL
 
 MOV DX,03F8H
 MOV AL,0CH
 OUT DX,AL
 
 MOV DX,03F9H
 MOV AL,00H
 OUT DX,AL
 
 MOV DX,LCONTROL
 MOV AL,03H
 OUT DX,AL
 
 MOV DX,FIFO
 MOV AL,07H
 OUT DX,AL
 
 L1:
 MOV AH,01H
 INT 21H
 
 MOV BX,0
 MOV BL,AL
 MOV DX,LSTATUS
 L2:
 IN AL,DX
 TEST AL,20H
 JZ L2
 
 MOV AL,BL
 MOV DX,BUFFER
 OUT DX,AL
 
 JMP L1
 
 MOV AH,4CH
 INT 21H
 
END
 