Browse Source

+ implemented dos.GetIntVec and SetIntVec for i8086-msdos

git-svn-id: trunk@24720 -
nickysn 12 years ago
parent
commit
896d2f2bd5
2 changed files with 31 additions and 2 deletions
  1. 2 2
      rtl/inc/dosh.inc
  2. 29 0
      rtl/msdos/dos.pp

+ 2 - 2
rtl/inc/dosh.inc

@@ -134,8 +134,8 @@ Procedure SetVerify(verify: boolean);
 
 
 {Do Nothing Functions}
 {Do Nothing Functions}
 Procedure SwapVectors;
 Procedure SwapVectors;
-Procedure GetIntVec(intno: byte; var vector: pointer);
-Procedure SetIntVec(intno: byte; vector: pointer);
+Procedure GetIntVec(intno: byte; var vector: {$ifdef i8086}farpointer{$else}pointer{$endif});
+Procedure SetIntVec(intno: byte; vector: {$ifdef i8086}farpointer{$else}pointer{$endif});
 Procedure Keep(exitcode: word);
 Procedure Keep(exitcode: word);
 
 
 {Additional (non-TP) function for quick access to system timer - for FV etc.}
 {Additional (non-TP) function for quick access to system timer - for FV etc.}

+ 29 - 0
rtl/msdos/dos.pp

@@ -14,6 +14,7 @@
  **********************************************************************}
  **********************************************************************}
 
 
 {$inline on}
 {$inline on}
+{$asmmode intel}
 
 
 unit dos;
 unit dos;
 
 
@@ -86,6 +87,8 @@ type
 {$DEFINE HAS_SETVERIFY}
 {$DEFINE HAS_SETVERIFY}
 {$DEFINE HAS_GETVERIFY}
 {$DEFINE HAS_GETVERIFY}
 {$DEFINE HAS_SWAPVECTORS}
 {$DEFINE HAS_SWAPVECTORS}
+{$DEFINE HAS_GETINTVEC}
+{$DEFINE HAS_SETINTVEC}
 {$DEFINE HAS_GETSHORTNAME}
 {$DEFINE HAS_GETSHORTNAME}
 {$DEFINE HAS_GETLONGNAME}
 {$DEFINE HAS_GETLONGNAME}
 
 
@@ -925,6 +928,32 @@ begin
    end;
    end;
 end;
 end;
 
 
+{******************************************************************************
+                             --- Get/SetIntVec ---
+******************************************************************************}
+
+procedure GetIntVec(intno: Byte; var vector: farpointer); assembler;
+asm
+  mov al, intno
+  mov ah, 35h
+  int 21h
+  xchg ax, bx
+  mov bx, vector
+  mov [bx], ax
+  mov ax, es
+  mov [bx + 2], ax
+end;
+
+procedure SetIntVec(intno: Byte; vector: farpointer); assembler;
+asm
+  push ds
+  mov al, intno
+  mov ah, 25h
+  lds dx, word [vector]
+  int 21h
+  pop ds
+end;
+
 {$ifdef DEBUG_LFN}
 {$ifdef DEBUG_LFN}
 begin
 begin
   LogLFN:=(GetEnv('LOGLFN')<>'');
   LogLFN:=(GetEnv('LOGLFN')<>'');