+ add a CS: override for references without an explicitly set segment override, which are relative to a function entry point

git-svn-id: trunk@32187 -
This commit is contained in:
nickysn 2015-10-29 14:48:59 +00:00
parent 1eaa77d2f9
commit 92a39c93f5

View File

@ -2007,6 +2007,14 @@ Unit Rax86int;
if (oper.typesize<>0) and
(oper.opr.typ in [OPR_REFERENCE,OPR_LOCAL]) then
oper.SetSize(oper.typesize,true);
{$ifdef i8086}
{ references to a procedure/function entry, without an explicit segment
override, are added an CS: override by default (this is Turbo Pascal 7
compatible) }
if (oper.opr.typ=OPR_REFERENCE) and assigned(oper.opr.ref.symbol) and
(oper.opr.ref.symbol.typ=AT_FUNCTION) and (oper.opr.ref.segment=NR_NO) then
oper.opr.ref.segment:=NR_CS;
{$endif i8086}
end;