comparison lwasm/output.c @ 204:048ebb85f6ef

Added 8 bit external references for base page addressing mode
author lost
date Sun, 29 Mar 2009 14:52:28 +0000
parents 427e268e876b
children bae1e3ecdce1
comparison
equal deleted inserted replaced
203:2c1afbdb2de0 204:048ebb85f6ef
255 l -> sect -> rl = re; 255 l -> sect -> rl = re;
256 256
257 re -> offset = l -> codeaddr + l -> relocoff; 257 re -> offset = l -> codeaddr + l -> relocoff;
258 re -> expr = l -> exprs[0]; 258 re -> expr = l -> exprs[0];
259 re -> context = l -> context; 259 re -> context = l -> context;
260 re -> relocsize = 2;
261 if (l -> reloc8bit)
262 re -> relocsize = 1;
260 } 263 }
261 } 264 }
262 } 265 }
263 266
264 // run through the sections 267 // run through the sections
329 continue; 332 continue;
330 } 333 }
331 334
332 // work through each term in the expression and output 335 // work through each term in the expression and output
333 // the proper equivalent to the object file 336 // the proper equivalent to the object file
337 if (re -> relocsize == 1)
338 {
339 // flag an 8 bit relocation (low 8 bits will be used)
340 buf[0] = 0xFF;
341 buf[1] = 0x01;
342 writebytes(buf, 2, 1, of);
343 }
334 for (sn = re -> expr -> head; sn; sn = sn -> next) 344 for (sn = re -> expr -> head; sn; sn = sn -> next)
335 { 345 {
336 switch (sn -> term -> term_type) 346 switch (sn -> term -> term_type)
337 { 347 {
338 case LWASM_TERM_OPER: 348 case LWASM_TERM_OPER: