hejsa igen............
her er en unit, der kan noget af alt det frække du gerne vil............
god fornøjelse.......
Finn Bindeballe
FinnB@post6.tele.dk
unit port;
interface
procedure WritePort(adr:Word;Value:Byte);
procedure WritePortW(adr,Value:Word);
//procedure WritePortL(adr:Word;value:LongWord);
function ReadPort(adr:Word):byte;
function ReadPortW(adr:Word):Word;
//function ReadPortL(adr:Word):LongWord;
implementation
procedure WritePort(adr:Word;Value:Byte);
begin
asm
mov dx,adr
mov al,value
out dx,al
end;
end;
procedure WritePortW(adr,Value:Word);
begin
asm
mov dx,adr
mov ax,value
out dx,ax
end;
end;
{
procedure WritePortL(adr:Word;value:LongWord);
begin
asm
mov dx,adr
mov eax,value
out dx,eax
end;
end;
}
function ReadPort(adr:Word):byte;
begin
asm
mov dx,adr
in al,dx
mov Result,al
end;
end;
function ReadPortW(adr:Word):Word;
begin
asm
mov dx,adr
in ax,dx
mov Result,ax
end;
end;
{
function ReadPortL(adr:Word):LongWord;
begin
asm
mov dx,adr
in eax,dx
mov Result,eax
end;
end;
}
|