parallel port


[ Related Articles and Replies ] [ DelphiLand FAQ ] [ Delphi Tutorials ]

Posted by JHC on January 11, 2002 at 23:30:44:

I found that to use parallel ports more than for printers you use some assmebler lines of code but when I use in delphi5 these instructions :

  implementation
  {$R *.DFM}
  {$R+} {nothing to do with previous $R} 
 procedure Tform1.PortOut(IOport:word; Value:byte); assembler;
    asm
      xchg ax,dx
      out dx,al
    end;
procedure TForm1.Button1Click(Sender: TObject);
var delay : integer;
begin
  PortOut(888,$FF);
For delay:=1 to 500 do;
  PortOut(890,7);
end;
procedure TForm1.Button2Click(Sender: TObject);
var delay : integer;
begin
  PortOut(888,$00);
For delay:=1 to 500 do;
  PortOut(890,7);
end;
end.

I've no results
Could you say me if it's the right code to use parallel port for delphi5
Thanks


Related Articles and Replies:


[ Related Articles and Replies ] [ DelphiLand FAQ ] [ Delphi Tutorials ]