X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=procln.c;h=eb7428121e8b2b4d1cd44576afd0f8449c711d11;hp=addff0462d8247e6cdc02632f88939e75f531b3e;hb=66b362fa203d0850e8dce8045adb454e354c22ce;hpb=9153334781cd2e23750f4dc002e847606c07a1f0 diff --git a/procln.c b/procln.c index addff04..eb74281 100644 --- a/procln.c +++ b/procln.c @@ -15,6 +15,7 @@ #include "listing.h" #include "mach.h" #include "macro.h" +#include "op.h" #include "riscasm.h" #include "sect.h" #include "symbol.h" @@ -34,6 +35,10 @@ #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 @@ -659,6 +664,38 @@ When checking to see if it's already been equated, issue a warning. } } + // 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) {