mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-07 18:48:04 +02:00
+ initialize StackBottom and StackLength in the win16 system unit startup code
git-svn-id: trunk@31567 -
This commit is contained in:
parent
026d2be316
commit
a76c9ebd43
@ -116,6 +116,19 @@ type
|
|||||||
PFarChar = ^Char;far;
|
PFarChar = ^Char;far;
|
||||||
PFarWord = ^Word;far;
|
PFarWord = ^Word;far;
|
||||||
|
|
||||||
|
{ structure, located at DS:0, initialized by InitTask }
|
||||||
|
PAutoDataSegHeader = ^TAutoDataSegHeader;
|
||||||
|
TAutoDataSegHeader = record
|
||||||
|
null: Word;
|
||||||
|
oOldSP: Word;
|
||||||
|
hOldSS: Word;
|
||||||
|
pLocalHeap: Word;
|
||||||
|
pAtomTable: Word;
|
||||||
|
pStackTop: Word;
|
||||||
|
pStackMin: Word;
|
||||||
|
pStackBot: Word;
|
||||||
|
end;
|
||||||
|
|
||||||
{$I registers.inc}
|
{$I registers.inc}
|
||||||
|
|
||||||
{$define SYSTEMUNIT}
|
{$define SYSTEMUNIT}
|
||||||
@ -291,5 +304,18 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
begin
|
begin
|
||||||
|
{$if defined(FPC_X86_DATA_FAR) or defined(FPC_X86_DATA_HUGE)}
|
||||||
|
with PAutoDataSegHeader(Ptr(DSeg,0))^ do
|
||||||
|
begin
|
||||||
|
StackBottom := Ptr(SSeg,pStackTop);
|
||||||
|
StackLength := pStackBot-pStackTop;
|
||||||
|
end;
|
||||||
|
{$else}
|
||||||
|
with PAutoDataSegHeader(0)^ do
|
||||||
|
begin
|
||||||
|
StackBottom := NearPointer(pStackTop);
|
||||||
|
StackLength := pStackBot-pStackTop;
|
||||||
|
end;
|
||||||
|
{$endif}
|
||||||
MessageBox(0, 'Hello, world!', 'yo', 0);
|
MessageBox(0, 'Hello, world!', 'yo', 0);
|
||||||
end.
|
end.
|
||||||
|
Loading…
Reference in New Issue
Block a user