From 4a4b1bd351f10ea36ac128fedafc48aa255dbc21 Mon Sep 17 00:00:00 2001 From: johanknol Date: Thu, 8 Mar 2001 13:51:53 +0000 Subject: [PATCH] Let's adjust instead of a boldy decrement git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@675 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/ds390/gen.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/ds390/gen.c b/src/ds390/gen.c index c1a45672..59a96703 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -1268,23 +1268,22 @@ aopPut (asmop * aop, char *s, int offset) } -/*-----------------------------------------------------------------*/ -/* reAdjustPreg - points a register back to where it should */ -/*-----------------------------------------------------------------*/ +/*--------------------------------------------------------------------*/ +/* reAdjustPreg - points a register back to where it should (coff==0) */ +/*--------------------------------------------------------------------*/ static void reAdjustPreg (asmop * aop) { - int size; - - aop->coff = 0; - if ((size = aop->size) <= 1) + emitcode (";jwk","reAdjustPreg: %d", aop->coff); + if ((aop->coff==0) || (aop->size <= 1)) { return; - size--; + } + switch (aop->type) { case AOP_R0: case AOP_R1: - while (size--) + while (aop->coff--) emitcode ("dec", "%s", aop->aopu.aop_ptr->name); break; case AOP_DPTR: @@ -1294,7 +1293,7 @@ reAdjustPreg (asmop * aop) genSetDPTR (1); _flushLazyDPS (); } - while (size--) + while (aop->coff--) { emitcode ("lcall", "__decdptr"); } @@ -1306,7 +1305,7 @@ reAdjustPreg (asmop * aop) break; } - + aop->coff=0; } #define AOP(op) op->aop -- 2.47.2