EXTRN   SCAN_CODE:BYTE, KEY_FLAG:BYTE
PUBLIC  KBD_INT

.MODEL SMALL
.CODE

KBD_INT    PROC    
PUSH    DS
PUSH    AX

mov     ax,seg scan_code
mov     ds,ax

in      al,60h
push    ax
mov     al,61h
mov     ah,al
or      al,0h
out     61h,al
xchg    ah,al
out     61h,al
pop     ax
mov     ah,al
test    al,80h
jne     key_0

        mov     scan_code,al
        mov     key_flag,1
key_0:
        mov     al,20h
        out     20h,al

        pop     ax
        pop     ds
        iret
KBD_INT    ENDP
END
