]> Shamusworld >> Repos - rmac/blobdiff - procln.c
Get rid of some old and deprecated macros
[rmac] / procln.c
index 3b674c50a8a50f5e09c70ca59585d949bc04da99..ef7bf1cc7be760b2bc52468670a2cd4056a3098b 100644 (file)
--- a/procln.c
+++ b/procln.c
@@ -154,8 +154,7 @@ void Assemble(void)
        char * opname = NULL;           // Name of dirctve/mnemonic/macro
        int listflag;                           // 0: Don't call listeol()
        WORD rmask;                                     // Register list, for REG
-       int registerbank;                       // RISC register bank
-       int riscreg;                            // RISC register
+       int equreg;                             // RISC register
        listflag = 0;                           // Initialise listing flag
 
 loop:                                                  // Line processing loop label
@@ -435,72 +434,48 @@ corresponding register bool to true. Whenever it's undef'ed, set it to false.
 When checking to see if it's already been equated, issue a warning.
 */
 
-                       if (rgpu || rdsp)
+                       // Check for register to equate to
+                       // This check will change once we split the registers per architecture into their own tables
+                       // and out of kw.tab. But for now it'll do...
+                       if ((*tok >= KW_D0) && (*tok <= KW_BA))
                        {
-                               // GPU/DSP architectures need some special TLC for now
-                               // Check for register to equate to
-                               if ((*tok >= KW_R0) && (*tok <= KW_R31))
+                               sy->sattre = EQUATEDREG;        // Mark as equated register
+                               equreg = *tok;
+                               // Check for ",<bank #>" override notation and skip past it.
+                               // It is ignored now. Was that ever useful anyway?
+                               if ((rgpu ||rdsp) && (tok[1] == ',') && (tok[2] == CONST))
                                {
-                                       //                              sy->sattre  = EQUATEDREG | RISCSYM;     // Mark as equated register
-                                       sy->sattre = EQUATEDREG;        // Mark as equated register
-                                       riscreg = *tok;
-
-                                       // Default is current state of "regbank"
-                                       registerbank = regbank;
-
-                                       // Check for ",<bank #>" override notation
-                                       if ((tok[1] == ',') && (tok[2] == CONST))
-                                       {
-                                               // Advance token pointer to the constant
-                                               tok += 3;
-
-                                               // Anything other than a 0 or a 1 will result in "No Bank"
-                                               if (*(uint64_t*)tok == 0)
-                                                       registerbank = BANK_0;
-                                               else if (*(uint64_t*)tok == 1)
-                                                       registerbank = BANK_1;
-
-                                               // Advance half-way through the 64-bit const.
-                                               // The code below, expecting a regular token,
-                                               // will advance past the second half.
-                                               tok++;
-                                       }
-
-                                       sy->sattre |= registerbank;     // Store register bank
-                                       eattr = ABS | DEFINED | GLOBAL;
-                                       eval = riscreg;
-                                       tok++;
+                                       // Advance token pointer and skip everything
+                                       tok += 4;
                                }
-                               // Checking for a register symbol
-                               else if (tok[0] == SYMBOL)
-                               {
-                                       sy2 = lookup(string[tok[1]], LABEL, j);
 
-                                       // Make sure symbol is a valid equreg
-                                       if (!sy2 || !(sy2->sattre & EQUATEDREG))
-                                       {
-                                               error("invalid GPU/DSP .equr/.regequ definition");
-                                               goto loop;
-                                       }
-                                       else
-                                       {
-                                               eattr = ABS | DEFINED | GLOBAL; // Copy symbol's attributes
-                                               sy->sattre = sy2->sattre;
-                                               eval = (sy2->svalue & 0xFFFFF0FF);
-                                               tok += 2;
-                                       }
+                               eattr = ABS | DEFINED | GLOBAL;
+                               eval = equreg;
+                               tok++;
+                       }
+                       // Checking for a register symbol
+                       else if (tok[0] == SYMBOL)
+                       {
+                               sy2 = lookup(string[tok[1]], LABEL, j);
+
+                               // Make sure symbol is a valid equreg
+                               if (!sy2 || !(sy2->sattre & EQUATEDREG))
+                               {
+                                       error("invalid .equr/.regequ definition");
+                                       goto loop;
                                }
                                else
                                {
-                                       error("invalid GPU/DSP .equr/.regequ definition");
-                                       goto loop;
+                                       eattr = ABS | DEFINED | GLOBAL; // Copy symbol's attributes
+                                       sy->sattre = sy2->sattre;
+                                       eval = (sy2->svalue & 0xFFFFF0FF);
+                                       tok += 2;
                                }
                        }
                        else
                        {
-                               sy->sattre = EQUATEDREG;        // Mark as equated register
-                               riscreg = *tok;
-                               tok++;
+                               error("invalid .equr/.regequ definition");
+                               goto loop;
                        }
                }
                else if (equtyp == REG)