CODE SEGMENT
   ASSUME CS:CODE, DS:CODE,ES:CODE, SS:CODE
 PPIC_C EQU 1FH
 PPIC   EQU 1DH
PPIB    EQU 1BH
PPIA    EQU 19H


INTA EQU 10H
INTA2 EQU 12H
INT_V EQU 42H*4
STACK EQU  540H

ORG 1000H
 
XOR BX,BX
MOV ES,BX
MOV DS,AX
MOV SS,BX
MOV SP,STACK
MOV AX,OFFSET INT_SER
MOV BX,INT_V
MOV WORD PTR ES:[BX],AX
XOR AX,AX
MOV WORD PTR ES:[BX+2],AX
 

CALL INIT
MOV AL,80H
OUT PPIC_C,AL
MOV SI,OFFSET DATA
MOV AL,BYTE PTR CS:[SI]
OUT PPIA,AL
STI

L2 : NOP
JMP L2

INT_SER:
      
MOV AL,BYTE PTR CS:[SI]
CMP AL,00H
JNZ L3
MOV SI,OFFSET DATA
JMP INT_SER
L3 : OUT PPIA,AL
INC SI
MOV AL,20H
OUT INTA, AL

STI
IRET
INIT PROC NEAR
MOV AL,13H
OUT INTA ,AL
MOV AL,40H
OUT INTA2,AL
MOV AL,01H
OUT INTA2,AL
RET
INIT ENDP
DATA : DB  0C0H,0F9H,0A4H,0B0H,99H,92H,82H,0F8H,80H,90H,00H 
CODE ENDS
END



 
     
   