520 DOSSEG .MODEL SMALL .DATA Org_rutin dd ? status db 0 scan db ? old_scan db ? .CODE PUBLIC _init_kbd PUBLIC _exit_kbd PUBLIC _get_playkey KBD_ISR PROC FAR ASSUME CS:_TEXT,DS:DGROUP push ds push ax push dx push es push DGROUP pop ds in al,60h ;fetch scan code mov byte ptr[scan],al mov al,20h out 20h,al pop es pop dx pop ax pop ds iret KBD_ISR ENDP ;======================================================================= _init_kbd PROC mov al,09h ;H„mta vektorn till INT 09 mov ah,35h int 21h mov word ptr[Org_Rutin],bx ;Org_Rutinens OFFSET h„mtas mov word ptr[Org_Rutin+2],es ;Segment sparas cli ;Fixa till ISR mov ax,0 mov es,ax mov di,24h mov ax,OFFSET KBD_ISR stosw mov ax,cs stosw sti ret _init_kbd ENDP _get_playkey PROC mov ax,0 mov al,byte ptr[scan] ;return scan in al ret _get_playkey ENDP _exit_kbd PROC cli mov ax,0 ;Restore INT 9 mov es,ax mov di,24h mov ax,word ptr[Org_Rutin] stosw mov ax,word ptr[Org_Rutin+2] stosw sti ret _exit_kbd ENDP END . 0