]> Shamusworld >> Repos - rmac/blobdiff - procln.c
Added optimization flags to makefile (how long was THAT missing?)
[rmac] / procln.c
index 8127d7337cf070a6f4cb28ac8d66b6b8f61261db..ab9d53a0eefc98397348f71a3a55cfd7f7565608 100644 (file)
--- a/procln.c
+++ b/procln.c
@@ -29,6 +29,7 @@
 #define DECL_MR
 #include "risckw.h"
 
+
 IFENT * ifent;                                 // Current ifent
 static IFENT ifent0;                   // Root ifent
 static IFENT * f_ifent;                        // Freelist of ifents
@@ -103,7 +104,7 @@ void init_procln(void)
 //
 // Line Processor
 //
-void assemble(void)
+void Assemble(void)
 {
        int state;                                      // Keyword machine state (output)
        int j;                                          // Random int, must be fast
@@ -134,6 +135,7 @@ loop:                                                       // Line processing loop label
        // Get another line of tokens
        if (tokln() == TKEOF)
        {
+if (verb_flag) printf("Assemble: Found TKEOF flag...\n");
                if (list_flag && listflag)                      // Flush last line of source
                        listeol();
 
@@ -316,7 +318,7 @@ as68label:
                                if (label != NULL)
                                        warn(lab_ignored);
 
-                               exitmac();
+                               ExitMacro();
                        }
 
                        goto loop;
@@ -533,10 +535,15 @@ normal:
        if (label != NULL)
        {
 do_label:
+               // Check for dot in front of label; means this is a local label if present
+#if 0
                j = 0;
 
                if (*label == '.')
                        j = curenv;
+#else
+               j = (*label == '.' ? curenv : 0);
+#endif
 
                sy = lookup(label, LABEL, j);
 
@@ -570,7 +577,7 @@ do_label:
                lab_sym = sy;
 
                if (!j)
-                       ++curenv;
+                       curenv++;
 
                // Make label global
                if (labtyp == DCOLON)
@@ -621,7 +628,7 @@ do_label:
                // Call RISC code generator if we found a mnemonic
                if (state >= 3000)
                {
-                       risccg(state);
+                       GenerateRISCCode(state);
                        goto loop;
                }
        }