diff options
author | Jeff Law <law@redhat.com> | 1996-08-30 06:44:44 +0000 |
---|---|---|
committer | Jeff Law <law@redhat.com> | 1996-08-30 06:44:44 +0000 |
commit | 05631de266b88fd3b0bb730b5642e33b54490bce (patch) | |
tree | b1099d62556e179949d8b2ca87f782ffdbaf53dd /gas | |
parent | 1f17971deec38c40028180bf6ddee1a2f0d76a61 (diff) | |
download | fsf-binutils-gdb-05631de266b88fd3b0bb730b5642e33b54490bce.zip fsf-binutils-gdb-05631de266b88fd3b0bb730b5642e33b54490bce.tar.gz fsf-binutils-gdb-05631de266b88fd3b0bb730b5642e33b54490bce.tar.bz2 |
* config/tc-850.c (md_assemble): Handle hi() correctly. Handle
hi0() too.
Bugfix.
Diffstat (limited to 'gas')
-rw-r--r-- | gas/ChangeLog | 12 | ||||
-rw-r--r-- | gas/config/tc-v850.c | 41 |
2 files changed, 48 insertions, 5 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 4f636b7..db3dd1d 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 <hunt@pizza.cygnus.com> diff --git a/gas/config/tc-v850.c b/gas/config/tc-v850.c index f738a11..007385d 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) |