Mercurial > hg-old > index.cgi
comparison lwasm/insn_gen.c @ 222:7803d2d09993
Allow 8 bit immediate operands to be external references
author | lost |
---|---|
date | Sat, 09 May 2009 16:39:17 +0000 |
parents | 2b254f02b252 |
children |
comparison
equal
deleted
inserted
replaced
221:271c0ef9ea60 | 222:7803d2d09993 |
---|---|
157 (*p)++; | 157 (*p)++; |
158 r = lwasm_expr_result2(as, l, p, 0, &rval, 0); | 158 r = lwasm_expr_result2(as, l, p, 0, &rval, 0); |
159 if (r != 0) | 159 if (r != 0) |
160 rval = 0; | 160 rval = 0; |
161 if (r == 1 && as -> passnum == 2) | 161 if (r == 1 && as -> passnum == 2) |
162 register_error(as, l, 2, "Illegal external or intersegment reference"); | 162 { |
163 l -> relocoff = as -> addr - l -> codeaddr; | |
164 l -> reloc8bit = 1; | |
165 } | |
166 // register_error(as, l, 2, "Illegal external or intersegment reference"); | |
163 lwasm_emit(as, l, rval & 0xff); | 167 lwasm_emit(as, l, rval & 0xff); |
164 return; | 168 return; |
165 } | 169 } |
166 | 170 |
167 insn_gen_aux(as, l, p, opnum, -1); | 171 insn_gen_aux(as, l, p, opnum, -1); |