Mercurial > hg-old > index.cgi
annotate lwasm/parse.c @ 255:6363b9ebf825 2.x
Support files with line numbers in lwasm
author | lost |
---|---|
date | Sun, 20 Dec 2009 05:40:47 +0000 |
parents | c7a41b4c89b3 |
children | 6d09310438a4 |
rev | line source |
---|---|
36 | 1 /* |
2 parse.c | |
3 Copyright © 2008 William Astle | |
4 | |
5 This file is part of LWASM. | |
6 | |
7 LWASM is free software: you can redistribute it and/or modify it under the | |
8 terms of the GNU General Public License as published by the Free Software | |
9 Foundation, either version 3 of the License, or (at your option) any later | |
10 version. | |
11 | |
12 This program is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
15 more details. | |
16 | |
17 You should have received a copy of the GNU General Public License along with | |
18 this program. If not, see <http://www.gnu.org/licenses/>. | |
19 */ | |
20 | |
21 /* | |
22 Contains the general parser | |
23 */ | |
24 | |
25 #define __parse_c_seen__ | |
212 | 26 #include <config.h> |
36 | 27 |
28 #include <ctype.h> | |
29 #include <string.h> | |
30 | |
31 #include "lwasm.h" | |
32 #include "instab.h" | |
33 #include "util.h" | |
34 | |
35 // parse a line and despatch to the appropriate handlers for opcodes | |
36 int lwasm_parse_line(asmstate_t *as, lwasm_line_t *l) | |
37 { | |
38 char *p, *p2; | |
39 char *opc; | |
40 int opnum; | |
44 | 41 char *sym = NULL; |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
42 |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
43 // if this was a bad op first pass (or otherwise a no-process line) |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
44 // ignore it |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
45 if (l -> badop) |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
46 return; |
36 | 47 |
48 p = l -> text; | |
101
f59c0916753d
Fixed relative branches and PCR addressing to handle constant intra-section references properly
lost
parents:
99
diff
changeset
|
49 l -> sect = as -> csect; |
236
a58f49a77441
Added os9 target, pragma to control whether $ localizes a symbol, and fixed some condition nesting bugs
lost
parents:
230
diff
changeset
|
50 l -> inmod = as -> inmod; |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
51 |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
52 // blank lines are a no brainer |
36 | 53 if (!*p) |
37
538e15927776
Added symbol handling to expression subsystem; adpated instruction handlers to the new scheme; misc fixes
lost
parents:
36
diff
changeset
|
54 { |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
55 as -> context = lwasm_next_context(as); |
36 | 56 return 0; |
37
538e15927776
Added symbol handling to expression subsystem; adpated instruction handlers to the new scheme; misc fixes
lost
parents:
36
diff
changeset
|
57 } |
36 | 58 |
52 | 59 // for output generation later but only on pass 1 |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
60 // also used by some pseudo ops on pass 2 |
52 | 61 if (as -> passnum == 1) |
62 l -> codeaddr = as -> addr; | |
255 | 63 |
64 // check if there is a line number and ignore it if there is | |
65 if (isdigit(*p)) | |
66 { | |
67 for (p2 = p; *p2 && isdigit(*p2); p2++) | |
68 /* do nothing */ ; | |
69 | |
70 // we have a line number, skip it and the *first* | |
71 // whitespace character | |
72 if (!*p2 || isspace(*p2)) | |
73 p = p2 + 1; | |
74 } | |
44 | 75 |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
76 // if it's a comment, return (this doesn't cause a context change) |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
77 if (*p == '*' || *p == ';') |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
78 return; |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
79 |
169 | 80 // if we have C pre-processor directives/output, ignore it |
81 if (*p == '#') | |
82 return; | |
83 | |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
84 // if we start with a non-space character, it's a symbol |
244
c8bcc396ec59
Allow symbols to appear after whitespace when terminated by :
lost
parents:
236
diff
changeset
|
85 symbolagain: |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
86 if (!isspace(*p)) |
36 | 87 { |
253 | 88 // if it starts with a comment character, it's not a symbol |
89 if (*p == ';' || *p == '*') | |
90 return; | |
91 | |
36 | 92 // we have a symbol specified here |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
93 // parse it out and record it for later use |
157 | 94 for (p2 = p; *p2 && !isspace(*p2) && *p2 != ':'; p2++) |
37
538e15927776
Added symbol handling to expression subsystem; adpated instruction handlers to the new scheme; misc fixes
lost
parents:
36
diff
changeset
|
95 /* do nothing */ ; |
538e15927776
Added symbol handling to expression subsystem; adpated instruction handlers to the new scheme; misc fixes
lost
parents:
36
diff
changeset
|
96 |
538e15927776
Added symbol handling to expression subsystem; adpated instruction handlers to the new scheme; misc fixes
lost
parents:
36
diff
changeset
|
97 sym = lwasm_alloc((p2 - p) + 1); |
538e15927776
Added symbol handling to expression subsystem; adpated instruction handlers to the new scheme; misc fixes
lost
parents:
36
diff
changeset
|
98 sym[p2 - p] = '\0'; |
538e15927776
Added symbol handling to expression subsystem; adpated instruction handlers to the new scheme; misc fixes
lost
parents:
36
diff
changeset
|
99 memcpy(sym, p, p2 - p); |
538e15927776
Added symbol handling to expression subsystem; adpated instruction handlers to the new scheme; misc fixes
lost
parents:
36
diff
changeset
|
100 |
44 | 101 p = p2; |
157 | 102 if (!*sym) |
103 { | |
104 register_error(as, l, 1, "Invalid symbol"); | |
105 lwasm_free(sym); | |
106 sym = NULL; | |
107 } | |
108 if (*p == ':') | |
109 p++; | |
37
538e15927776
Added symbol handling to expression subsystem; adpated instruction handlers to the new scheme; misc fixes
lost
parents:
36
diff
changeset
|
110 } |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
111 l -> sym = sym; |
36 | 112 |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
113 // now skip any whitespace to find the opcode |
36 | 114 while (*p && isspace(*p)) |
115 p++; | |
116 | |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
117 // is the line blank? |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
118 if (!*p && !sym) |
37
538e15927776
Added symbol handling to expression subsystem; adpated instruction handlers to the new scheme; misc fixes
lost
parents:
36
diff
changeset
|
119 { |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
120 // nothing but white space *is* a context break |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
121 as -> context = lwasm_next_context(as); |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
122 return; |
37
538e15927776
Added symbol handling to expression subsystem; adpated instruction handlers to the new scheme; misc fixes
lost
parents:
36
diff
changeset
|
123 } |
36 | 124 |
125 // parse the opcode | |
126 for (p2 = p; *p2 && !isspace(*p2); p2++) | |
127 /* do nothing */ ; | |
128 | |
129 opc = lwasm_alloc((p2 - p) + 1); | |
130 memcpy(opc, p, p2 - p); | |
131 opc[p2 - p] = '\0'; | |
132 | |
244
c8bcc396ec59
Allow symbols to appear after whitespace when terminated by :
lost
parents:
236
diff
changeset
|
133 if (strchr(opc, ':')) |
c8bcc396ec59
Allow symbols to appear after whitespace when terminated by :
lost
parents:
236
diff
changeset
|
134 { |
c8bcc396ec59
Allow symbols to appear after whitespace when terminated by :
lost
parents:
236
diff
changeset
|
135 lwasm_free(opc); |
c8bcc396ec59
Allow symbols to appear after whitespace when terminated by :
lost
parents:
236
diff
changeset
|
136 goto symbolagain; |
c8bcc396ec59
Allow symbols to appear after whitespace when terminated by :
lost
parents:
236
diff
changeset
|
137 } |
c8bcc396ec59
Allow symbols to appear after whitespace when terminated by :
lost
parents:
236
diff
changeset
|
138 |
190 | 139 l -> forceglobal = 0; |
140 // if the opcode contains an =, treat it as "symbol = expr" | |
141 if (!sym && strchr(opc, '=')) | |
142 { | |
143 for (p2 = opc; *p2 && *p2 != '='; p2++) | |
144 /* do nothing */ ; | |
145 sym = lwasm_alloc((p2 - opc) + 1); | |
146 memcpy(sym, opc, p2 - opc); | |
147 sym[p2 - opc] = '\0'; | |
148 l -> sym = sym; | |
149 | |
150 p2 = p + (p2 - opc) + 1; | |
151 // p2++; | |
152 opc[0] = '='; | |
153 opc[1] = '\0'; | |
154 debug_message(2, "Found opcode = with symbol %s and operand %s", sym, p2); | |
155 l -> forceglobal = 1; | |
156 } | |
157 | |
38 | 158 debug_message(2, "Found operation code: '%s'", opc); |
159 | |
36 | 160 // skip intervening whitespace if present |
161 while (*p2 && isspace(*p2)) | |
162 p2++; | |
163 | |
164 // look up instruction in insn table | |
165 for (opnum = 0; instab[opnum].opcode; opnum++) | |
166 { | |
167 if (!strcasecmp(instab[opnum].opcode, opc)) | |
168 break; | |
169 } | |
170 | |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
171 // if we found no operation, check if we had a comment |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
172 // the reason this check is here is to allow for "private" |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
173 // operation codes like "*pragma" which will be ignored by |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
174 // other assemblers |
68 | 175 // also skip empty ops |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
176 if (!(instab[opnum].opcode)) |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
177 { |
68 | 178 if (*opc == '*' || *opc == ';' || !*opc) |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
179 goto done_line; |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
180 } |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
181 |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
182 // now we have the opcode and the symbol, we can decide if we're |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
183 // actually going to do anything with this line |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
184 |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
185 // we will NOT call the function if any of the following are true: |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
186 |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
187 // - we are skipping a condition and the operation code is not a conditional |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
188 // - we are defining a macro and the operation code is not ENDM |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
189 |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
190 // we will call the function in any other circumstance |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
191 |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
192 // first condition above |
57 | 193 if (as -> inmacro && instab[opnum].endm == 0) |
194 { | |
195 add_macro_line(as, l -> text); | |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
196 goto done_line; |
57 | 197 } |
198 | |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
199 // second condition above |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
200 if (as -> skipcond && instab[opnum].iscond == 0) |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
201 goto done_line; |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
202 |
254 | 203 if (as -> instruct && as -> passnum == 1) |
204 { | |
205 structtab_t *s = NULL; | |
206 struct struct_sym_e *e, *e2; | |
207 | |
208 // look for a structure if not an acceptable opcode | |
209 if (!instab[opnum].opcode) | |
210 { | |
211 for (s = as -> structs; s; s = s -> next) | |
212 { | |
213 if (s == as -> cstruct) | |
214 continue; | |
215 if (!strcmp(opc, s -> name)) | |
216 goto isok; | |
217 } | |
218 } | |
219 // check for a "reservation opcode" | |
220 if (instab[opnum].opcode && instab[opnum].isreserve) | |
221 { | |
222 (instab[opnum].fn)(as, l, &p2, opnum); | |
223 | |
224 // if we didn't end on a "space" character or EOL, throw error | |
225 if (p2 && *p2 && !isspace(*p2) && !(l -> err) && as -> passnum == 1) | |
226 register_error(as, l, 1, "Bad operand: %s (%d)", p2, as -> passnum); | |
227 | |
228 if (as -> instruct == 0) | |
229 goto done_line; | |
230 | |
231 goto isok; | |
232 } | |
233 // carp if not valid | |
234 register_error(as, l, 1, "Only other structs and rmb allowed in struct"); | |
235 l -> badop = 1; | |
236 goto done_line; | |
237 | |
238 isok: | |
239 for (e2 = as -> cstruct -> fields; e2 && e2 -> next; e2 = e2 -> next) | |
240 /* do nothing */ ; | |
241 e = lwasm_alloc(sizeof(struct struct_sym_e)); | |
242 e -> next = NULL; | |
243 e -> substruct = s; | |
244 if (sym) | |
245 e -> name = lwasm_strdup(sym); | |
246 else | |
247 e -> name = NULL; | |
248 if (s) | |
249 e -> size = s -> size; | |
250 else | |
251 e -> size = l -> nocodelen; | |
252 if (e2) | |
253 e2 -> next = e; | |
254 else | |
255 as -> cstruct -> fields = e; | |
256 as -> cstruct -> size += e -> size; | |
257 } | |
258 | |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
259 // we've registered the symbol as needed |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
260 // now we need to check for a macro call IFF we don't collide with |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
261 // an operation code; otherwise, call the operation function |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
262 if (instab[opnum].opcode) |
36 | 263 { |
230
0df2a39a268c
Added --6809/--6309 switches and some cleanups in error reporting
lost
parents:
223
diff
changeset
|
264 if (instab[opnum].fn && !(as -> no6309 && instab[opnum].is6309)) |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
265 { |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
266 (instab[opnum].fn)(as, l, &p2, opnum); |
223
436b36214e35
Fixed lack of error when there are extraneous characters at the end of the operand.
lost
parents:
212
diff
changeset
|
267 |
436b36214e35
Fixed lack of error when there are extraneous characters at the end of the operand.
lost
parents:
212
diff
changeset
|
268 // if we didn't end on a "space" character or EOL, throw error |
250
0986834ec7d3
Added no-op .bank pseudo-op to support compiling gcc6809
lost
parents:
244
diff
changeset
|
269 if (p2 && *p2 && !isspace(*p2) && !(l -> err) && as -> passnum == 1) |
236
a58f49a77441
Added os9 target, pragma to control whether $ localizes a symbol, and fixed some condition nesting bugs
lost
parents:
230
diff
changeset
|
270 register_error(as, l, 1, "Bad operand: %s (%d)", p2, as -> passnum); |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
271 } |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
272 else |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
273 { |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
274 // carp about unimplemented operation |
230
0df2a39a268c
Added --6809/--6309 switches and some cleanups in error reporting
lost
parents:
223
diff
changeset
|
275 if (instab[opnum].is6309) |
0df2a39a268c
Added --6809/--6309 switches and some cleanups in error reporting
lost
parents:
223
diff
changeset
|
276 register_error(as, l, 1, "Use of 6309 operation code: %s", opc); |
0df2a39a268c
Added --6809/--6309 switches and some cleanups in error reporting
lost
parents:
223
diff
changeset
|
277 else |
0df2a39a268c
Added --6809/--6309 switches and some cleanups in error reporting
lost
parents:
223
diff
changeset
|
278 register_error(as, l, 1, "Unimplemented operation code: %s", opc); |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
279 } |
36 | 280 } |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
281 else |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
282 { |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
283 if (expand_macro(as, l, &p2, opc) == 0) |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
284 goto done_line; |
36 | 285 |
254 | 286 if (expand_struct(as, l, &p2, opc) == 0) |
287 goto done_line; | |
288 | |
66
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
289 // carp about an unknown operation code and note that fact for |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
290 // pass 2 in case a macro appears later with the same name! |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
291 register_error(as, l, 1, "Uknown operation code: %s", opc); |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
292 l -> badop = 1; |
aa9d9fedfdf4
Redid lwasm_parse_line() to correct overly complex logic flaws
lost
parents:
64
diff
changeset
|
293 } |
57 | 294 |
295 done_line: | |
68 | 296 if (!(as -> skipcond || as -> inmacro)) |
297 { | |
298 // register symbol if the operation didn't | |
254 | 299 if (sym && instab[opnum].setsym == 0 && as -> instruct == 0) |
68 | 300 { |
301 if (as -> passnum == 1) | |
302 { | |
71
90a5657d5408
Fixed problem with symbols being registered with the address of the NEXT instruction
lost
parents:
68
diff
changeset
|
303 debug_message(1, "Registering symbol '%s' at %04X", sym, l -> codeaddr); |
90a5657d5408
Fixed problem with symbols being registered with the address of the NEXT instruction
lost
parents:
68
diff
changeset
|
304 if (lwasm_register_symbol(as, l, sym, l -> codeaddr, SYMBOL_NORM) < 0) |
68 | 305 l -> sym = NULL; |
306 else | |
307 l -> addrset = 1; | |
308 } | |
309 } | |
310 } | |
99 | 311 |
85 | 312 l -> sect = as -> csect; |
91
718998b673ee
Added incomplete references to object output and added support for section base terms in expression handler
lost
parents:
85
diff
changeset
|
313 l -> context = as -> context; |
85 | 314 |
36 | 315 lwasm_free(opc); |
44 | 316 if (sym) |
317 lwasm_free(sym); | |
36 | 318 } |