Fixed bug in assembler: incorrect offset of far symbols in LUI instruction.

Added .gitignore files for most subdirs.
This commit is contained in:
Sergey
2014-04-18 01:12:49 -07:00
parent 5c4efd1e44
commit d404fca13a
133 changed files with 478 additions and 2 deletions

View File

@@ -1278,7 +1278,7 @@ void emit_la (opcode, relinfo)
register unsigned opcode;
register struct reloc *relinfo;
{
register unsigned value;
register unsigned value, hi;
int cval, segment;
if (getlex (&cval) != ',')
@@ -1297,7 +1297,8 @@ void emit_la (opcode, relinfo)
* addiu d, d, %lo(value) */
relinfo->flags |= RHIGH16S;
relinfo->offset = value & 0xffff;
emitword (opcode | 0x3c000000 | (value >> 16), relinfo, (value + 0x8000) >> 16);
hi = (value + 0x8000) >> 16;
emitword (opcode | 0x3c000000 | hi, relinfo, hi);
relinfo->flags &= ~RHIGH16S;
opcode |= 0x24000000 | (opcode & 0x1f0000) << 5 | (value & 0xffff);