home *** CD-ROM | disk | FTP | other *** search
- ;_ bios.asm Sun May 8 1988 Modified by: Walter Bright */
-
- include macros.asm
-
- begcode bios
-
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Access BIOS keyboard function
- ; #include <bios.h>
- ; int _bios_keybrd(int flag);
- ; int bioskey(int flag); /* both are the same routine */
- ; Usage:
- ; flag = 0 Return ascii value in low byte, scan code in high byte
- ; = 1 Return 0 if no key is available else return ascii
- ; value in low byte and scan code in high byte. Key is
- ; left unread in BIOS
- ; = 2 Return shift status, bits are:
- ; 0x01 Right shift key is down
- ; 0x02 Left shift key is down
- ; 0x04 Ctrl key is down
- ; 0x08 Alt key is down
- ; 0x10 Scroll Lock is toggled
- ; 0x20 Num Lock is toggled
- ; 0x40 Caps Lock is toggled
- ; 0x80 Ins is toggled
- ; Other bits are undefined
-
- public _bioskey
- _bioskey:
-
- c_public _bios_keybrd
- func _bios_keybrd
- push BP
- mov BP,SP
- mov AH,P[BP]
- int 16h
- jnz K1
- .if <byte ptr P[BP]> ne 1, K1
- clr AX ;if flag is 1 and Z was set
- K1: pop BP
- ret
-
- c_endp _bios_keybrd
-
- endcode bios
-
- end
-