Browse Source

* msdos system unit variable dos_psp renamed PrefixSeg for TP7 compatibility

git-svn-id: trunk@28047 -
nickysn 11 years ago
parent
commit
23b0cf2340
3 changed files with 12 additions and 11 deletions
  1. 2 2
      rtl/msdos/dos.pp
  2. 4 4
      rtl/msdos/prt0comn.asm
  3. 6 5
      rtl/msdos/system.pp

+ 2 - 2
rtl/msdos/dos.pp

@@ -960,7 +960,7 @@ var
   ofs: Word;
   ofs: Word;
   Ch, Ch2: Char;
   Ch, Ch2: Char;
 begin
 begin
-  dos_env_seg := PFarWord(Ptr(dos_psp, $2C))^;
+  dos_env_seg := PFarWord(Ptr(PrefixSeg, $2C))^;
   GetEnvStr := 1;
   GetEnvStr := 1;
   OutEnvStr := '';
   OutEnvStr := '';
   ofs := 0;
   ofs := 0;
@@ -1061,7 +1061,7 @@ end;
 
 
 Procedure Keep(exitcode: word); assembler;
 Procedure Keep(exitcode: word); assembler;
 asm
 asm
-  mov bx, dos_psp
+  mov bx, PrefixSeg
   dec bx
   dec bx
   mov es, bx
   mov es, bx
   mov dx, es:[3]
   mov dx, es:[3]

+ 4 - 4
rtl/msdos/prt0comn.asm

@@ -39,7 +39,7 @@
         segment text use16 class=code
         segment text use16 class=code
 
 
         extern PASCALMAIN
         extern PASCALMAIN
-        extern dos_psp
+        extern __fpc_PrefixSeg
         extern dos_version
         extern dos_version
         extern __Test8086
         extern __Test8086
 
 
@@ -102,9 +102,9 @@
         ; init DS
         ; init DS
         mov ds, bx
         mov ds, bx
 
 
-        ; pop the PSP from stack and store it in the pascal variable dos_psp
+        ; pop the PSP from stack and store it in the pascal variable PrefixSeg
         pop ax
         pop ax
-        mov word [dos_psp], ax
+        mov word [__fpc_PrefixSeg], ax
 
 
         ; get DOS version and save it in the pascal variable dos_version
         ; get DOS version and save it in the pascal variable dos_version
         mov ax, 3000h
         mov ax, 3000h
@@ -161,7 +161,7 @@ cpu_detect_done:
 data_with_maxheap_less_than_64k:
 data_with_maxheap_less_than_64k:
 
 
         ; try to resize our main DOS memory block until the end of the data segment (or even smaller, if maxheap is small)
         ; try to resize our main DOS memory block until the end of the data segment (or even smaller, if maxheap is small)
-        mov cx, word [dos_psp]
+        mov cx, word [__fpc_PrefixSeg]
 %ifdef __TINY__
 %ifdef __TINY__
         mov dx, cs
         mov dx, cs
 %else
 %else

+ 6 - 5
rtl/msdos/system.pp

@@ -62,7 +62,8 @@ var
   envp:PPchar; //!! public name 'operatingsystem_parameter_envp';
   envp:PPchar; //!! public name 'operatingsystem_parameter_envp';
   dos_argv0 : pchar; //!! public name 'dos_argv0';
   dos_argv0 : pchar; //!! public name 'dos_argv0';
 
 
-  dos_psp:Word;public name 'dos_psp';
+{ The DOS Program Segment Prefix segment (TP7 compatibility) }
+  PrefixSeg:Word;public name '__fpc_PrefixSeg';
 
 
   SaveInt00: FarPointer;public name '__SaveInt00';
   SaveInt00: FarPointer;public name '__SaveInt00';
 
 
@@ -179,7 +180,7 @@ begin
       GetProgramName := '';
       GetProgramName := '';
       exit;
       exit;
     end;
     end;
-  dos_env_seg := PFarWord(Ptr(dos_psp, $2C))^;
+  dos_env_seg := PFarWord(Ptr(PrefixSeg, $2C))^;
   ofs := 1;
   ofs := 1;
   repeat
   repeat
     Ch := PFarChar(Ptr(dos_env_seg,ofs - 1))^;
     Ch := PFarChar(Ptr(dos_env_seg,ofs - 1))^;
@@ -215,10 +216,10 @@ function GetCommandLine: string;
 var
 var
   len, I: Integer;
   len, I: Integer;
 begin
 begin
-  len := PFarByte(Ptr(dos_psp, $80))^;
+  len := PFarByte(Ptr(PrefixSeg, $80))^;
   SetLength(GetCommandLine, len);
   SetLength(GetCommandLine, len);
   for I := 1 to len do
   for I := 1 to len do
-    GetCommandLine[I] := PFarChar(Ptr(dos_psp, $80 + I))^;
+    GetCommandLine[I] := PFarChar(Ptr(PrefixSeg, $80 + I))^;
 end;
 end;
 
 
 
 
@@ -345,7 +346,7 @@ end;
 
 
 function GetProcessID: SizeUInt;
 function GetProcessID: SizeUInt;
 begin
 begin
-  GetProcessID := dos_psp;
+  GetProcessID := PrefixSeg;
 end;
 end;
 
 
 function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;
 function CheckInitialStkLen(stklen : SizeUInt) : SizeUInt;