DelphiFAQ Home Search:
General :: Programming :: Delphi
General Delphi related information.

Articles:

This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.
Recommended links on this topic:
Featured Article

Read and write I/O ports

In Borland Pascal and Delphi 1, there is a predefined pseudo variable Port.

In the 32bit versions of Delphi you need 2 lines of assembler code..

function InPort(PortAddr:word): byte;
 {$IFDEF WIN32}
 assembler; stdcall;
 asm
   mov dx,PortAddr
   in al,dx
 end;
 {$else}
 begin
   Result := Port[PortAddr];
 end;
 {$ENDIF}
You don't like the formatting? Check out SourceCoder then!
Generated 12:02:13 on Feb 24, 2018