diff lwasm/insn_rel.c @ 241:d0e9dbe9afbe

Add new heuristic for resolving instruction sizes. Add new heuristic for resolving instruction sizes. This applies to the the decision between extended and base page addressing by calculating the range of possible addresses (if reasonably knowable) and deciding on whether to force extended addressing based on that. (If the whole range is outside the direct page, extended addressing is required.)
author William Astle <lost@l-w.ca>
date Sun, 23 Sep 2012 13:06:43 -0600
parents 6f2e18f1fe67
children 8764142b3192
line wrap: on
line diff
--- a/lwasm/insn_rel.c	Tue Aug 14 23:03:59 2012 -0600
+++ b/lwasm/insn_rel.c	Sun Sep 23 13:06:43 2012 -0600
@@ -51,6 +51,7 @@
 	
 	l -> lint = -1;
 	l -> maxlen = OPLEN(instab[l -> insn].ops[3]) + 2;
+	l -> minlen = OPLEN(instab[l -> insn].ops[2]) + 1;
 	if (CURPRAGMA(l, PRAGMA_AUTOBRANCHLENGTH) == 0)
 	{
 		l -> lint = instab[l -> insn].ops[1];