home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / cmplangm / 1989_4 / putimage.pas < prev    next >
Pascal/Delphi Source File  |  1989-03-21  |  1KB  |  40 lines

  1. {This code accompanies the letter from Francisco Glover on pp. 11-12 of the
  2. April 1989 Computer Language. It's an enhancement to John Figueras's "Virtual
  3. Mouse" article from the October 1988 issue.}
  4.  
  5. Procedure IntHandler;   INTERRUPT;
  6.     {Traps the press and relase of arrow keys and F2; all other
  7.      codes are passed to normal BIOS keyboard service, now
  8.      moved from Int 9 to Int $64. This procedure may NOT be
  9.      declared in the INTERFACE.}
  10.  
  11. VAR Code: byte;
  12.     RR: Registers;
  13.     PassAlong: boolean;
  14.  
  15. Begin
  16.     Inline($FB);                  {Enable interrupts}
  17.     Code := Port[$60];            {Fetch scan code}
  18.     PassAlong := NOT (Up OR Down OR Left OR Right);
  19.     If (Code in [72,200, 75,203, 77,205, 80,208, 60,188]) then
  20.          Case Code of
  21.               72: Begin Up := True; Down := False; End;
  22.                    200: Up := False
  23.               75,115: Begin Left := True. Right := False; End;
  24.                    203: Left := False;
  25.               77,116: Begin Right := True; Left := False; End;
  26.                    205: Right := False;
  27.               80: Begin Down := True; Up := False; End;
  28.                    208: Down := False;
  29.               60: Slow := True;
  30.                    118: Slow := False;
  31.          End; {Case}
  32. If (PassAlong) then Intr($64,RR) else
  33.     Begin
  34.          Port[$61] := Port[$61] OR $80;
  35.          Port[$61] := Port[$61] AND $7F;
  36.          Port[$20] := $20;
  37.     End;
  38. End; {IntHandler}
  39.  
  40.