Browse Source

+ added rtl helper for huge pointer subtraction

git-svn-id: trunk@28178 -
nickysn 11 years ago
parent
commit
13646c7afe
2 changed files with 6 additions and 0 deletions
  1. 5 0
      rtl/i8086/hugeptr.inc
  2. 1 0
      rtl/inc/compproc.inc

+ 5 - 0
rtl/i8086/hugeptr.inc

@@ -46,6 +46,11 @@ begin
   fpc_hugeptr_sub_longint_normalized:=HugePointer(Ptr(linear shr 4,linear and $F));
   fpc_hugeptr_sub_longint_normalized:=HugePointer(Ptr(linear shr 4,linear and $F));
 end;
 end;
 
 
+function fpc_hugeptr_sub_hugeptr(p1, p2: HugePointer): LongInt; compilerproc;
+begin
+  fpc_hugeptr_sub_hugeptr:=((LongInt(Seg(p1^)) shl 4)+Ofs(p1^))-((LongInt(Seg(p2^)) shl 4)+Ofs(p2^));
+end;
+
 procedure fpc_hugeptr_inc_longint(var p: HugePointer; n: LongInt); compilerproc;
 procedure fpc_hugeptr_inc_longint(var p: HugePointer; n: LongInt); compilerproc;
 var
 var
   o: LongInt;
   o: LongInt;

+ 1 - 0
rtl/inc/compproc.inc

@@ -753,6 +753,7 @@ function fpc_hugeptr_add_longint(p: HugePointer; n: LongInt): HugePointer; compi
 function fpc_hugeptr_add_longint_normalized(p: HugePointer; n: LongInt): HugePointer; compilerproc;
 function fpc_hugeptr_add_longint_normalized(p: HugePointer; n: LongInt): HugePointer; compilerproc;
 function fpc_hugeptr_sub_longint(p: HugePointer; n: LongInt): HugePointer; compilerproc;
 function fpc_hugeptr_sub_longint(p: HugePointer; n: LongInt): HugePointer; compilerproc;
 function fpc_hugeptr_sub_longint_normalized(p: HugePointer; n: LongInt): HugePointer; compilerproc;
 function fpc_hugeptr_sub_longint_normalized(p: HugePointer; n: LongInt): HugePointer; compilerproc;
+function fpc_hugeptr_sub_hugeptr(p1, p2: HugePointer): LongInt; compilerproc;
 procedure fpc_hugeptr_inc_longint(var p: HugePointer; n: LongInt); compilerproc;
 procedure fpc_hugeptr_inc_longint(var p: HugePointer; n: LongInt); compilerproc;
 procedure fpc_hugeptr_inc_longint_normalized(var p: HugePointer; n: LongInt); compilerproc;
 procedure fpc_hugeptr_inc_longint_normalized(var p: HugePointer; n: LongInt); compilerproc;
 procedure fpc_hugeptr_dec_longint(var p: HugePointer; n: LongInt); compilerproc;
 procedure fpc_hugeptr_dec_longint(var p: HugePointer; n: LongInt); compilerproc;