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

ORG 1000H 

 CALL INIT
MOV AL, 80H
OUT PPIC_C,AL
;;;;;;;;;;;;
MOV AL,00000000B
OUT PPIC ,AL
;;;;;;;;;;;;;;;

MOV AH,11110001B
MOV AL,AH
OUT PPIB ,AL
;;;;;;;;;;

L2 : MOV AL, 0CH ;ocw3 enable poll
OUT INTA ,AL
IN AL,INTA
TEST AL, 80H
JZ L2
;;;
;;;;
SHL AH,1
TEST AH, 00010000B
JNZ L1
OR AH ,11110000B
JMP L3
L1: MOV AH , 11110001B
L3: MOV AL,AH
OUT PPIB ,AL
;END OF INTERRUPT COMMAND
MOV AL,20H
OUT INTA ,AL
JMP L2
   


    INIT PROC NEAR

     MOV AL,13H
     OUT 10H,AL

	 MOV AL, 40H
	 OUT 12H,AL

MOV AL, 01H
OUT 12H,AL
mov al ,0fbh
out 12H,al
   RET
INIT ENDP
CODE ENDS
END
