From 7e70a5f7630cb40deb9624dfcc8495130e1fc58f Mon Sep 17 00:00:00 2001 From: nickysn Date: Sat, 29 Jun 2013 12:21:15 +0000 Subject: [PATCH] * i8086 fix after r25010: i8086 doesn't support lea sp,[sp-XXX] git-svn-id: trunk@25012 - --- compiler/x86/cgx86.pas | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/compiler/x86/cgx86.pas b/compiler/x86/cgx86.pas index 40af0ca0a0..acbc25a76d 100644 --- a/compiler/x86/cgx86.pas +++ b/compiler/x86/cgx86.pas @@ -2320,6 +2320,11 @@ unit cgx86; procedure tcgx86.g_stackpointer_alloc(list : TAsmList;localsize : longint); 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 href : treference; begin @@ -2327,6 +2332,7 @@ unit cgx86; { 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)); end; +{$endif i8086} {$ifdef x86} {$ifndef NOTARGETWIN}