diff lwasm/parse.c @ 230:0df2a39a268c

Added --6809/--6309 switches and some cleanups in error reporting
author lost
date Fri, 12 Jun 2009 03:18:32 +0000
parents 436b36214e35
children a58f49a77441
line wrap: on
line diff
--- a/lwasm/parse.c	Fri Jun 12 01:31:18 2009 +0000
+++ b/lwasm/parse.c	Fri Jun 12 03:18:32 2009 +0000
@@ -181,18 +181,21 @@
 	// an operation code; otherwise, call the operation function
 	if (instab[opnum].opcode)
 	{
-		if (instab[opnum].fn)
+		if (instab[opnum].fn && !(as -> no6309 && instab[opnum].is6309))
 		{
 			(instab[opnum].fn)(as, l, &p2, opnum);
 			
 			// if we didn't end on a "space" character or EOL, throw error
-			if (*p2 && !isspace(*p2))
+			if (*p2 && !isspace(*p2) && !(l -> err))
 				register_error(as, l, 1, "Bad operand");
 		}
 		else
 		{
 			// carp about unimplemented operation
-			register_error(as, l, 1, "Unimplemented operation code: %s", opc);
+			if (instab[opnum].is6309)
+				register_error(as, l, 1, "Use of 6309 operation code: %s", opc);
+			else
+				register_error(as, l, 1, "Unimplemented operation code: %s", opc);
 		}
 	}
 	else