diff lwasm/pass1.c @ 343:98f3e016cfd8

Add pragma to turn off forward reference optimization Much source code doesn't benefit much, if at all, from forward reference optimization. Add "pragma forwardrefmax" to turn off such optimization in the event that it is not required and long assembly times result.
author William Astle <lost@l-w.ca>
date Mon, 16 Mar 2015 09:27:20 -0600
parents 30b2bad9b5eb
children c6d2a1f54e0c
line wrap: on
line diff
--- a/lwasm/pass1.c	Sat Mar 14 14:06:13 2015 -0600
+++ b/lwasm/pass1.c	Mon Mar 16 09:27:20 2015 -0600
@@ -342,6 +342,11 @@
 						// call parse function
 						debug_message(as, 100, "len = %d, dlen = %d", cl -> len, cl -> dlen);
 						(instab[opnum].parse)(as, cl, &p1);
+						// if we're forcing address modes on pass 1, force a resolution
+						if (CURPRAGMA(cl, PRAGMA_FORWARDREFMAX) && instab[opnum].resolve)
+						{
+							(instab[opnum].resolve)(as, cl, 1);
+						}
 						if ((cl -> inmod == 0) && cl -> len >= 0 && cl -> dlen >= 0)
 						{
 							if (cl -> len == 0)