X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=6502.c;h=5978240a5bfe53be35059fb0b6820c78e6653532;hp=24000c20f50b01bba97e3e0434e4276f8276b17f;hb=9153334781cd2e23750f4dc002e847606c07a1f0;hpb=03dd34951a331e0b8971195ccef1600fffaea2e6 diff --git a/6502.c b/6502.c index 24000c2..5978240 100644 --- a/6502.c +++ b/6502.c @@ -1,7 +1,7 @@ // // RMAC - Reboot's Macro Assembler for all Atari computers // 6502.C - 6502 Assembler -// Copyright (C) 199x Landon Dyer, 2011-2017 Reboot and Friends +// Copyright (C) 199x Landon Dyer, 2011-2018 Reboot and Friends // RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986 // Source utilised with the kind permission of Landon Dyer // @@ -247,7 +247,7 @@ void m6502cg(int op) { register int amode; // (Parsed) addressing mode register int i; - VALUE 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;