From 22acb2e44b42b647b8453f1bdec3f1894f192fa5 Mon Sep 17 00:00:00 2001 From: nickysn Date: Tue, 25 Mar 2014 22:00:23 +0000 Subject: [PATCH] * moved the i8086 specific code from tpointerconstnode.create to the i8086 descendant class git-svn-id: trunk@27285 - --- compiler/i8086/n8086con.pas | 15 +++++++++++++-- compiler/ncon.pas | 5 ----- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/compiler/i8086/n8086con.pas b/compiler/i8086/n8086con.pas index ecbe9e0244..c8671d426b 100644 --- a/compiler/i8086/n8086con.pas +++ b/compiler/i8086/n8086con.pas @@ -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? } diff --git a/compiler/ncon.pas b/compiler/ncon.pas index ddcb98e181..7f85ef8d3c 100644 --- a/compiler/ncon.pas +++ b/compiler/ncon.pas @@ -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;