diff lwasm/pseudo.c @ 229:59a138df0401

Fixed additional parsing problems with pseudo ops
author lost
date Fri, 12 Jun 2009 01:31:18 +0000
parents 058f18119025
children aa0056ca7319
line wrap: on
line diff
--- a/lwasm/pseudo.c	Fri Jun 12 00:19:03 2009 +0000
+++ b/lwasm/pseudo.c	Fri Jun 12 01:31:18 2009 +0000
@@ -34,7 +34,7 @@
 
 OPFUNC(pseudo_noop)
 {
-
+	skip_operand(p);
 }
 
 OPFUNC(pseudo_org)
@@ -54,6 +54,7 @@
 		// resolve on the second pass
 		// we saved the org address in l -> codeaddr on pass 1
 		as -> addr = l -> codeaddr;
+		skip_operand(p);
 		return;
 	}
 	
@@ -84,6 +85,7 @@
 	if (as -> passnum != 1)
 	{
 		as -> context = lwasm_next_context(as);
+		skip_operand(p);
 		return;
 	}
 
@@ -208,6 +210,7 @@
 	if (as -> passnum == 2)
 	{
 		as -> addr += l -> nocodelen;
+		skip_operand(p);
 		return;
 	}
 	r = lwasm_expr_result2(as, l, p, EXPR_SECTCONST | EXPR_PASS1CONST, &v, -1);
@@ -224,6 +227,7 @@
 	if (as -> passnum == 2)
 	{
 		as -> addr += l -> nocodelen;
+		skip_operand(p);
 		return;
 	}
 	r = lwasm_expr_result2(as, l, p, EXPR_SECTCONST | EXPR_PASS1CONST, &v, 0);
@@ -241,6 +245,7 @@
 	if (as -> passnum == 2)
 	{
 		as -> addr += l -> nocodelen;
+		skip_operand(p);
 		return;
 	}
 	r = lwasm_expr_result2(as, l, p, EXPR_SECTCONST | EXPR_PASS1CONST, &v, 0);
@@ -296,7 +301,10 @@
 	
 	// address only matters for DECB output
 	if (as -> outformat != OUTPUT_DECB)
+	{
+		skip_operand(p);
 		return;
+	}
 	
 	r = lwasm_expr_result2(as, l, p, 0, &v, 0);
 	if (r != 0)
@@ -321,6 +329,7 @@
 	
 	if (as -> passnum == 2)
 	{
+		skip_operand(p);
 		while (as -> addr < l -> symaddr)
 			lwasm_emit(as, l, 0);
 		return;
@@ -762,6 +771,7 @@
 
 	if (as -> passnum != 1)
 	{
+		skip_operand(p);
 		if (!(l -> fsize))
 		{
 			as -> skipcond = 1;
@@ -817,6 +827,7 @@
 
 	if (as -> passnum != 1)
 	{
+		skip_operand(p);
 		if (l -> fsize)
 		{
 			as -> skipcond = 1;
@@ -1087,6 +1098,7 @@
 	as -> addr = 0;
 	as -> csect = 0;
 	as -> context = lwasm_next_context(as);
+	skip_operand(p);
 }
 
 OPFUNC(pseudo_extern)
@@ -1109,6 +1121,7 @@
 	if (l -> sym)
 	{
 		lwasm_register_symbol(as, l, l -> sym, 0, SYMBOL_EXTERN);
+		for ( ; **p; (*p)++) ;
 		return;
 	}
 	
@@ -1154,7 +1167,15 @@
 	}
 
 	if (as -> passnum == 1)
+	{
+		skip_operand(p);
 		return;
+	}
+
+	if (l -> sym)
+	{
+		for ( ; **p; (*p)++) ;
+	}
 
 again:
 	if (!(l -> sym) || after == 1)