* as/z80/asm.h: made CASE_SENSITIVE 1
authorMaartenBrock <MaartenBrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 7 Aug 2006 16:06:16 +0000 (16:06 +0000)
committerMaartenBrock <MaartenBrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Mon, 7 Aug 2006 16:06:16 +0000 (16:06 +0000)
* link/z80/aslink.h: made CASE_SENSITIVE 1
* src/z80/gen.c (throughout): made all conditionals upper case
* support/regression/tests/bug1503067.c: new

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4324 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
as/z80/asm.h
link/z80/aslink.h
src/z80/gen.c
support/regression/tests/bug1503067.c [new file with mode: 0644]

index 20b99f43735adce85ef218d473d756c79657d910..37ca3511e5316785bab3dfec0ba20a99cd9ca9b7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-08-07 Maarten Brock <sourceforge.brock AT dse.nl>
+
+       * as/z80/asm.h: made CASE_SENSITIVE 1
+       * link/z80/aslink.h: made CASE_SENSITIVE 1
+       * src/z80/gen.c (throughout): made all conditionals upper case
+       * support/regression/tests/bug1503067.c: new
+
 2006-08-07 Maarten Brock <sourceforge.brock AT dse.nl>
 
        * src/z80/gen.c (aopPut): fixed bug !*ixy should be !*iyx,
index 30bad90655965e1c39d77f3974956549ab4808b1..91de7ae161974efc9a46900fc840e114b88e0d2d 100644 (file)
@@ -18,7 +18,7 @@
 /*
  * Case Sensitivity Flag
  */
-#define        CASE_SENSITIVE  0
+#define        CASE_SENSITIVE  1
 
 /*)Module      asm.h
  *
index fabdb1c3631894744ed20b44cc336346a2c4ba01..e18cd023a825c13966934974d352dd1008afed3e 100644 (file)
 /*
  * Extensions: P. Felber
  */
-#include <limits.h>
-
-#ifndef PATH_MAX
- #if defined(__BORLANDC__) || defined(_MSC_VER)
-  #include <stdlib.h>
-  #define PATH_MAX     _MAX_PATH
- #else
-  #define PATH_MAX     255     /* define a reasonable value */
- #endif
-#endif
-
 #define        VERSION "V01.75"
 
 /*
  * Case Sensitivity Flag
  */
-#define        CASE_SENSITIVE  0
+#define        CASE_SENSITIVE  1
 
 /*)Module      asmlnk.h
  *
 #define        OTHERSYSTEM
 #endif
 
+/*
+ * PATH_MAX
+ */
+#include <limits.h>
+#ifndef PATH_MAX                /* POSIX, but not required   */
+ #if defined(__BORLANDC__) || defined(_MSC_VER)
+  #include <stdlib.h>
+  #define PATH_MAX     _MAX_PATH
+ #else
+  #define PATH_MAX     255     /* define a reasonable value */
+ #endif
+#endif
+
 /*
  * This file defines the format of the
  * relocatable binary file.
 /*
  * Area types
  */
-#define        A_CON   000             /* concatenate */
-#define        A_OVR   00            /* overlay */
-#define        A_REL   000             /* relocatable */
-#define        A_ABS   010             /* absolute */
-#define        A_NOPAG 000             /* non-paged */
-#define        A_PAG   020             /* paged */
+#define        A_CON   0000            /* concatenate */
+#define        A_OVR   0004            /* overlay */
+#define        A_REL   0000            /* relocatable */
+#define        A_ABS   0010            /* absolute */
+#define        A_NOPAG 0000            /* non-paged */
+#define        A_PAG   0020            /* paged */
 
 /*
  * File types
index e218d9b0a280808669268326217e1266863bf0a4..527f3c1e91b359e4ff06ad1613b651646895ff5a 100644 (file)
@@ -3329,7 +3329,7 @@ genEndFunction (iCode * ic)
               emit2 ("pop af");
               //parity odd <==> P/O=0 <==> interrupt enable flag IFF2 was 0 <==>
               //don't enable interrupts as they were off before
-              emit2 ("jp po,!tlabel", tlbl->key + 100);
+              emit2 ("jp PO,!tlabel", tlbl->key + 100);
               emit2 ("!ei");
               emit2 ("!tlabeldef", (tlbl->key + 100));
             }
@@ -3547,7 +3547,7 @@ genPlusIncr (iCode * ic)
           emit2 ("inc %s", aopGet (AOP (IC_RESULT (ic)), offset++, FALSE));
           if (size)
             {
-              emit2 ("!shortjp nz,!tlabel", tlbl->key + 100);
+              emit2 ("!shortjp NZ,!tlabel", tlbl->key + 100);
             }
         }
       emitLabel (tlbl->key + 100);
@@ -3600,7 +3600,7 @@ outBitAcc (operand * result)
     }
   else
     {
-      emit2 ("!shortjp z,!tlabel", tlbl->key + 100);
+      emit2 ("!shortjp Z,!tlabel", tlbl->key + 100);
       emit2 ("ld a,!one");
       emitLabel (tlbl->key + 100);
       outAcc (result);
@@ -4267,28 +4267,28 @@ genIfxJump (iCode * ic, char *jval)
       jlbl = IC_TRUE (ic);
       if (!strcmp (jval, "a"))
         {
-          inst = "nz";
+          inst = "NZ";
         }
       else if (!strcmp (jval, "c"))
         {
-          inst = "c";
+          inst = "C";
         }
       else if (!strcmp (jval, "nc"))
         {
-          inst = "nc";
+          inst = "NC";
         }
       else if (!strcmp (jval, "m"))
         {
-          inst = "m";
+          inst = "M";
         }
       else if (!strcmp (jval, "p"))
         {
-          inst = "p";
+          inst = "P";
         }
       else
         {
           /* The buffer contains the bit on A that we should test */
-          inst = "nz";
+          inst = "NZ";
         }
     }
   else
@@ -4297,28 +4297,28 @@ genIfxJump (iCode * ic, char *jval)
       jlbl = IC_FALSE (ic);
       if (!strcmp (jval, "a"))
         {
-          inst = "z";
+          inst = "Z";
         }
       else if (!strcmp (jval, "c"))
         {
-          inst = "nc";
+          inst = "NC";
         }
       else if (!strcmp (jval, "nc"))
         {
-          inst = "c";
+          inst = "C";
         }
       else if (!strcmp (jval, "m"))
         {
-          inst = "p";
+          inst = "P";
         }
       else if (!strcmp (jval, "p"))
         {
-          inst = "m";
+          inst = "M";
         }
       else
         {
           /* The buffer contains the bit on A that we should test */
-          inst = "z";
+          inst = "Z";
         }
     }
   /* Z80 can do a conditional long jump */
@@ -4773,7 +4773,7 @@ gencjneshort (operand * left, operand * right, symbol * lbl)
             {
               emit2 ("or a,a");
             }
-          emit2 ("jp nz,!tlabel", lbl->key + 100);
+          emit2 ("jp NZ,!tlabel", lbl->key + 100);
         }
       else
         {
@@ -4784,7 +4784,7 @@ gencjneshort (operand * left, operand * right, symbol * lbl)
                 emit2 ("or a,a");
               else
                 emit2 ("cp a,%s", aopGet (AOP (right), offset, FALSE));
-              emit2 ("jp nz,!tlabel", lbl->key + 100);
+              emit2 ("jp NZ,!tlabel", lbl->key + 100);
               offset++;
             }
         }
@@ -4801,11 +4801,11 @@ gencjneshort (operand * left, operand * right, symbol * lbl)
           if ((AOP_TYPE (left) == AOP_DIR && AOP_TYPE (right) == AOP_LIT) &&
               ((unsigned int) ((lit >> (offset * 8)) & 0x0FFL) == 0))
             /* PENDING */
-            emit2 ("jp nz,!tlabel", lbl->key + 100);
+            emit2 ("jp NZ,!tlabel", lbl->key + 100);
           else
             {
               emit2 ("cp %s", aopGet (AOP (right), offset, FALSE));
-              emit2 ("jp nz,!tlabel", lbl->key + 100);
+              emit2 ("jp NZ,!tlabel", lbl->key + 100);
             }
           offset++;
         }
@@ -4818,7 +4818,7 @@ gencjneshort (operand * left, operand * right, symbol * lbl)
         {
           _moveA (aopGet (AOP (right), offset, FALSE));
           emit2 ("cp %s", aopGet (AOP (left), offset, FALSE));
-          emit2 ("!shortjp nz,!tlabel", lbl->key + 100);
+          emit2 ("!shortjp NZ,!tlabel", lbl->key + 100);
           offset++;
         }
     }
@@ -4984,7 +4984,7 @@ genAndOp (iCode * ic)
     {
       tlbl = newiTempLabel (NULL);
       _toBoolean (left);
-      emit2 ("!shortjp z,!tlabel", tlbl->key + 100);
+      emit2 ("!shortjp Z,!tlabel", tlbl->key + 100);
       _toBoolean (right);
       emitLabel (tlbl->key + 100);
       outBitAcc (result);
@@ -5021,7 +5021,7 @@ genOrOp (iCode * ic)
     {
       tlbl = newiTempLabel (NULL);
       _toBoolean (left);
-      emit2 ("!shortjp nz,!tlabel", tlbl->key + 100);
+      emit2 ("!shortjp NZ,!tlabel", tlbl->key + 100);
       _toBoolean (right);
       emitLabel (tlbl->key + 100);
       outBitAcc (result);
@@ -5155,7 +5155,7 @@ genAnd (iCode * ic, iCode * ifx)
                   /* For the flags */
                   emit2 ("or a,a");
                 }
-              emit2 ("!shortjp nz,!tlabel", tlbl->key + 100);
+              emit2 ("!shortjp NZ,!tlabel", tlbl->key + 100);
             }
               offset++;
         }
@@ -5339,7 +5339,7 @@ genOr (iCode * ic, iCode * ifx)
           _moveA (aopGet (AOP (left), offset, FALSE));
           /* OR with any literal is the same as OR with itself. */
           emit2 ("or a,a");
-          emit2 ("!shortjp nz,!tlabel", tlbl->key + 100);
+          emit2 ("!shortjp NZ,!tlabel", tlbl->key + 100);
 
           offset++;
         }
@@ -5494,7 +5494,7 @@ genXor (iCode * ic, iCode * ifx)
         {
           _moveA (aopGet (AOP (left), offset, FALSE));
           emit2 ("xor a,%s", aopGet (AOP (right), offset, FALSE));
-          emit2 ("!shortjp nz,!tlabel", tlbl->key + 100);
+          emit2 ("!shortjp NZ,!tlabel", tlbl->key + 100);
           offset++;
         }
       if (ifx)
@@ -5738,7 +5738,7 @@ shiftR2Left2Result (operand * left, int offl,
 
       emitLabel (tlbl1->key + 100);
       emit2 ("dec a");
-      emit2 ("!shortjp nz,!tlabel", tlbl->key + 100);
+      emit2 ("!shortjp NZ,!tlabel", tlbl->key + 100);
     }
 }
 
@@ -5829,7 +5829,7 @@ shiftL2Left2Result (operand * left, int offl,
           {
             emitLabel (tlbl1->key + 100);
             emit2 ("dec a");
-            emit2 ("!shortjp nz,!tlabel", tlbl->key + 100);
+            emit2 ("!shortjp NZ,!tlabel", tlbl->key + 100);
           }
       }
   }
@@ -6153,7 +6153,7 @@ genLeftShift (iCode * ic)
     }
   emitLabel (tlbl1->key + 100);
   emit2 ("dec a");
-  emit2 ("!shortjp nz,!tlabel", tlbl->key + 100);
+  emit2 ("!shortjp NZ,!tlabel", tlbl->key + 100);
 
   freeAsmop (left, NULL, ic);
   freeAsmop (result, NULL, ic);
@@ -6425,7 +6425,7 @@ genRightShift (iCode * ic)
     }
   emitLabel (tlbl1->key + 100);
   emit2 ("dec a");
-  emit2 ("!shortjp nz,!tlabel", tlbl->key + 100);
+  emit2 ("!shortjp NZ,!tlabel", tlbl->key + 100);
 
   freeAsmop (left, NULL, ic);
   freeAsmop (result, NULL, ic);
@@ -6464,7 +6464,7 @@ genUnpackBits (operand * result, int pair)
           symbol *tlbl = newiTempLabel (NULL);
 
           emit2 ("bit %d,a", blen - 1);
-          emit2 ("jp z,!tlabel", tlbl->key + 100);
+          emit2 ("jp Z,!tlabel", tlbl->key + 100);
           emit2 ("or a,!immedbyte", (unsigned char) (0xff << blen));
           emitLabel (tlbl->key + 100);
         }
@@ -6488,7 +6488,7 @@ genUnpackBits (operand * result, int pair)
           symbol *tlbl = newiTempLabel (NULL);
 
           emit2 ("bit %d,a", blen - 1);
-          emit2 ("jp z,!tlabel", tlbl->key + 100);
+          emit2 ("jp Z,!tlabel", tlbl->key + 100);
           emit2 ("or a,!immedbyte", (unsigned char) (0xff << blen));
           emitLabel (tlbl->key + 100);
         }
@@ -6521,7 +6521,7 @@ genUnpackBits (operand * result, int pair)
           symbol *tlbl = newiTempLabel (NULL);
 
           emit2 ("bit %d,a", rlen - 1);
-          emit2 ("jp z,!tlabel", tlbl->key + 100);
+          emit2 ("jp Z,!tlabel", tlbl->key + 100);
           emit2 ("or a,!immedbyte", (unsigned char) (0xff << rlen));
           emitLabel (tlbl->key + 100);
         }
@@ -7461,7 +7461,7 @@ genCritical (iCode *ic)
       //disable interrupt
       emit2 ("!di");
       //parity odd <==> P/O=0 <==> interrupt enable flag IFF2=0
-      emit2 ("jp po,!tlabel", tlbl->key + 100);
+      emit2 ("jp PO,!tlabel", tlbl->key + 100);
       aopPut (AOP (IC_RESULT (ic)), "!one", 0);
       emit2 ("!tlabeldef", (tlbl->key + 100));
       freeAsmop (IC_RESULT (ic), NULL, ic);
@@ -7494,7 +7494,7 @@ genEndCritical (iCode *ic)
       aopOp (IC_RIGHT (ic), ic, FALSE, TRUE);
       _toBoolean (IC_RIGHT (ic));
       //don't enable interrupts if they were off before
-      emit2 ("!shortjp z,!tlabel", tlbl->key + 100);
+      emit2 ("!shortjp Z,!tlabel", tlbl->key + 100);
       emit2 ("!ei");
       emitLabel (tlbl->key + 100);
       freeAsmop (IC_RIGHT (ic), NULL, ic);
@@ -7505,7 +7505,7 @@ genEndCritical (iCode *ic)
       emit2 ("pop af");
       //parity odd <==> P/O=0 <==> interrupt enable flag IFF2 was 0 <==>
       //don't enable interrupts as they were off before
-      emit2 ("jp po,!tlabel", tlbl->key + 100);
+      emit2 ("jp PO,!tlabel", tlbl->key + 100);
       emit2 ("!ei");
       emit2 ("!tlabeldef", (tlbl->key + 100));
     }
@@ -7963,7 +7963,7 @@ genBuiltInStrcpy (iCode *ic, int nParams, operand **pparams)
   emit2 ("ld a,(hl)");
   emit2 ("ldi");
   emit2 ("or a");
-  emit2 ("!shortjp nz,!tlabel ; 1", label->key);
+  emit2 ("!shortjp NZ,!tlabel ; 1", label->key);
 
   freeAsmop (from, NULL, ic->next);
   freeAsmop (to, NULL, ic);
diff --git a/support/regression/tests/bug1503067.c b/support/regression/tests/bug1503067.c
new file mode 100644 (file)
index 0000000..fc9cb1d
--- /dev/null
@@ -0,0 +1,6 @@
+/* bug1503067.c\r
+ */\r
+#include <testfwk.h>\r
+\r
+const int SPRITE = 0;\r
+int sprite = 1;\r