Browse Source

* segment in int register support added also to tcg8086.a_load_reg_ref and .a_load_ref_reg

git-svn-id: trunk@24570 -
nickysn 12 years ago
parent
commit
8b1e621665
1 changed files with 14 additions and 0 deletions
  1. 14 0
      compiler/i8086/cgcpu.pas

+ 14 - 0
compiler/i8086/cgcpu.pas

@@ -789,6 +789,13 @@ unit cgcpu;
         make_simple_ref(list,tmpref);
         check_register_size(fromsize,reg);
 
+        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;
+
         case tosize of
           OS_8,OS_S8:
             if fromsize in [OS_8,OS_S8] then
@@ -838,6 +845,13 @@ unit cgcpu;
 {        if tcgsize2size[tosize]<=tcgsize2size[fromsize] then
           fromsize:=tosize;}
 
+        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;
+
         case tosize of
           OS_8,OS_S8:
             if fromsize in [OS_8,OS_S8] then