Fix for bug #34 (equated reg in 1st operand of MOVEI).
authorShamus Hammons <jlhamm@acm.org>
Wed, 7 Oct 2015 15:44:48 +0000 (10:44 -0500)
committerShamus Hammons <jlhamm@acm.org>
Wed, 7 Oct 2015 15:44:48 +0000 (10:44 -0500)
Thanks to Linkovitch for reporting!

riscasm.c
version.h

index 37e29224a99d78a172044102beb277e0eaf661f1..23faaee7120df76cc71cc95dadce3de262f4cf1c 100644 (file)
--- a/riscasm.c
+++ b/riscasm.c
@@ -323,6 +323,15 @@ int GenerateRISCCode(int state)
                tok++;
                riscImmTokenSeen = 1;
 
+               // Check for equated register after # and return error if so
+               if (*tok == SYMBOL)
+               {
+                       sy = lookup(string[tok[1]], LABEL, 0);
+
+                       if (sy->sattre & EQUATEDREG)
+                               return error("equated register in 1st operand of MOVEI instruction");
+               }
+
                if (expr(r_expr, &eval, &eattr, &esym) != OK)
                        return MalformedOpcode(0x04);
 
index a46c7b171a79763733207cd85b86c6e5d869a1a4..238c0ef17aea33482905bf412e3b2b3bb1c74264 100644 (file)
--- a/version.h
+++ b/version.h
@@ -13,6 +13,6 @@
 
 #define MAJOR   1              // Major version number
 #define MINOR   3              // Minor version number
-#define PATCH                // Patch release number
+#define PATCH   10             // Patch release number
 
 #endif // __VERSION_H__