]> git.gag.com Git - fw/sdcc/commitdiff
* src/z80/gen.c (isUnsplitable, fetchPairLog): fixed bug #770454
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 18 Aug 2003 20:07:35 +0000 (20:07 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 18 Aug 2003 20:07:35 +0000 (20:07 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@2837 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/z80/gen.c

index e534f0fd507d9bcee8a358c6b2771d40646f9886..949a959ae8cbd8c95e9d07e6d9cc0fb3efa6e3ad 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2003-08-18  Erik Petrich <epetrich@ivorytower.norman.ok.us>
+
+       * src/z80/gen.c (isUnsplitable, fetchPairLog): fixed bug #770454
+
 2003-08-18  Erik Petrich <epetrich@ivorytower.norman.ok.us>
 
        Made bitfield a distinct type from bit so that bitfields
index 6e79130709596c33e297c2bac6b05ec7954db445..9df933375c825dcb4c6b9d69b87fb7ef731c0971 100644 (file)
@@ -585,6 +585,22 @@ isPair (asmop * aop)
   return (getPairId (aop) != PAIR_INVALID);
 }
 
+/** Returns TRUE if the registers used in aop cannot be split into high
+    and low halves */
+bool
+isUnsplitable (asmop * aop)
+{
+  switch (getPairId (aop))
+    {
+    case PAIR_IX:
+    case PAIR_IY:
+      return TRUE;
+    default:
+      return FALSE;
+    }
+  return FALSE;
+}
+
 bool
 isPtrPair (asmop * aop)
 {
@@ -1347,6 +1363,11 @@ fetchPairLong (PAIR_ID pairId, asmop * aop, iCode *ic, int offset)
                   _pop (id);
               }
           }
+        else if (isUnsplitable(aop))
+          {
+            emit2("push %s", _pairs[getPairId(aop)].name);
+            emit2("pop %s", _pairs[pairId].name);
+          }
         else 
           {
             emit2 ("ld %s,%s", _pairs[pairId].l, aopGet (aop, offset, FALSE));