home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / INFO / TURBOPAS / TPGET.ZIP / GETKBD.PAS < prev   
Encoding:
Pascal/Delphi Source File  |  1985-02-26  |  1.3 KB  |  37 lines

  1. Procedure GetKbd ( Var ASCII_Code : Byte ;
  2.                    Var Scan_Code  : Byte   ) ;
  3.  
  4.     (*  This procedure utilizes the "Keyboard I/O" (interrupt $16)
  5.         of the ROM BIOS to retrieve the ASCII code and Scan code
  6.         of the key pressed by the user.  The procedure will not
  7.         return until a key has been pressed.
  8.  
  9.         This procedure was written by Paul D. Guest and released
  10.         to the Public Domain by same without restrictions on use,
  11.         and with no monetary return expected or desired.  Please
  12.         direct comments or questions to the author via "The Indy
  13.         Connection" RBBS @ (317) 846-8675 (24 hrs,7 days/week --
  14.         Paul & Greg McLear, sysops).
  15.         (Enjoy! - pdg 2/85)
  16.  
  17.     *)
  18.  
  19. Var
  20.     Reg : Record
  21.               AX,BX,CX,DX,BP,SI,DI,DS,ES,Flags : Integer ;
  22.           End ;
  23.  
  24. Begin (* Procedure GetKbd *)
  25.  
  26.     Reg.AX := $0000 ;
  27.     Intr ( $16 , Reg ) ;
  28.  
  29.     ASCII_Code := Lo ( Reg.AX ) ;
  30.     Scan_Code  := Hi ( Reg.AX ) ;
  31.  
  32.     If ( ASCII_Code = 0 ) AND ( Scan_Code = 0 ) Then
  33.             (* Allow a Ctrl-Break to stop program *)
  34.         Halt ;
  35.  
  36. End (* Procedure GetKbd *) ;
  37.