diff --git a/gas/ChangeLog b/gas/ChangeLog index 4f636b7293..db3dd1d866 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,15 @@ +start-sanitize-v850 +Fri Aug 30 00:44:13 1996 Jeffrey A Law (law@cygnus.com) + + * config/tc-850.c (md_assemble): Handle hi() correctly. Handle + hi0() too. + +Wed Aug 28 23:11:08 1996 Jeffrey A Law (law@cygnus.com) + + * config/tc-v850.c (md_begin): Deal with end of opcode + table marker. + +end-sanitize-v850 start-sanitize-d10v Wed Aug 28 19:20:04 1996 Martin M. Hunt diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c index f738a113bd..007385d80d 100644 --- a/gas/config/tc-v850.c +++ b/gas/config/tc-v850.c @@ -448,15 +448,14 @@ md_begin () the first opcode with a particular name in the opcode table. */ op = v850_opcodes; - op_end = v850_opcodes + v850_num_opcodes; - - for (; op < op_end; op++) + while (op->name) { if (strcmp (prev_name, op->name)) { prev_name = (char *) op->name; hash_insert (v850_hash, op->name, (char *) op); } + op++; } } @@ -598,7 +597,7 @@ md_assemble (str) } if (ex.X_op == O_constant) - ex.X_add_number &= 0xffff; + ex.X_add_number = (signed)((ex.X_add_number & 0xffff) << 16) >> 16; else { if (fc > MAX_INSN_FIXUPS) @@ -622,7 +621,39 @@ md_assemble (str) } if (ex.X_op == O_constant) - ex.X_add_number = (ex.X_add_number >> 16) & 0xffff; + { + unsigned long temp = ex.X_add_number; + ex.X_add_number = (signed)(temp & 0xffff0000) >> 16; + + /* If the would be on for the low part, then we have + to add it into the high part. */ + if (temp & 0x8000) + ex.X_add_number += 1; + } + else + { + if (fc > MAX_INSN_FIXUPS) + as_fatal ("too many fixups"); + + fixups[fc].exp = ex; + fixups[fc].opindex = *opindex_ptr; + fixups[fc].reloc = BFD_RELOC_HI16_S; + fc++; + } + } + else if (strncmp(input_line_pointer, "hi0(", 4) == 0) + { + input_line_pointer += 4; + expression(&ex); + + if (*input_line_pointer++ != ')') + { + errmsg = "syntax error: expected `)'"; + goto error; + } + + if (ex.X_op == O_constant) + ex.X_add_number = (signed)(ex.X_add_number & 0xffff0000) >> 16; else { if (fc > MAX_INSN_FIXUPS)