Subversion Repositories svnkaklik

Rev

Go to most recent revision | Details | Last modification | View Log

Rev Author Line No. Line
6 kaklik 1
{Source code for inpout32.dll.
2
Enables 32-bit Visual Basic programs to do direct port I/O
3
(Inp and Out) under Windows 95.
4
To be compiled with Borland's Delphi 2.0.}
5
library inpout32;
6
uses SysUtils;
7
procedure Out32(PortAddress:smallint;Value:smallint);stdcall;export;
8
var
9
   ByteValue:Byte;
10
begin
11
     ByteValue:=Byte(Value);
12
     asm
13
        push dx
14
        mov dx,PortAddress
15
        mov al, ByteValue
16
        out dx,al
17
        pop dx
18
     end;
19
end;
20
 
21
function Inp32(PortAddress:smallint):smallint;stdcall;export;
22
var
23
   ByteValue:byte;
24
begin
25
   asm
26
        push dx
27
        mov dx, PortAddress
28
        in al,dx
29
        mov ByteValue,al
30
        pop dx
31
    end;
32
    Inp32:=smallint(ByteValue) and $00FF;
33
end;
34
Exports
35
       Inp32,
36
       Out32;
37
begin
38
end.