home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 2 / ctrom_ii_b.zip / ctrom_ii_b / PROGRAM / PASCAL / PASTUT34 / INTRDEMO.PAS < prev    next >
Pascal/Delphi Source File  |  1993-01-14  |  2KB  |  37 lines

  1. program GetDisplayMode;
  2.  
  3. {~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~}
  4. {  Program to illustrate Turbo Pascal INTR procedure, which uses DOS. }
  5. {                                                                     }
  6. {  The BIOS Interrupt Service 10 Hex is used with Function (AH) = 0F  }
  7. {                                                                     }
  8. {  For use with Version 5+ of Turbo Pascal. Version 3 is different    }
  9. {  because Registers is not predefined in DOS, but user defined.      }
  10. {                                                                     }
  11. {  INTRDEMO.PAS  -> .EXE    R. Shaw      10.3.90                      }
  12. {_____________________________________________________________________}
  13.  
  14. uses DOS, Crt;
  15.  
  16. var
  17.    Regs        : Registers;    { Registers is a record defined in DOS }
  18.    Mode        : Byte;
  19.    Width       : Byte;
  20.    Page        : Byte;
  21.    DisplayMode : String[20];
  22.  
  23. begin
  24.    Regs.AX := $0F00;           { Sets AH = 0F for Get Display Mode function }
  25.    Intr($10,Regs);             { Interrupt 10 for ROM BIOS Video Services }
  26.    Mode  := Lo(Regs.AX);       { Display Mode returned in AL }
  27.    Width := Hi(Regs.AX);       { Screen width returned in AH }
  28.    Page  := Hi(Regs.BX);       { Screen page returned in BH }
  29.  
  30.    ClrScr;                                { Uses Crt }
  31.    Writeln('Display Mode is ',Mode);
  32.    Writeln('Screen Width is ',Width,' Columns');
  33.    Writeln('Screen Page is ',Page);
  34.    writeln;
  35.    write('Press any key to conclude...');
  36.    repeat until keypressed;
  37. end.