diff lwasm/insn_logicmem.c @ 136:b78b2f1e011e

Fixed additional instruction length problems with logic/memory operations
author lost@l-w.ca
date Wed, 17 Aug 2011 21:04:33 -0600
parents 7317fbe024af
children 8764142b3192
line wrap: on
line diff
--- a/lwasm/insn_logicmem.c	Wed Aug 17 19:44:32 2011 -0600
+++ b/lwasm/insn_logicmem.c	Wed Aug 17 21:04:33 2011 -0600
@@ -29,7 +29,7 @@
 #include "lwasm.h"
 #include "instab.h"
 
-extern void insn_parse_gen_aux(asmstate_t *as, line_t *l, char **optr);
+extern void insn_parse_gen_aux(asmstate_t *as, line_t *l, char **optr, int elen);
 extern void insn_resolve_gen_aux(asmstate_t *as, line_t *l, int force, int elen);
 extern void insn_emit_gen_aux(asmstate_t *as, line_t *l, int extra);
 
@@ -59,7 +59,7 @@
 	(*p)++;
 
 	// now we have a general addressing mode - call for it
-	insn_parse_gen_aux(as, l, p);
+	insn_parse_gen_aux(as, l, p, 1);
 }
 
 RESOLVEFUNC(insn_resolve_logicmem)
@@ -83,11 +83,12 @@
 	}
 	
 	v = lw_expr_intval(e);
-	if (v < -128 || v > 255)
+/*	if (v < -128 || v > 255)
 	{
+		fprintf(stderr, "BYTE: %d\n", v);
 		lwasm_register_error(as, l, "Byte overflow");
 		return;
 	}
-	
-	insn_emit_gen_aux(as, l, v);
+*/	
+	insn_emit_gen_aux(as, l, v & 0xff);
 }