diff lwasm/pragma.c @ 376:35d4213e6657

Add cycle counting to listing Add option to include instruction cycle counts to the listing. Thanks to Erik G <erik@6809.org> for the patch.
author William Astle <lost@l-w.ca>
date Mon, 13 Jul 2015 20:47:30 -0600
parents 71f507f404f1
children 67373a053c49
line wrap: on
line diff
--- a/lwasm/pragma.c	Mon Jul 13 20:35:16 2015 -0600
+++ b/lwasm/pragma.c	Mon Jul 13 20:47:30 2015 -0600
@@ -64,7 +64,11 @@
 	{ "6800compat", "no6800compat", PRAGMA_6800COMPAT },
 	{ "forwardrefmax", "noforwardrefmax", PRAGMA_FORWARDREFMAX },
 	{ "testmode", "notestmode", PRAGMA_TESTMODE },
-	{ 0, 0, 0}
+	{ "c", "noc", PRAGMA_C },
+	{ "cc", "nocc", PRAGMA_CC },
+	{ "cd", "nocd", PRAGMA_CD },
+	{ "ct", "noct", PRAGMA_CT },
+	{ 0, 0, 0 }
 };
 
 int parse_pragma_string(asmstate_t *as, char *str, int ignoreerr)
@@ -141,6 +145,11 @@
 	parse_pragma_string(as, ps, 1);
 	if (as -> pragmas & PRAGMA_NOLIST)
 		l -> pragmas |= PRAGMA_NOLIST;
+	if (as->pragmas & PRAGMA_CC)
+	{
+		l->pragmas |= PRAGMA_CC;
+		as->pragmas &= ~PRAGMA_CC;
+	}
 	lw_free(ps);
 }