diff src/lwasm.c @ 60:309810f39ab7

Implemented the * and . special symbols
author lost
date Mon, 05 Jan 2009 00:44:38 +0000
parents b1d81800bc91
children c8c772ef5df9
line wrap: on
line diff
--- a/src/lwasm.c	Mon Jan 05 00:40:58 2009 +0000
+++ b/src/lwasm.c	Mon Jan 05 00:44:38 2009 +0000
@@ -173,6 +173,28 @@
 	st = state;
 	debug_message(3, "lwasm_expr_lookup_symbol(): find '%s' (context=%d)", sym, st -> as -> context);	
 
+	// check for special symbols first...
+	if (sym[1] == '\0')
+	{
+		switch (sym[0])
+		{
+		// current line address
+		case '*':
+		case '.':
+			*val = st -> l -> codeaddr;
+			return 0;
+		
+		case '<':
+			// previous branch point
+			// not implemented
+			break;
+		case '>':
+			// next branch point
+			// not implemented
+			break;
+		}
+	}
+
 	// look for local symbol first then global symbol
 	se = lwasm_find_symbol(st -> as, sym, st -> as -> context);
 	if (!se)