changeset 60:309810f39ab7

Implemented the * and . special symbols
author lost
date Mon, 05 Jan 2009 00:44:38 +0000
parents 89657cb3fdf8
children 73423b66e511
files src/lwasm.c
diffstat 1 files changed, 22 insertions(+), 0 deletions(-) [+]
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)