#include "listing.h"
#include "mach.h"
#include "macro.h"
+#include "op.h"
#include "riscasm.h"
#include "sect.h"
#include "symbol.h"
#define DECL_MP // Include 6502 keyword state machine tables
#include "6502kw.h"
+#define DEF_MO // Include OP keyword definitions
+#define DECL_MO // Include OP keyword state machine tables
+#include "opkw.h"
+
IFENT * ifent; // Current ifent
static IFENT ifent0; // Root ifent
IFENT * f_ifent; // Freelist of ifents
}
}
+ // 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;
+ }
+ }
+
// Invoke macro or complain about bad mnemonic
if (state < 0)
{