X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=token.c;h=e35e9bfc787697ea21e767f4a94397fb7ba223bb;hp=78de051d7e7df3ae3281023a99f7eb65f96fe415;hb=75969398d9b8a9f82ea76fc4e4cbfb97b11160a4;hpb=b10167d55798ea184f97fafda075255c0852f3b6 diff --git a/token.c b/token.c index 78de051..e35e9bf 100644 --- a/token.c +++ b/token.c @@ -452,7 +452,8 @@ arg_num: continue; } - if (tk != NULL) // arg # is in range, so expand it + // Argument # is in range, so expand it + if (tk != NULL) { while (*tk != EOL) { @@ -1054,6 +1055,12 @@ if (verb_flag) printf("TokenizeLine: Calling fpop() from SRC_IREPT...\n"); j = -1; } + // Make j = -1 if user tries to use a RISC register while in 68K mode + if (!(rgpu || rdsp) && ((TOKEN)j >= KW_R0 && (TOKEN)j <= KW_R31)) + { + j = -1; + } + //make j = -1 if time, date etc with no preceeding ^^ //defined, referenced, streq, macdef, date and time switch ((TOKEN)j) @@ -1065,9 +1072,10 @@ if (verb_flag) printf("TokenizeLine: Calling fpop() from SRC_IREPT...\n"); case 120: // time case 121: // date j = -1; - break; +// break; } + // If not tokenized keyword OR token was not found if (j < 0 || state < 0) { *tk++ = SYMBOL; @@ -1410,22 +1418,20 @@ if (verb_flag) printf("TokenizeLine: Calling fpop() from SRC_IREPT...\n"); while ((int)chrtab[*ln] & DIGIT) v = (v * 10) + *ln++ - '0'; - // See if there's a .[bwl] after the constant, & deal with it + // See if there's a .[bwl] after the constant & deal with it if so if (*ln == '.') { - if ((*(ln+1) == 'b') || (*(ln+1) == 'B')) + if ((*(ln + 1) == 'b') || (*(ln + 1) == 'B')) { v &= 0x000000FF; ln += 2; } - - if ((*(ln+1) == 'w') || (*(ln+1) == 'W')) + else if ((*(ln + 1) == 'w') || (*(ln + 1) == 'W')) { v &= 0x0000FFFF; ln += 2; } - - if ((*(ln+1) == 'l') || (*(ln+1) == 'L')) + else if ((*(ln + 1) == 'l') || (*(ln + 1) == 'L')) { ln += 2; } @@ -1433,6 +1439,7 @@ if (verb_flag) printf("TokenizeLine: Calling fpop() from SRC_IREPT...\n"); *tk++ = CONST; *tk++ = v; +//printf("CONST: %i\n", v); continue; }