mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 18:09:27 +02:00
* far pointer helper types made global in the implementation of the system unit
git-svn-id: trunk@24578 -
This commit is contained in:
parent
a308994423
commit
035cb74855
@ -81,6 +81,11 @@ implementation
|
||||
const
|
||||
fCarry = 1;
|
||||
|
||||
type
|
||||
PFarByte = ^Byte;far;
|
||||
PFarChar = ^Char;far;
|
||||
PFarWord = ^Word;far;
|
||||
|
||||
var
|
||||
dos_version:Word;public name 'dos_version';
|
||||
|
||||
@ -126,9 +131,6 @@ end;
|
||||
*****************************************************************************}
|
||||
|
||||
function GetProgramName: string;
|
||||
type
|
||||
PFarByte = ^Byte;far;
|
||||
PFarWord = ^Word;far;
|
||||
var
|
||||
dos_env_seg: Word;
|
||||
ofs: Word;
|
||||
@ -142,14 +144,14 @@ begin
|
||||
dos_env_seg := PFarWord(Ptr(dos_psp, $2C))^;
|
||||
ofs := 1;
|
||||
repeat
|
||||
Ch := Chr(PFarByte(Ptr(dos_env_seg,ofs - 1))^);
|
||||
Ch2 := Chr(PFarByte(Ptr(dos_env_seg,ofs))^);
|
||||
Ch := PFarChar(Ptr(dos_env_seg,ofs - 1))^;
|
||||
Ch2 := PFarChar(Ptr(dos_env_seg,ofs))^;
|
||||
if (Ch = #0) and (Ch2 = #0) then
|
||||
begin
|
||||
Inc(ofs, 3);
|
||||
GetProgramName := '';
|
||||
repeat
|
||||
Ch := Chr(PFarByte(Ptr(dos_env_seg,ofs))^);
|
||||
Ch := PFarChar(Ptr(dos_env_seg,ofs))^;
|
||||
if Ch <> #0 then
|
||||
GetProgramName := GetProgramName + Ch;
|
||||
Inc(ofs);
|
||||
@ -170,6 +172,7 @@ begin
|
||||
until false;
|
||||
end;
|
||||
|
||||
|
||||
function paramcount : longint;
|
||||
begin
|
||||
paramcount := 0;
|
||||
|
Loading…
Reference in New Issue
Block a user