home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1989 / 05 / tricks / scaninfo.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  1989-02-23  |  1.2 KB  |  46 lines

  1. (* ------------------------------------------------------ *)
  2. (*                     SCANINFO.PAS                       *)
  3. (*        (c) 1988, 1989  K.F.Wienecke  & TOOLBOX         *)
  4. (* ------------------------------------------------------ *)
  5. PROGRAM ScanInfo;
  6.  
  7. USES Crt, Dos;
  8.  
  9. TYPE  string5       = STRING[5];
  10.       string16      = STRING[16];
  11.  
  12. VAR   regs          : Registers;
  13.       digit_string  : string16;
  14.  
  15. FUNCTION HexVal(number : WORD; positions : BYTE) : string5;
  16. VAR count        : BYTE;
  17.     help_string  : string5;
  18. BEGIN
  19.   help_string := '';
  20.   FOR count := 1 TO positions DO BEGIN
  21.     Insert(digit_string[(number MOD 16)+1], help_string, 1);
  22.     number := number SHR 4;
  23.   END;
  24.   HexVal := '$' + help_string;
  25. END;
  26.  
  27. BEGIN
  28.   ClrScr;
  29.   digit_string := '0123456789ABCDEF';
  30.   Write('Ende mit [ESC]');
  31.   WITH regs DO
  32.     REPEAT
  33.       ah := $10;
  34.       Intr($16, regs);
  35.       GotoXY(1,6);
  36.       WriteLn('ax =', hexval(ax, 4):6, #$0A);
  37.       WriteLn('ah =', hexval(ah, 2):6, #$0A);
  38.       WriteLn('al =', hexval(al, 2):6, #$0A#$0A);
  39.       Write  ('ASCII =  ', chr(al));
  40.     UNTIL ax = $011B;
  41.   ClrScr;
  42. END.
  43. (* ------------------------------------------------------ *)
  44. (*                Ende von SCANINFO.PAS                   *)
  45.  
  46.