[fpc-pascal] Porting from Turbo Pascal to FPC

Francisco Glover francisco.glover at gmail.com
Wed Apr 29 10:42:17 CEST 2020

Overt the years I have developed programs  in Turbo Pascal for student lab
use, in which the student can easily send to an attached printer contents
of the text or VGA graphics screens. These no longer work on Windows 10.
In shifting to FPC , certain key procedures which worked in Turbo Pascal
running on Windows XP no longer work in FPC running on Windows 10. Samples
are shown below:
Program Sample;
{$ mode TP}
Uses Crt, Dos, Printer;
Var Regs: Registers;

 Procedure Print_screen;   { Interupt $05 }
     Intr($05, Regs);
   End;               {Nothing printed, exit code= 0}

 Procedure Print_string;
    Writeln('Text Screen');
    Writeln(LST, 'String to be printed');
  End;                {nothing printed, system hangs}

 Procedure Print_characters;   {Intrupt $17, function 0,  char to printer}
     Var j: byte;
         Msg: String[2];
     Msg :=  'A' + #11;    { #11 = formfeed  }
     For j := 1 to 2 do
          Regs.AH := 0;   {Function 0, output char}
          Regs.AL :=Ord(Msg[j]);
          Regs.DX := 0;   {default printer}
          Intr($17, Regs);
   End;      {Nothing printed, exit code= 0}

 Procedure Print1Char; {Interupt $21, Fcn 5}
     Regs.AH := 5; {print character}
     Regs.DL := 'A';
     Regs.AH := 5; {print character}
     Regs.DL := #11;  {formfeed}
   End;    {Nothing printed, exit code= 0}
How can I have my FPC programs running on Windows 10 send text and graphics
screens direct to an attached printer? Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-pascal/attachments/20200429/4254018b/attachment.html>

More information about the fpc-pascal mailing list