Thanks to Linkovitch for the report; now at v2.0.7.
{
*evalTokenBuffer.u32++ = CONST;
*evalTokenBuffer.u64++ = *a_value = (*tok - KW_R0);
- *a_attr = ABS | DEFINED;
+ *a_attr = ABS | DEFINED | RISCREG;
if (a_esym != NULL)
*a_esym = NULL;
symbolNum++;
#endif
- if (symbol->sattr & DEFINED)
- *a_value = symbol->svalue;
- else
- *a_value = 0;
+ *a_value = (symbol->sattr & DEFINED ? symbol->svalue : 0);
+ *a_attr = (WORD)(symbol->sattr & ~GLOBAL);
/*
All that extra crap that was put into the svalue when doing the equr stuff is
thrown away right here. What the hell is it for?
*/
if (symbol->sattre & EQUATEDREG)
+ {
*a_value &= 0x1F;
-
- *a_attr = (WORD)(symbol->sattr & ~GLOBAL);
+ *a_attr |= RISCREG; // Mark it as a register, 'cause it is
+ *a_esym = symbol;
+ }
if ((symbol->sattr & (GLOBAL | DEFINED)) == GLOBAL
&& a_esym != NULL)
int indexed; // Indexed register flag
uint64_t eval; // Expression value
- uint16_t eattr; // Expression attributes
+ uint16_t eattr; // Expression attributes
SYM * esym; // External symbol involved in expr.
TOKEN r_expr[EXPRSIZE]; // Expression token list
}
else
{
+ if (esym && (esym->sattre & EQUATEDREG))
+ return error("equated register seen for immediate value");
+
+ if (eattr & RISCREG)
+ return error("register seen for immediate value");
+
if (((int)eval < reg1) || ((int)eval > reg2))
- return error("constant out of range (%d to %d", reg1, reg2);
+ return error("constant out of range (%d to %d)", reg1, reg2);
if (parm & SUB32)
reg1 = 32 - (int)eval;
#define EQUATED 0x0800 // Symbol was equated
#define SDECLLIST 0x0400 // Symbol is on 'sdecl'-order list
#define FLOAT 0x0200 // Symbol is a floating point value
+#define RISCREG 0x0100 // Symbol is a RISC register
// Expression spaces, ORed with symbol and expression attributes above
#define ABS 0x0000 // In absolute space
#define MAJOR 2 // Major version number
#define MINOR 0 // Minor version number
-#define PATCH 6 // Patch release number
+#define PATCH 7 // Patch release number
#endif // __VERSION_H__