From: johanknol Date: Sat, 17 Feb 2001 19:18:27 +0000 (+0000) Subject: Fixed the lazy lazy DPTR for genCall and genPtrGet X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=d7a647920207a6560aacaeebecc470fc094661fa;p=fw%2Fsdcc Fixed the lazy lazy DPTR for genCall and genPtrGet git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@619 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/src/ds390/gen.c b/src/ds390/gen.c index 2e2989dc..ce33ecc5 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -2185,10 +2185,13 @@ genCall (iCode * ic) { char *l = aopGet (AOP (IC_LEFT (sic)), offset, FALSE, FALSE, TRUE); - if (strcmp (l, fReturn[offset])) - emitcode ("mov", "%s,%s", + if (strcmp (l, fReturn[offset])) { + genSetDPTR(0); + _flushLazyDPS(); + emitcode ("mov", "%s,%s ;jwk lazy genCall", fReturn[offset], l); + } offset++; } _endLazyDPSEvaluation (); @@ -7853,6 +7856,8 @@ genGenPointerGet (operand * left, sym_link *retype = getSpec (operandType (result)); sym_link *letype = getSpec (operandType (left)); + D (emitcode (";", "genGenPointerGet "); ); + aopOp (left, ic, FALSE, TRUE); /* if the operand is already in dptr @@ -7868,10 +7873,27 @@ genGenPointerGet (operand * left, else { /* we need to get it byte by byte */ _startLazyDPSEvaluation (); - emitcode ("mov", "dpl,%s", aopGet (AOP (left), 0, FALSE, FALSE, TRUE)); - emitcode ("mov", "dph,%s", aopGet (AOP (left), 1, FALSE, FALSE, TRUE)); - emitcode ("mov", "dpx,%s", aopGet (AOP (left), 2, FALSE, FALSE, TRUE)); - emitcode ("mov", "b,%s", aopGet (AOP (left), 3, FALSE, FALSE, TRUE)); + if (AOP(left)->type==AOP_DPTR2) { + char *l; + l=aopGet(AOP(left),0,FALSE,FALSE,TRUE); + genSetDPTR(0); + _flushLazyDPS(); + emitcode ("mov", "dpl,%s", l); + l=aopGet(AOP(left),1,FALSE,FALSE,TRUE); + genSetDPTR(0); + _flushLazyDPS(); + emitcode ("mov", "dph,%s", l); + l=aopGet(AOP(left),2,FALSE,FALSE,TRUE); + genSetDPTR(0); + _flushLazyDPS(); + emitcode ("mov", "dpx,%s", l); + emitcode ("mov", "b,%s", aopGet (AOP(left),3,FALSE,FALSE,TRUE)); + } else { + emitcode ("mov", "dpl,%s", aopGet (AOP(left),0,FALSE,FALSE,TRUE)); + emitcode ("mov", "dph,%s", aopGet (AOP(left),1,FALSE,FALSE,TRUE)); + emitcode ("mov", "dpx,%s", aopGet (AOP(left),2,FALSE,FALSE,TRUE)); + emitcode ("mov", "b,%s", aopGet (AOP(left),3,FALSE,FALSE,TRUE)); + } _endLazyDPSEvaluation (); } } @@ -9228,7 +9250,6 @@ gen390Code (iCode * lic) /* if debug information required */ if (options.debug && currFunc) { - //jwk if (currFunc) { cdbSymbol (currFunc, cdbFile, FALSE, TRUE); _G.debugLine = 1; if (IS_STATIC (currFunc->etype))