Browse Source

* support int register in treference.segment in tcg8086.a_load_const_ref; this fixes farptr^:=const

git-svn-id: trunk@24569 -
nickysn 12 years ago
parent
commit
9171c19601
1 changed files with 7 additions and 0 deletions
  1. 7 0
      compiler/i8086/cgcpu.pas

+ 7 - 0
compiler/i8086/cgcpu.pas

@@ -760,6 +760,13 @@ unit cgcpu;
         tmpref:=ref;
         tmpref:=ref;
         make_simple_ref(list,tmpref);
         make_simple_ref(list,tmpref);
 
 
+        if (tmpref.segment<>NR_NO) and (not is_segment_reg(tmpref.segment)) then
+          begin
+            list.concat(taicpu.op_reg(A_PUSH,S_W,tmpref.segment));
+            list.concat(taicpu.op_reg(A_POP,S_L,NR_ES));
+            tmpref.segment:=NR_ES;
+          end;
+
         if tosize in [OS_S32,OS_32] then
         if tosize in [OS_S32,OS_32] then
           begin
           begin
             a_load_const_ref(list,OS_16,longint(a and $ffff),tmpref);
             a_load_const_ref(list,OS_16,longint(a and $ffff),tmpref);