Jump to content


Check out our Community Blogs

dejanristanovic

Member Since 15 Apr 2012
Offline Last Active Apr 15 2012 06:36 PM
-----

Topics I've Started

Bios Calls From Delphi

15 April 2012 - 01:07 PM

I am trying to convert some old Turbo Pascal 5.5 program to Delphi, so that it would run in 32-bit environment. It was easier than I expected, and the program basically works. However, there is the part where I control Centronics printer, with the code like:

procedure lpt_send_char (ch: byte);
var regs: registers;
a: char;
status: Boolean;
begin
repeat
repeat
regs.ah:=$2;
regs.dx:=0; {port}
intr ($17, regs);
until (regs.ah and $80)<>0;
regs.ah:=$0; regs.al:=ch; regs.dx:=0;
intr ($17, regs);
status:=(regs.ah and $29)=0;
if not status then
begin
writeln ('Printer I/O error');
write ('Abort, Retry?');
repeat until keypressed;
a:=upcase(readkey); writeln (a);
if a='A' then halt;
end;
until status;
end;

Now is there even a remote chance to make this work in 32-bit/64-bit environment or should I start rewriting the complete printer control segment?

Thank you for your help.

Dejan

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download