Mercurial > hg > index.cgi
comparison lwasm/lwasm.h @ 366:433dbc18fb41
Make byte overflow detection for 8 bit immediate not fail with COM operator
This is a horrible hack. Add a quick and dirty context to expression parsing
so that it knows whether an 8 bit or 16 bit complement is required. The 8
bit complement will just discard anything above bit 7. When returning an
operator back with lwasm_whichop(), the result will still be "COM" which
should allow other things to keep working as they already do.
This does prevent byte overflows when the complement operator is used,
however, and since those were introduced, there were problems building
Nitros9 among other things. This fix allows Nitros9 to build again.
author | William Astle <lost@l-w.ca> |
---|---|
date | Tue, 02 Jun 2015 20:58:14 -0600 |
parents | 3f8abaac214c |
children | c6d2a1f54e0c |
comparison
equal
deleted
inserted
replaced
365:3f8abaac214c | 366:433dbc18fb41 |
---|---|
321 lw_expr_t savedaddr; // old address counter before struct started | 321 lw_expr_t savedaddr; // old address counter before struct started |
322 int exportcheck; // set if we need to collapse out the section base to 0 | 322 int exportcheck; // set if we need to collapse out the section base to 0 |
323 int passno; // set to the current pass number | 323 int passno; // set to the current pass number |
324 int preprocess; // set if we are prepocessing | 324 int preprocess; // set if we are prepocessing |
325 int fileerr; // flags error opening file | 325 int fileerr; // flags error opening file |
326 int exprwidth; // the bit width of the expression being evaluated | |
326 }; | 327 }; |
327 | 328 |
328 #ifndef ___symbol_c_seen___ | 329 #ifndef ___symbol_c_seen___ |
329 | 330 |
330 extern struct symtabe *register_symbol(asmstate_t *as, line_t *cl, char *sym, lw_expr_t value, int flags); | 331 extern struct symtabe *register_symbol(asmstate_t *as, line_t *cl, char *sym, lw_expr_t value, int flags); |