j = (*p == '.' ? curenv : 0);
symbol = lookup(p, LABEL, j);
#if 0
-printf("eval: Looking up symbol [=%08X]\n", symbol);
+printf("eval: Looking up symbol (%s) [=%08X]\n", p, symbol);
if (symbol)
printf(" attr=%04X, attre=%08X, val=%i, name=%s\n", symbol->sattr, symbol->sattre, symbol->svalue, symbol->sname);
#endif
symbol->sattr |= REFERENCED;
- // Check for undefined register equates
- if (symbol->sattre & UNDEF_EQUR)
+ // Check for undefined register equates, but only if it's not part
+ // of a #<SYMBOL> construct, as it could be that the label that's
+ // been undefined may later be used as an address label--which
+ // means it will be fixed up later, and thus, not an error.
+ if ((symbol->sattre & UNDEF_EQUR) && !riscImmTokenSeen)
{
errors("undefined register equate '%s'", symbol->sname);
//if we return right away, it returns some spurious errors...
*/
if (symbol->sattre & EQUATEDREG)
*a_value &= 0x1F;
-
*a_attr = (WORD)(symbol->sattr & ~GLOBAL);
if ((symbol->sattr & (GLOBAL | DEFINED)) == GLOBAL && a_esym != NULL)
}
else
{
- // Unknown type here... Alert the user!
+ // Unknown type here... Alert the user!,
error("undefined RISC register in expression");
// Prevent spurious error reporting...
tok++;