ソースを参照

+ int register in treference.segment support in tcg8086.op_*ref*

git-svn-id: trunk@24586 -
nickysn 12 年 前
コミット
3aeea835f9
1 ファイル変更21 行追加0 行削除
  1. 21 0
      compiler/i8086/cgcpu.pas

+ 21 - 0
compiler/i8086/cgcpu.pas

@@ -274,6 +274,13 @@ unit cgcpu;
         tmpref:=ref;
         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 size in [OS_64, OS_S64] then
           internalerror(2013050801);
         if size in [OS_32, OS_S32] then
@@ -419,6 +426,13 @@ unit cgcpu;
         make_simple_ref(list,tmpref);
         check_register_size(size,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;
+
         if size in [OS_64, OS_S64] then
           internalerror(2013030902);
 
@@ -450,6 +464,13 @@ unit cgcpu;
         make_simple_ref(list,tmpref);
         check_register_size(size,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;
+
         if size in [OS_64, OS_S64] then
           internalerror(2013050803);