Browse Source

* i8086 fix after r25010: i8086 doesn't support lea sp,[sp-XXX]

git-svn-id: trunk@25012 -
nickysn 12 năm trước cách đây
mục cha
commit
7e70a5f763
1 tập tin đã thay đổi với 6 bổ sung0 xóa
  1. 6 0
      compiler/x86/cgx86.pas

+ 6 - 0
compiler/x86/cgx86.pas

@@ -2320,6 +2320,11 @@ unit cgx86;
     procedure tcgx86.g_stackpointer_alloc(list : TAsmList;localsize : longint);
     procedure tcgx86.g_stackpointer_alloc(list : TAsmList;localsize : longint);
 
 
       procedure decrease_sp(a : tcgint);
       procedure decrease_sp(a : tcgint);
+{$ifdef i8086}
+        begin
+          list.concat(Taicpu.Op_const_reg(A_SUB,S_W,a,NR_STACK_POINTER_REG));
+        end;
+{$else i8086}
         var
         var
           href : treference;
           href : treference;
         begin
         begin
@@ -2327,6 +2332,7 @@ unit cgx86;
           { normally, lea is a better choice than a sub to adjust the stack pointer }
           { normally, lea is a better choice than a sub to adjust the stack pointer }
           list.concat(Taicpu.op_ref_reg(A_LEA,TCGSize2OpSize[OS_ADDR],href,NR_STACK_POINTER_REG));
           list.concat(Taicpu.op_ref_reg(A_LEA,TCGSize2OpSize[OS_ADDR],href,NR_STACK_POINTER_REG));
         end;
         end;
+{$endif i8086}
 
 
 {$ifdef x86}
 {$ifdef x86}
 {$ifndef NOTARGETWIN}
 {$ifndef NOTARGETWIN}