X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=6502.c;h=2fc971d277bf681c95c1479eea8429dbb832a988;hp=f7078b8e5a9bb3f90bb43fcb8139b31ea8a0c4e4;hb=eace4e1b294ccec54a5c476619f616f5da0bf8a9;hpb=cfd001aea60f54e49d9beae0f941c513f45c202b diff --git a/6502.c b/6502.c index f7078b8..2fc971d 100644 --- 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 ')' EOL + tok += 3; // Past SYMBOL ')' EOL zpreq = 1; // Request zeropage optimization } else if (*tok == EOL)