size : 391
uploaded_on : Tue Nov 10 00:00:00 1998
modified_on : Wed Dec 8 14:03:27 1999
title : Port access
org_filename : portxs.txt
author : unknown
authoremail :
description : Hardware port access
keywords :
tested : not tested yet
submitted_by : Unofficial Delphi Developers FAQ
submitted_by_email : uddf@gnomehome.demon.nl
uploaded_by : nobody
modified_by : nobody
owner : nobody
lang : plain
file-type : text/plain
category : delphi-misc
__END_OF_HEADER__
function InPort(PortAddr: word): byte;
{$IFDEF VER90}
assembler; stdcall;
asm
mov dx,PortAddr
in al,dx
end;
{$ELSE}
begin
Result := Port[PortAddr];
end;
{$ENDIF}
procedure OutPort(PortAddr: word; Databyte: byte);
{$IFDEF VER90}
assembler; stdcall;
asm
mov al,Databyte
mov dx,PortAddr
out dx,al
end;
{$ELSE}
begin
Port[PortAddr] := DataByte;
end;
{$ENDIF}