Mercurial > hg-old > index.cgi
diff 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 |
line wrap: on
line diff
--- a/lwasm/output.c Sun Mar 22 22:11:12 2009 +0000 +++ b/lwasm/output.c Sun Mar 29 14:52:28 2009 +0000 @@ -257,6 +257,9 @@ re -> offset = l -> codeaddr + l -> relocoff; re -> expr = l -> exprs[0]; re -> context = l -> context; + re -> relocsize = 2; + if (l -> reloc8bit) + re -> relocsize = 1; } } } @@ -331,6 +334,13 @@ // work through each term in the expression and output // the proper equivalent to the object file + if (re -> relocsize == 1) + { + // flag an 8 bit relocation (low 8 bits will be used) + buf[0] = 0xFF; + buf[1] = 0x01; + writebytes(buf, 2, 1, of); + } for (sn = re -> expr -> head; sn; sn = sn -> next) { switch (sn -> term -> term_type)