mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-06-03 00:58:31 +02:00
* changed the codepointer type in the i8086 small and compact memory models from
nearpointer to nearcspointer git-svn-id: trunk@37730 -
This commit is contained in:
parent
082c17fd93
commit
0119e7afb3
@ -35,7 +35,6 @@ interface
|
|||||||
ti8086addrnode = class(ti86addrnode)
|
ti8086addrnode = class(ti86addrnode)
|
||||||
protected
|
protected
|
||||||
procedure set_absvarsym_resultdef; override;
|
procedure set_absvarsym_resultdef; override;
|
||||||
function typecheck_non_proc(realsource: tnode; out res: tnode): boolean; override;
|
|
||||||
procedure pass_generate_code;override;
|
procedure pass_generate_code;override;
|
||||||
public
|
public
|
||||||
get_offset_only: boolean;
|
get_offset_only: boolean;
|
||||||
@ -78,23 +77,6 @@ implementation
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function ti8086addrnode.typecheck_non_proc(realsource: tnode; out res: tnode): boolean;
|
|
||||||
begin
|
|
||||||
res:=nil;
|
|
||||||
if (realsource.nodetype=loadn) and
|
|
||||||
(tloadnode(realsource).symtableentry.typ=labelsym) then
|
|
||||||
begin
|
|
||||||
if current_settings.x86memorymodel in x86_far_code_models then
|
|
||||||
resultdef:=voidfarpointertype
|
|
||||||
else
|
|
||||||
resultdef:=voidnearpointertype;
|
|
||||||
result:=true
|
|
||||||
end
|
|
||||||
else
|
|
||||||
result:=inherited;
|
|
||||||
end;
|
|
||||||
|
|
||||||
|
|
||||||
procedure ti8086addrnode.pass_generate_code;
|
procedure ti8086addrnode.pass_generate_code;
|
||||||
begin
|
begin
|
||||||
if get_offset_only then
|
if get_offset_only then
|
||||||
|
@ -638,6 +638,12 @@ implementation
|
|||||||
result:=false;
|
result:=false;
|
||||||
res:=nil;
|
res:=nil;
|
||||||
if (realsource.nodetype=loadn) and
|
if (realsource.nodetype=loadn) and
|
||||||
|
(tloadnode(realsource).symtableentry.typ=labelsym) then
|
||||||
|
begin
|
||||||
|
resultdef:=voidcodepointertype;
|
||||||
|
result:=true;
|
||||||
|
end
|
||||||
|
else if (realsource.nodetype=loadn) and
|
||||||
(tloadnode(realsource).symtableentry.typ=absolutevarsym) and
|
(tloadnode(realsource).symtableentry.typ=absolutevarsym) and
|
||||||
(tabsolutevarsym(tloadnode(realsource).symtableentry).abstyp=toaddr) then
|
(tabsolutevarsym(tloadnode(realsource).symtableentry).abstyp=toaddr) then
|
||||||
begin
|
begin
|
||||||
|
@ -166,8 +166,10 @@ implementation
|
|||||||
{$ifdef i8086}
|
{$ifdef i8086}
|
||||||
if current_settings.x86memorymodel in x86_far_code_models then
|
if current_settings.x86memorymodel in x86_far_code_models then
|
||||||
voidcodepointertype:=voidfarpointertype
|
voidcodepointertype:=voidfarpointertype
|
||||||
|
else if current_settings.x86memorymodel=mm_tiny then
|
||||||
|
voidcodepointertype:=voidnearpointertype
|
||||||
else
|
else
|
||||||
voidcodepointertype:=voidnearpointertype;
|
voidcodepointertype:=voidnearcspointertype;
|
||||||
voidstackpointertype:=voidnearsspointertype;
|
voidstackpointertype:=voidnearsspointertype;
|
||||||
{$else i8086}
|
{$else i8086}
|
||||||
voidcodepointertype:=voidpointertype;
|
voidcodepointertype:=voidpointertype;
|
||||||
|
@ -1045,6 +1045,36 @@ begin
|
|||||||
HexStr:=HexStr(Word(Val),4);
|
HexStr:=HexStr(Word(Val),4);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function HexStr(Val: NearCsPointer): ShortString;
|
||||||
|
begin
|
||||||
|
HexStr:='CS:'+HexStr(Word(Val),4);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function HexStr(Val: NearDsPointer): ShortString;
|
||||||
|
begin
|
||||||
|
HexStr:='DS:'+HexStr(Word(Val),4);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function HexStr(Val: NearEsPointer): ShortString;
|
||||||
|
begin
|
||||||
|
HexStr:='ES:'+HexStr(Word(Val),4);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function HexStr(Val: NearSsPointer): ShortString;
|
||||||
|
begin
|
||||||
|
HexStr:='SS:'+HexStr(Word(Val),4);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function HexStr(Val: NearFsPointer): ShortString;
|
||||||
|
begin
|
||||||
|
HexStr:='FS:'+HexStr(Word(Val),4);
|
||||||
|
end;
|
||||||
|
|
||||||
|
function HexStr(Val: NearGsPointer): ShortString;
|
||||||
|
begin
|
||||||
|
HexStr:='GS:'+HexStr(Word(Val),4);
|
||||||
|
end;
|
||||||
|
|
||||||
function HexStr(Val: FarPointer): ShortString;
|
function HexStr(Val: FarPointer): ShortString;
|
||||||
type
|
type
|
||||||
TFarPointerRec = record
|
TFarPointerRec = record
|
||||||
|
@ -406,10 +406,14 @@ Type
|
|||||||
CodePointer = FarPointer;
|
CodePointer = FarPointer;
|
||||||
CodePtrInt = Longint;
|
CodePtrInt = Longint;
|
||||||
CodePtrUInt = DWord;
|
CodePtrUInt = DWord;
|
||||||
{$elseif defined(FPC_X86_CODE_NEAR)}
|
{$elseif defined(FPC_MM_TINY)}
|
||||||
CodePointer = NearPointer;
|
CodePointer = NearPointer;
|
||||||
CodePtrInt = Integer;
|
CodePtrInt = Integer;
|
||||||
CodePtrUInt = Word;
|
CodePtrUInt = Word;
|
||||||
|
{$elseif defined(FPC_X86_CODE_NEAR)}
|
||||||
|
CodePointer = NearCsPointer;
|
||||||
|
CodePtrInt = Integer;
|
||||||
|
CodePtrUInt = Word;
|
||||||
{$else}
|
{$else}
|
||||||
CodePointer = Pointer;
|
CodePointer = Pointer;
|
||||||
CodePtrInt = PtrInt;
|
CodePtrInt = PtrInt;
|
||||||
@ -1195,6 +1199,12 @@ Function OctStr(Val:qword;cnt:byte):shortstring;
|
|||||||
Function binStr(Val:qword;cnt:byte):shortstring;
|
Function binStr(Val:qword;cnt:byte):shortstring;
|
||||||
{$ifdef CPUI8086}
|
{$ifdef CPUI8086}
|
||||||
Function hexStr(Val:NearPointer):shortstring;
|
Function hexStr(Val:NearPointer):shortstring;
|
||||||
|
function hexStr(Val:NearCsPointer):shortstring;
|
||||||
|
function hexStr(Val:NearDsPointer):shortstring;
|
||||||
|
function hexStr(Val:NearEsPointer):shortstring;
|
||||||
|
function hexStr(Val:NearSsPointer):shortstring;
|
||||||
|
function hexStr(Val:NearFsPointer):shortstring;
|
||||||
|
function hexStr(Val:NearGsPointer):shortstring;
|
||||||
Function hexStr(Val:FarPointer):shortstring;
|
Function hexStr(Val:FarPointer):shortstring;
|
||||||
Function hexStr(Val:HugePointer):shortstring;{$ifdef SYSTEMINLINE}inline;{$endif}
|
Function hexStr(Val:HugePointer):shortstring;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||||
{$else CPUI8086}
|
{$else CPUI8086}
|
||||||
|
@ -18,9 +18,9 @@
|
|||||||
{ determine the type of the resource/form file }
|
{ determine the type of the resource/form file }
|
||||||
{$define Win16Res}
|
{$define Win16Res}
|
||||||
|
|
||||||
{$if defined(FPC_MM_TINY) or defined(FPC_MM_SMALL) or defined(FPC_MM_LARGE) or defined(FPC_MM_HUGE)}
|
{$if defined(FPC_MM_TINY) or defined(FPC_MM_LARGE) or defined(FPC_MM_HUGE)}
|
||||||
{ CodePointer = Pointer; nothing to define }
|
{ CodePointer = Pointer; nothing to define }
|
||||||
{$elseif defined(FPC_MM_MEDIUM) or defined(FPC_MM_COMPACT)}
|
{$elseif defined(FPC_MM_SMALL) or defined(FPC_MM_MEDIUM) or defined(FPC_MM_COMPACT)}
|
||||||
{$define FPC_CODEPOINTER_DIFFERENT_THAN_POINTER}
|
{$define FPC_CODEPOINTER_DIFFERENT_THAN_POINTER}
|
||||||
{$else}
|
{$else}
|
||||||
{$fatal Unknown i8086 memory model.}
|
{$fatal Unknown i8086 memory model.}
|
||||||
|
Loading…
Reference in New Issue
Block a user