* moved the i8086 specific code from tpointerconstnode.create to the i8086

descendant class

git-svn-id: trunk@27285 -
This commit is contained in:
nickysn 2014-03-25 22:00:23 +00:00
parent cdac1d23cd
commit 22acb2e44b
2 changed files with 13 additions and 7 deletions

View File

@ -26,20 +26,21 @@ unit n8086con;
interface
uses
node,ncon,ncgcon,nx86con;
globtype,symtype,ncon,ncgcon,nx86con;
type
{ tcgpointerconstnode }
ti8086pointerconstnode = class(tcgpointerconstnode)
constructor create(v : TConstPtrUInt;def:tdef);override;
procedure pass_generate_code;override;
end;
implementation
uses
systems,globals,globtype,
systems,globals,
symconst,symdef,
defutil,
cpubase,
@ -49,6 +50,16 @@ implementation
T8086POINTERCONSTNODE
*****************************************************************************}
constructor ti8086pointerconstnode.create(v: TConstPtrUInt; def: tdef);
begin
{ truncate near pointers }
if (def.typ<>pointerdef) or not (tpointerdef(def).x86pointertyp in [x86pt_far,x86pt_huge]) then
v := Word(v);
inherited create(v, def);
end;
procedure ti8086pointerconstnode.pass_generate_code;
begin
{ far pointer? }

View File

@ -738,11 +738,6 @@ implementation
begin
inherited create(pointerconstn);
{$ifdef i8086}
{ truncate near pointers }
if (def.typ<>pointerdef) or not (tpointerdef(def).x86pointertyp in [x86pt_far,x86pt_huge]) then
v := Word(v);
{$endif i8086}
value:=v;
typedef:=def;
end;