home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Underground
/
UNDERGROUND.ISO
/
ports
/
par_test.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-07-28
|
941b
|
30 lines
Const Base=$378; {base address of parallel port}
Procedure PutChar_Par(z:Char);
{outputs a character to parallel port (base address in "Base")}
Begin
While Port[Base+1] and 128 = 0 Do;
{wait for end of Busy}
Port[Base]:=Ord(z); {place character on port}
Port[Base+2]:=Port[Base+2] or 1;
{send strobe}
Port[Base+2]:=Port[Base+2] and not 1;
While Port[Base+1] and 64 = 1 do;
{wait for Ack}
End;
Procedure PutString_Par(s:String);
{outputs string to parallel port, uses PutChar_Par)}
Var i:Integer; {character counter}
Begin
For i:=1 to Length(s) do {each character}
PutChar_Par(s[i]); {send to parallel port}
End;
Begin
PutString_Par('Hello, Abacus Printer Test'#13#10);
PutString_Par('abcdefghijklmnopqrstuvwxyz0123456789'#13#10);
End.