From 0e3f46f69e24c400d942413eb7ec3623d96b472b Mon Sep 17 00:00:00 2001 From: michaelh Date: Sun, 9 Apr 2000 18:16:00 +0000 Subject: [PATCH] Fixed increase of a DWORD in registers git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@230 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/z80/gen.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/z80/gen.c b/src/z80/gen.c index b0e206a9..0313979b 100644 --- a/src/z80/gen.c +++ b/src/z80/gen.c @@ -1786,17 +1786,21 @@ static bool genPlusIncr (iCode *ic) /* if increment 16 bits in register */ if (sameRegs(AOP(IC_LEFT(ic)), AOP(IC_RESULT(ic))) && - (size > 1) && - (icount == 1)) { - symbol *tlbl = newiTempLabel(NULL); - emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),LSB,FALSE)); - emit2("!shortjp nz,!tlabel", tlbl->key+100); - - emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)),MSB16,FALSE)); - if(size == 4) { - wassert(0); + size > 1 && + icount == 1 + ) { + int offset = 0; + symbol *tlbl = NULL; + while (size--) { + if (offset) { + emitLabel(tlbl->key+100); + } + emitcode("inc","%s",aopGet(AOP(IC_RESULT(ic)), offset++, FALSE)); + if (size) { + tlbl = newiTempLabel(NULL); + emit2("!shortjp nz,!tlabel", tlbl->key+100); + } } - emitLabel(tlbl->key+100); return TRUE; } -- 2.30.2