diff lwasm/lwasm.h @ 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 7c2c2239ec9c
children d4ac484d0ec6
line wrap: on
line diff
--- a/lwasm/lwasm.h	Tue Aug 14 23:03:59 2012 -0600
+++ b/lwasm/lwasm.h	Sun Sep 23 13:06:43 2012 -0600
@@ -158,7 +158,8 @@
 	lw_expr_t daddr;					// data address of the line (os9 only)
 	int len;							// the "size" this line occupies (address space wise) (-1 if unknown)
 	int dlen;							// the data "size" this line occupies (-1 if unknown)
-	int maxlen;							// maximum length; will be zero if not relevant
+	int minlen;							// minimum length
+	int maxlen;							// maximum length
 	int insn;							// number of insn in insn table
 	int symset;							// set if the line symbol was consumed by the instruction
 	char *sym;							// symbol, if any, on the line
@@ -347,6 +348,8 @@
 
 extern lw_expr_t lwasm_parse_cond(asmstate_t *as, char **p);
 
+extern int lwasm_calculate_range(asmstate_t *as, lw_expr_t expr, int *min, int *max);
+
 #endif
 
 extern void debug_message(asmstate_t *as, int level, const char *fmt, ...);