#define AnESYM a0esym
#define AMn_IX0 am0_ix0
#define AMn_IXN am0_ixn
+ #define CHK_FOR_DISPn CheckForDisp0
#include "parmode.h"
// If caller wants only one mode, return just one (ignore comma);
#define AnESYM a1esym
#define AMn_IX0 am1_ix0
#define AMn_IXN am1_ixn
+ #define CHK_FOR_DISPn CheckForDisp1
#include "parmode.h"
nmodes = 2;
AMn = IMMED;
}
+
+ // Small problem with this is that the opening parentheses might be an
+ // expression that's part of a displacement; this code will falsely flag
+ // that as an error.
+
// (An)
// (An)+
// (An,Xn[.siz][*scale])
if (expr(AnEXPR, &AnEXVAL, &AnEXATTR, &AnESYM) != OK)
return ERROR;
+ // It could be that this is really just an expression prefixing a
+ // register as a displacement...
+ if (*tok == ')')
+ {
+ tok++;
+ goto CHK_FOR_DISPn;
+ }
+
+ // Otherwise, check for PC & etc displacements...
if (*tok++ != ',')
goto badmode;
if (expr(AnEXPR, &AnEXVAL, &AnEXATTR, &AnESYM) != OK)
return ERROR;
+CHK_FOR_DISPn:
if (*tok == DOTW)
{
// expr.W
;
}
-// Cleanup dirty little macros
+// Clean up dirty little macros
#undef AnOK
#undef AMn
#undef AnREG
#undef AnESYM
#undef AMn_IX0
#undef AMn_IXN
+#undef CHK_FOR_DISPn
#define MAJOR 1 // Major version number
#define MINOR 4 // Minor version number
-#define PATCH 0 // Patch release number
+#define PATCH 1 // Patch release number
#endif // __VERSION_H__