]> Shamusworld >> Repos - rmac/blobdiff - procln.c
Version bump for last patch; now at v1.13.4.
[rmac] / procln.c
index addff0462d8247e6cdc02632f88939e75f531b3e..eb7428121e8b2b4d1cd44576afd0f8449c711d11 100644 (file)
--- 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"
 #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)
        {