home *** CD-ROM | disk | FTP | other *** search
- Procedure GetKbd ( Var ASCII_Code : Byte ;
- Var Scan_Code : Byte ) ;
-
- (* This procedure utilizes the "Keyboard I/O" (interrupt $16)
- of the ROM BIOS to retrieve the ASCII code and Scan code
- of the key pressed by the user. The procedure will not
- return until a key has been pressed.
-
- This procedure was written by Paul D. Guest and released
- to the Public Domain by same without restrictions on use,
- and with no monetary return expected or desired. Please
- direct comments or questions to the author via "The Indy
- Connection" RBBS @ (317) 846-8675 (24 hrs,7 days/week --
- Paul & Greg McLear, sysops).
- (Enjoy! - pdg 2/85)
-
- *)
-
- Var
- Reg : Record
- AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags : Integer ;
- End ;
-
- Begin (* Procedure GetKbd *)
-
- Reg.AX := $0000 ;
- Intr ( $16 , Reg ) ;
-
- ASCII_Code := Lo ( Reg.AX ) ;
- Scan_Code := Hi ( Reg.AX ) ;
-
- If ( ASCII_Code = 0 ) AND ( Scan_Code = 0 ) Then
- (* Allow a Ctrl-Break to stop program *)
- Halt ;
-
- End (* Procedure GetKbd *) ;
-