]> Shamusworld >> Repos - rmac/blobdiff - 6502.c
Roll back TOKENPTR changes and most of the .u32 changes weren't needed.
[rmac] / 6502.c
diff --git a/6502.c b/6502.c
index f7078b8e5a9bb3f90bb43fcb8139b31ea8a0c4e4..2fc971d277bf681c95c1479eea8429dbb832a988 100644 (file)
--- a/6502.c
+++ b/6502.c
@@ -247,7 +247,7 @@ void m6502cg(int op)
 {
        register int amode;             // (Parsed) addressing mode
        register int i;
-       uint32_t eval;                  // Expression value
+       uint64_t eval;                  // Expression value
        WORD eattr;                             // Expression attributes
        int zpreq;                              // 1, optimize instr to zero-page form
        register char * p;              // (Temp) string usage
@@ -258,7 +258,7 @@ void m6502cg(int op)
        //
        zpreq = 0;
 
-       switch ((int)*tok)
+       switch (tok[0])
        {
        case EOL:
                amode = A65_IMPL;
@@ -270,6 +270,7 @@ void m6502cg(int op)
                if (*tok == '>')
                {
                        tok++;
+
                        if (expr(exprbuf, &eval, &eattr, NULL) < 0)
                                return;
 
@@ -279,6 +280,7 @@ void m6502cg(int op)
                else if (*tok == '<')
                {
                        tok++;
+
                        if (expr(exprbuf, &eval, &eattr, NULL) < 0)
                                return;
 
@@ -307,7 +309,8 @@ void m6502cg(int op)
                                tok++;
                                p = string[tok[1]];
 
-                               if (*tok != SYMBOL || p[1] != EOS || (*p | 0x20) != 'y') // Sleazo tolower()
+                               // Sleazo tolower() -----------------vvvvvvvvvvv
+                               if (*tok != SYMBOL || p[1] != EOS || (*p | 0x20) != 'y')
                                        goto badmode;
 
                                tok += 2;
@@ -322,7 +325,8 @@ void m6502cg(int op)
                        tok++;
                        p = string[tok[1]];
 
-                       if (*tok != SYMBOL || p[1] != EOS || (*p | 0x20) != 'x') // Sleazo tolower()
+                       // Sleazo tolower() -----------------vvvvvvvvvvv
+                       if (*tok != SYMBOL || p[1] != EOS || (*p | 0x20) != 'x')
                                goto badmode;
 
                        tok += 2;
@@ -360,7 +364,7 @@ void m6502cg(int op)
                        else
                                goto badmode;
 
-                       tok += 3;               // Past SYMBOL <string> ')' EOL
+                       tok += 3;       // Past SYMBOL <string> ')' EOL
                        zpreq = 1;              // Request zeropage optimization
                }
                else if (*tok == EOL)