// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source utilised with the kind permission of Landon Dyer
//
// RMAC derived from MADMAC v1.07 Written by Landon Dyer, 1986
// Source utilised with the kind permission of Landon Dyer
//
IFENT * ifent; // Current ifent
static IFENT ifent0; // Root ifent
IFENT * f_ifent; // Freelist of ifents
int disabled; // Assembly conditionally disabled
int just_bss; // 1, ds.b in microprocessor mode
IFENT * ifent; // Current ifent
static IFENT ifent0; // Root ifent
IFENT * f_ifent; // Freelist of ifents
int disabled; // Assembly conditionally disabled
int just_bss; // 1, ds.b in microprocessor mode
SYM * lab_sym; // Label on line (or NULL)
const char extra_stuff[] = "extra (unexpected) text found after addressing mode";
SYM * lab_sym; // Label on line (or NULL)
const char extra_stuff[] = "extra (unexpected) text found after addressing mode";
char * equate; // Symbol (or NULL)
int labtyp = 0; // Label type (':', DCOLON)
int equtyp = 0; // Equ type ('=', DEQUALS)
char * equate; // Symbol (or NULL)
int labtyp = 0; // Label type (':', DCOLON)
int equtyp = 0; // Equ type ('=', DEQUALS)
WORD eattr; // Expression attributes
SYM * esym; // External symbol involved in expr.
WORD siz = 0; // Size suffix to mnem/diretve/macro
WORD eattr; // Expression attributes
SYM * esym; // External symbol involved in expr.
WORD siz = 0; // Size suffix to mnem/diretve/macro
lab_sym = NULL; // No (exported) label
equate = NULL; // No equate
tk = tok; // Save first token in line
lab_sym = NULL; // No (exported) label
equate = NULL; // No equate
tk = tok; // Save first token in line
- switch (*tok)
- {
- case DOTW: siz = SIZW, tok++; break;
- case DOTL: siz = SIZL, tok++; break;
- case DOTB: siz = SIZB, tok++; break;
- case DOTD: siz = SIZD, tok++; break;
- case DOTP: siz = SIZP, tok++; break;
- case DOTQ: siz = SIZQ, tok++; break;
- case DOTS: siz = SIZS, tok++; break;
- case DOTX: siz = SIZX, tok++; break;
- }
-
+ switch (*tok)
+ {
+ case DOTW: siz = SIZW, tok++; break;
+ case DOTL: siz = SIZL, tok++; break;
+ case DOTB: siz = SIZB, tok++; break;
+ case DOTD: siz = SIZD, tok++; break;
+ case DOTP: siz = SIZP, tok++; break;
+ case DOTQ: siz = SIZQ, tok++; break;
+ case DOTS: siz = SIZS, tok++; break;
+ case DOTX: siz = SIZX, tok++; break;
+ }
// Do special directives (500..999) (These must be handled in "real time")
if (state >= 500 && state < 1000)
// Do special directives (500..999) (These must be handled in "real time")
if (state >= 500 && state < 1000)
else if (expr(exprbuf, &eval, &eattr, &esym) != OK)
goto loop;
}
else if (expr(exprbuf, &eval, &eattr, &esym) != OK)
goto loop;
}
+ // If we are in OP mode and still in need of a mnemonic then search for one
+ if (robjproc && ((state < 0) || (state >= 1000)))
+ {
+ for(state=0, p=opname; state>=0;)
+ {
+ j = mobase[state] + (int)tolowertab[*p];
+
+ // Reject, character doesn't match
+ if (mocheck[j] != state)
+ {
+ state = -1; // No match
+ break;
+ }
+
+ // Must accept or reject at EOS
+ if (!*++p)
+ {
+ state = moaccept[j]; // (-1 on no terminal match)
+ break;
+ }
+
+ state = motab[j];
+ }
+
+ // Call OP code generator if we found a mnemonic
+ if (state >= 3100)
+ {
+ GenerateOPCode(state);
+ goto loop;
+ }
+ }
+