From 1e8b192b3d24f93182b016ea50154f448f70ae9d Mon Sep 17 00:00:00 2001 From: nickysn Date: Sat, 1 Jun 2013 17:51:18 +0000 Subject: [PATCH] * support far references in second_cmp32bit for i8086 git-svn-id: trunk@24736 - --- compiler/i8086/n8086add.pas | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/compiler/i8086/n8086add.pas b/compiler/i8086/n8086add.pas index c28c6fdf3d..6701a17dd5 100644 --- a/compiler/i8086/n8086add.pas +++ b/compiler/i8086/n8086add.pas @@ -556,10 +556,17 @@ interface begin tcgx86(cg).make_simple_ref(current_asmdata.CurrAsmList,right.location.reference); href:=right.location.reference; + if (href.segment<>NR_NO) and (not is_segment_reg(href.segment)) then + begin + current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_PUSH,S_W,href.segment)); + current_asmdata.CurrAsmList.concat(taicpu.op_reg(A_POP,S_W,NR_ES)); + href.segment:=NR_ES; + end; inc(href.offset,2); emit_ref_reg(A_CMP,S_W,href,GetNextReg(left.location.register)); firstjmp32bitcmp; - emit_ref_reg(A_CMP,S_W,right.location.reference,left.location.register); + dec(href.offset,2); + emit_ref_reg(A_CMP,S_W,href,left.location.register); secondjmp32bitcmp; cg.a_jmp_always(current_asmdata.CurrAsmList,current_procinfo.CurrFalseLabel); location_freetemp(current_asmdata.CurrAsmList,right.location);