| 1 |
(* https://en.wikibooks.org/wiki/Pascal_Programming/Examples *) |
| 2 |
{...........................................................................} |
| 3 |
Procedure PrinterTest; { works in the text mode} |
| 4 |
|
| 5 |
begin |
| 6 |
rejestr.dx:=LPT1; { Port Number to which the printer is attached ; 0 = LPT1 } |
| 7 |
rejestr.ah:=2; { Function Number ; printer port status } |
| 8 |
Intr($17,rejestr); {BIOS Interrupt #17 : initializes the indicated printer port and returns its status } |
| 9 |
if rejestr.ah=144 { 10010000B : (bit 7) =1 i (bit 4) =1 } |
| 10 |
then writeLn('Printer on LPT1 is OK') |
| 11 |
else writeLn('Printer on LPT1 is not OK'); |
| 12 |
WriteLst(Reset); |
| 13 |
end; { Procedure PrinterTest } |