From 5d1edd845131f05d57dbbb7873b9abb8aeb05dd2 Mon Sep 17 00:00:00 2001 From: kvigor Date: Fri, 26 Oct 2001 21:07:39 +0000 Subject: [PATCH] fix broken genOr git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1448 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/ds390/gen.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/ds390/gen.c b/src/ds390/gen.c index c9fff2d3..62474c46 100644 --- a/src/ds390/gen.c +++ b/src/ds390/gen.c @@ -5757,6 +5757,7 @@ genOr (iCode * ic, iCode * ifx) } else { + _startLazyDPSEvaluation(); for (; (size--); offset++) { // normal case @@ -5770,8 +5771,7 @@ genOr (iCode * ic, iCode * ifx) offset); continue; } - D (emitcode (";", "better literal OR."); - ); + D (emitcode (";", "better literal OR.");); MOVA (aopGet (AOP (left), offset, FALSE, FALSE, TRUE)); emitcode ("orl", "a, %s", aopGet (AOP (right), offset, FALSE, FALSE, FALSE)); @@ -5788,13 +5788,20 @@ genOr (iCode * ic, iCode * ifx) } else { - MOVA (aopGet (AOP (right), offset, FALSE, FALSE, TRUE)); - emitcode ("orl", "a,%s", - aopGet (AOP (left), offset, FALSE, FALSE, FALSE)); + char *rOp = aopGet (AOP (right), offset, FALSE, FALSE, TRUE); + if (!strcmp(rOp, "a") || !strcmp(rOp, "acc")) + { + emitcode("mov", "b,a"); + rOp = "b"; + } + + MOVA (aopGet (AOP (left), offset, FALSE, FALSE, TRUE)); + emitcode ("orl", "a,%s", rOp); } } aopPut (AOP (result), "a", offset); } + _endLazyDPSEvaluation(); } } -- 2.30.2