I
import
Unregistered / Unconfirmed
GUEST, unregistred user!
function PortIn(IOport:word):byte; assembler; asm
mov dx,ax
in al,dx
end;
function PortInW(IOport:word):word; assembler;
asm
mov dx,ax
in ax,dx
end;
procedure PortOut(IOport:word; Value:byte); assembler;
asm
xchg ax,dx
out dx,al
end;
procedure PortOutW(IOport:word; Value:word); assembler;
asm
xchg ax,dx
out dx,ax
end
{ Example use }
PROCEDURE TMainWin.Command(val:BYTE);
VAR Delay,num:INTEGER;
BEGIN
PortOut(Port,Val);
FOR Delay:= 1 TO 500 DO;
PortOut(Port+2,7);
FOR Delay:= 1 TO 500 DO;
num:= PortIn(Port+1) AND $32;
ShowMessage('Value read = '+IntToStr(num))
END;
mov dx,ax
in al,dx
end;
function PortInW(IOport:word):word; assembler;
asm
mov dx,ax
in ax,dx
end;
procedure PortOut(IOport:word; Value:byte); assembler;
asm
xchg ax,dx
out dx,al
end;
procedure PortOutW(IOport:word; Value:word); assembler;
asm
xchg ax,dx
out dx,ax
end
{ Example use }
PROCEDURE TMainWin.Command(val:BYTE);
VAR Delay,num:INTEGER;
BEGIN
PortOut(Port,Val);
FOR Delay:= 1 TO 500 DO;
PortOut(Port+2,7);
FOR Delay:= 1 TO 500 DO;
num:= PortIn(Port+1) AND $32;
ShowMessage('Value read = '+IntToStr(num))
END;