diff src/lwasm.c @ 58:b1d81800bc91

Added symbol listing to list file; various fixes
author lost
date Mon, 05 Jan 2009 00:20:45 +0000
parents 035b95a3690f
children 309810f39ab7
line wrap: on
line diff
--- a/src/lwasm.c	Mon Jan 05 00:01:21 2009 +0000
+++ b/src/lwasm.c	Mon Jan 05 00:20:45 2009 +0000
@@ -63,7 +63,8 @@
 void lwasm_emit(asmstate_t *as, lwasm_line_t *l, int b)
 {
 	as -> addr += 1;
-
+	as -> addr &= 0xffff;
+	
 	if (as -> passnum == 1)
 		return;
 
@@ -198,7 +199,7 @@
 int lwasm_expr_result(asmstate_t *as, lwasm_line_t *l, char **inp, int flag, int *val)
 {
 	lwasm_expr_stack_t *s;
-	char *ep;
+	const char *ep;
 	int rval;
 		
 	s = lwasm_evaluate_expr(as, l, *inp, &ep);
@@ -208,7 +209,7 @@
 		*val = 0;
 		return -1;
 	}
-	*inp = ep;
+	*inp = (char *)ep;
 	
 	if (flag & EXPR_PASS1CONST && as -> passnum == 1 && !lwasm_expr_is_constant(s))
 	{
@@ -258,6 +259,10 @@
 
 int lwasm_next_context(asmstate_t *as)
 {
-	return (as -> nextcontext++);
+	int r;
+	r = as -> nextcontext;
+	as -> nextcontext += 1;
+	debug_message(3, "lwasm_next_context(): %d (%d) pass %d", r, as -> nextcontext, as -> passnum);
+	return r;
 }