* support i8086 far references in tx86addnode.emit_op_right_left

git-svn-id: trunk@24737 -
This commit is contained in:
nickysn 2013-06-01 17:51:58 +00:00
parent 1e8b192b3d
commit 525246f61b

View File

@ -247,8 +247,9 @@ unit nx86add;
procedure tx86addnode.emit_op_right_left(op:TAsmOp;opsize:TCgsize); procedure tx86addnode.emit_op_right_left(op:TAsmOp;opsize:TCgsize);
{$ifdef x86_64}
var var
tmpref: treference;
{$ifdef x86_64}
tmpreg : tregister; tmpreg : tregister;
{$endif x86_64} {$endif x86_64}
begin begin
@ -263,7 +264,16 @@ unit nx86add;
LOC_CREFERENCE : LOC_CREFERENCE :
begin begin
tcgx86(cg).make_simple_ref(current_asmdata.CurrAsmList,right.location.reference); tcgx86(cg).make_simple_ref(current_asmdata.CurrAsmList,right.location.reference);
current_asmdata.CurrAsmList.concat(taicpu.op_ref_reg(op,TCGSize2Opsize[opsize],right.location.reference,left.location.register)); tmpref:=right.location.reference;
{$ifdef i8086}
if (tmpref.segment<>NR_NO) and (not is_segment_reg(tmpref.segment)) then
begin
current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_PUSH,S_W,tmpref.segment));
current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_POP,S_W,NR_ES));
tmpref.segment:=NR_ES;
end;
{$endif i8086}
current_asmdata.CurrAsmList.concat(taicpu.op_ref_reg(op,TCGSize2Opsize[opsize],tmpref,left.location.register));
end; end;
LOC_CONSTANT : LOC_CONSTANT :
begin begin