home *** CD-ROM | disk | FTP | other *** search
- name keydrvpc
- ;
- ; keydrvpc.asm: hterm key board driver for IBM-PC
- ;
- ; Author: HIRANO Satoshi
- ;
- ; (C) 1989 Halca Computer Science Laboratory TM
- ; University of Tokyo
- ;
- ; Edition History:
- ; 2.2 89/05/16 Halca.Hirano V2.2 distribution
- ; 2.3 89/06/20 Halca.Hirano rename from xkeypc.asm
- ; 2.4 89/07/02 Halca.Hirano add strPut() for string putting to CRT
- ; 2.5 89/07/27 Halca.Hirano far
- ; ---- V2.4.0 distribution ----
- ; 2.6 90/06/22 Tominaga@titech force to enable interrupt at returning
- ; from inputKey() against ATOK's mischief
- ;
- ; $Header: keydrvpc.asv 1.5 90/06/23 03:19:04 hirano Exp $
-
- _TEXT segment byte public 'CODE'
- _TEXT ends
- assume cs:_TEXT
- _TEXT segment
- public _inputKey
- _inputKey proc far
- mov ah,1
- int 016h
- jnz _ink2
- mov ax,-1
- jmp _ink3
- _ink2: mov ah,0
- int 16h
- _ink3:
- ; to override someone's arbitrary disabling of hardware interrupts
- sti ; sometimes ATOK disables interrupt!
- ret
- _inputKey endp
-
- public _checkBIOSKey
- _checkBIOSKey proc far
- mov ah,1
- int 016h ; ? got
- jnz _inb2 ; bra if so
- mov ax,0 ; return no
- ret
- _inb2: mov ax,1 ; return yes
- ret
- _checkBIOSKey endp
-
- ;
- ; strPut(page, n, x, y, str)
- ;
- ; in:
- ; page page number
- ; n number of chars
- ; x cursor x
- ; y cursor y
- ; str far pointer to string
- ; note: cursor position does not change
- ;
- public _strPut
- _strPut proc far
- push bp
- mov bp,sp
- push bx
- push cx
- push dx
- push es
- mov ah,13h ; string write code
- mov al,2 ; char, attr write
- mov cx,[10+bp]
- mov dh,ch ; x
- mov cx,[12+bp]
- mov dl,cl ; y
- mov cx,[8+bp] ; number of chars
- mov bx,[6+bp] ; page number
- mov bl,0 ; attribute (not used)
- mov bp,[14+bp] ; far pointer to str
- push ds
- pop es ; make it far pointer
- int 010h ; call bios
- pop es
- pop dx
- pop cx
- pop bx
- pop bp
- ret
- _strPut endp
- _TEXT ends
- end
-