+//
+// Function to return "Illegal Indexed Register" error
+// Anyone trying to index something other than R14 or R15
+//
+static inline int IllegalIndexedRegister(int reg)
+{
+ char buf[16];
+ sprintf(buf, "%d", reg - KW_R0);
+ return errors("Attempted index reference with non-indexable register (r%s)", buf);
+}
+
+//
+// Function to return "Illegal Indexed Register" error for EQUR scenarios
+// Trying to use register value within EQUR that isn't 14 or 15
+//
+static inline int IllegalIndexedRegisterEqur(SYM *sy)
+{
+ //char buf[160];
+ char *buf = NULL;
+ buf = (char *)malloc((strlen(sy->sname) + 7) * sizeof(char));
+ if (NULL != buf) {
+ sprintf(buf, "%s = r%d",sy->sname, sy->svalue);
+ return errors("Attempted index reference with non-indexable register within EQUR (%s)", buf);
+ }
+ return errors("Unable to allocate memory! (IllegalIndexRegisterEqur)", "OOPS");
+}