|
@@ -16,15 +16,6 @@
|
|
|
|
|
|
unit ports;
|
|
|
|
|
|
-{$if defined(CPU80386)
|
|
|
- or defined(CPUPENTIUM)
|
|
|
- or defined(CPUPENTIUM2)
|
|
|
- or defined(CPUPENTIUM3)
|
|
|
- or defined(CPUPENTIUM4)
|
|
|
- or defined(CPUPENTIUMM)}
|
|
|
- {$define CPU_IS_386_OR_LATER}
|
|
|
-{$endif}
|
|
|
-
|
|
|
interface
|
|
|
|
|
|
type
|
|
@@ -40,22 +31,19 @@ type
|
|
|
property pp[w : word] : word read readport write writeport;default;
|
|
|
end;
|
|
|
|
|
|
-{$ifdef CPU_IS_386_OR_LATER}
|
|
|
tportl = object
|
|
|
procedure writeport(p : word;data : longint);
|
|
|
function readport(p : word) : longint;
|
|
|
property pp[w : word] : longint read readport write writeport;default;
|
|
|
end;
|
|
|
-{$endif CPU_IS_386_OR_LATER}
|
|
|
+
|
|
|
var
|
|
|
{ we don't need to initialize port, because neither member
|
|
|
variables nor virtual methods are accessed }
|
|
|
port,
|
|
|
portb : tport;
|
|
|
portw : tportw;
|
|
|
-{$ifdef CPU_IS_386_OR_LATER}
|
|
|
portl : tportl;
|
|
|
-{$endif CPU_IS_386_OR_LATER}
|
|
|
|
|
|
implementation
|
|
|
|
|
@@ -91,7 +79,7 @@ asm
|
|
|
end;
|
|
|
|
|
|
|
|
|
-{$ifdef CPU_IS_386_OR_LATER}
|
|
|
+{$asmcpu 80386}
|
|
|
procedure tportl.writeport(p : word;data : longint);assembler;
|
|
|
asm
|
|
|
mov dx, p
|
|
@@ -107,6 +95,5 @@ asm
|
|
|
mov edx, eax
|
|
|
shr edx, 16
|
|
|
end;
|
|
|
-{$endif CPU_IS_386_OR_LATER}
|
|
|
|
|
|
end.
|