comparison 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
comparison
equal deleted inserted replaced
59:89657cb3fdf8 60:309810f39ab7
171 struct symstateinfo *st; 171 struct symstateinfo *st;
172 172
173 st = state; 173 st = state;
174 debug_message(3, "lwasm_expr_lookup_symbol(): find '%s' (context=%d)", sym, st -> as -> context); 174 debug_message(3, "lwasm_expr_lookup_symbol(): find '%s' (context=%d)", sym, st -> as -> context);
175 175
176 // check for special symbols first...
177 if (sym[1] == '\0')
178 {
179 switch (sym[0])
180 {
181 // current line address
182 case '*':
183 case '.':
184 *val = st -> l -> codeaddr;
185 return 0;
186
187 case '<':
188 // previous branch point
189 // not implemented
190 break;
191 case '>':
192 // next branch point
193 // not implemented
194 break;
195 }
196 }
197
176 // look for local symbol first then global symbol 198 // look for local symbol first then global symbol
177 se = lwasm_find_symbol(st -> as, sym, st -> as -> context); 199 se = lwasm_find_symbol(st -> as, sym, st -> as -> context);
178 if (!se) 200 if (!se)
179 se = lwasm_find_symbol(st -> as, sym, -1); 201 se = lwasm_find_symbol(st -> as, sym, -1);
180 debug_message(3, "lwasm_expr_lookup_symbol(): got '%p'", se); 202 debug_message(3, "lwasm_expr_lookup_symbol(): got '%p'", se);