as: bracket or square...
authorAlan Cox <alan@linux.intel.com>
Thu, 2 Nov 2017 18:18:09 +0000 (18:18 +0000)
committerAlan Cox <alan@linux.intel.com>
Thu, 2 Nov 2017 18:18:09 +0000 (18:18 +0000)
Z80 and 6502 use () to indicate a layer of indirection, so the assembler uses
[] for expressions

6809 uses [] for indirect, so we need to use () for expressions

Applications/MWC/cmd/asz80/as3.c

index f86da3c..b448ac7 100644 (file)
@@ -158,12 +158,21 @@ void expr2(ADDR *ap)
        char id[NCPS];
 
        c = getnb();
+#ifndef TARGET_USES_SQUARE
        if (c == '[') {
                expr1(ap, LOPRI, 0);
                if (getnb() != ']')
                        qerr(SQUARE_EXPECTED);
                return;
        }
+#else
+       if (c == '(') {
+               expr1(ap, LOPRI, 0);
+               if (getnb() != ')')
+                       qerr(BRACKET_EXPECTED);
+               return;
+       }
+#endif
        if (c == '-') {
                expr1(ap, HIPRI, 0);
                istuser(ap);