comparison 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
comparison
equal deleted inserted replaced
240:41d64951eb32 241:d0e9dbe9afbe
156 { 156 {
157 lw_expr_t addr; // assembly address of the line 157 lw_expr_t addr; // assembly address of the line
158 lw_expr_t daddr; // data address of the line (os9 only) 158 lw_expr_t daddr; // data address of the line (os9 only)
159 int len; // the "size" this line occupies (address space wise) (-1 if unknown) 159 int len; // the "size" this line occupies (address space wise) (-1 if unknown)
160 int dlen; // the data "size" this line occupies (-1 if unknown) 160 int dlen; // the data "size" this line occupies (-1 if unknown)
161 int maxlen; // maximum length; will be zero if not relevant 161 int minlen; // minimum length
162 int maxlen; // maximum length
162 int insn; // number of insn in insn table 163 int insn; // number of insn in insn table
163 int symset; // set if the line symbol was consumed by the instruction 164 int symset; // set if the line symbol was consumed by the instruction
164 char *sym; // symbol, if any, on the line 165 char *sym; // symbol, if any, on the line
165 unsigned char *output; // output bytes 166 unsigned char *output; // output bytes
166 int outputl; // size of output 167 int outputl; // size of output
345 346
346 extern int lwasm_reduce_expr(asmstate_t *as, lw_expr_t expr); 347 extern int lwasm_reduce_expr(asmstate_t *as, lw_expr_t expr);
347 348
348 extern lw_expr_t lwasm_parse_cond(asmstate_t *as, char **p); 349 extern lw_expr_t lwasm_parse_cond(asmstate_t *as, char **p);
349 350
351 extern int lwasm_calculate_range(asmstate_t *as, lw_expr_t expr, int *min, int *max);
352
350 #endif 353 #endif
351 354
352 extern void debug_message(asmstate_t *as, int level, const char *fmt, ...); 355 extern void debug_message(asmstate_t *as, int level, const char *fmt, ...);
353 extern void dump_state(asmstate_t *as); 356 extern void dump_state(asmstate_t *as);
354 357