mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-05-28 22:02:40 +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)
|
||||
protected
|
||||
procedure set_absvarsym_resultdef; override;
|
||||
function typecheck_non_proc(realsource: tnode; out res: tnode): boolean; override;
|
||||
procedure pass_generate_code;override;
|
||||
public
|
||||
get_offset_only: boolean;
|
||||
@ -78,23 +77,6 @@ implementation
|
||||
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;
|
||||
begin
|
||||
if get_offset_only then
|
||||
|
@ -638,8 +638,14 @@ implementation
|
||||
result:=false;
|
||||
res:=nil;
|
||||
if (realsource.nodetype=loadn) and
|
||||
(tloadnode(realsource).symtableentry.typ=absolutevarsym) and
|
||||
(tabsolutevarsym(tloadnode(realsource).symtableentry).abstyp=toaddr) then
|
||||
(tloadnode(realsource).symtableentry.typ=labelsym) then
|
||||
begin
|
||||
resultdef:=voidcodepointertype;
|
||||
result:=true;
|
||||
end
|
||||
else if (realsource.nodetype=loadn) and
|
||||
(tloadnode(realsource).symtableentry.typ=absolutevarsym) and
|
||||
(tabsolutevarsym(tloadnode(realsource).symtableentry).abstyp=toaddr) then
|
||||
begin
|
||||
offset:=tabsolutevarsym(tloadnode(realsource).symtableentry).addroffset;
|
||||
hp:=left;
|
||||
|
@ -166,8 +166,10 @@ implementation
|
||||
{$ifdef i8086}
|
||||
if current_settings.x86memorymodel in x86_far_code_models then
|
||||
voidcodepointertype:=voidfarpointertype
|
||||
else if current_settings.x86memorymodel=mm_tiny then
|
||||
voidcodepointertype:=voidnearpointertype
|
||||
else
|
||||
voidcodepointertype:=voidnearpointertype;
|
||||
voidcodepointertype:=voidnearcspointertype;
|
||||
voidstackpointertype:=voidnearsspointertype;
|
||||
{$else i8086}
|
||||
voidcodepointertype:=voidpointertype;
|
||||
|
@ -1045,6 +1045,36 @@ begin
|
||||
HexStr:=HexStr(Word(Val),4);
|
||||
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;
|
||||
type
|
||||
TFarPointerRec = record
|
||||
|
@ -406,10 +406,14 @@ Type
|
||||
CodePointer = FarPointer;
|
||||
CodePtrInt = Longint;
|
||||
CodePtrUInt = DWord;
|
||||
{$elseif defined(FPC_X86_CODE_NEAR)}
|
||||
{$elseif defined(FPC_MM_TINY)}
|
||||
CodePointer = NearPointer;
|
||||
CodePtrInt = Integer;
|
||||
CodePtrUInt = Word;
|
||||
{$elseif defined(FPC_X86_CODE_NEAR)}
|
||||
CodePointer = NearCsPointer;
|
||||
CodePtrInt = Integer;
|
||||
CodePtrUInt = Word;
|
||||
{$else}
|
||||
CodePointer = Pointer;
|
||||
CodePtrInt = PtrInt;
|
||||
@ -1195,6 +1199,12 @@ Function OctStr(Val:qword;cnt:byte):shortstring;
|
||||
Function binStr(Val:qword;cnt:byte):shortstring;
|
||||
{$ifdef CPUI8086}
|
||||
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:HugePointer):shortstring;{$ifdef SYSTEMINLINE}inline;{$endif}
|
||||
{$else CPUI8086}
|
||||
|
@ -18,9 +18,9 @@
|
||||
{ determine the type of the resource/form file }
|
||||
{$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 }
|
||||
{$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}
|
||||
{$else}
|
||||
{$fatal Unknown i8086 memory model.}
|
||||
|
Loading…
Reference in New Issue
Block a user