浏览代码

* tcgx86.make_simple_ref: in i8086 memory models with DS<>SS, add an SS: segment
override when converting SP-relative references to use a general purpose
register

git-svn-id: trunk@27473 -

nickysn 11 年之前
父节点
当前提交
ee20ecfcf2
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      compiler/x86/cgx86.pas

+ 3 - 0
compiler/x86/cgx86.pas

@@ -607,6 +607,9 @@ unit cgx86;
             href.base:=getaddressregister(list);
             { let the register allocator find a suitable register for the reference }
             list.Concat(Taicpu.op_reg_reg(A_MOV, S_W, NR_SP, href.base));
+            { if DS<>SS in the current memory model, we need to add an SS: segment override as well }
+            if (ref.segment=NR_NO) and not segment_regs_equal(NR_DS,NR_SS) then
+              href.segment:=NR_SS;
             ref:=href;
           end;