- op_type *args = q->args.nib;
- int hadone = 0;
- while (*args != E) {
- if (hadone)
- fprintf(stream, ",");
- switch ((int)(*args) & ~((int)B30|(int)B31)) {
- case IMM16:
- case IMM8:
- case IMM3:
- fprintf(stream, "#0x%x", (unsigned)abs); break;
- case RD8:
- fprintf(stream, "%s", regnames[rd]); break;
- case RS8:
- fprintf(stream, "%s",regnames[rs]); break;
- case RD16:
- fprintf(stream, "r%d", rd& 0x7); break;
- case RS16:
- fprintf(stream, "r%d", rs & 0x7); break;
- case RSINC:
- fprintf(stream, "@r%d+", rs & 0x7); break;
- case RDDEC:
- fprintf(stream, "@-r%d", rd & 0x7); break;
- case RDIND:
- fprintf(stream, "@r%d", rd & 0x7); break;
- case RSIND:
- fprintf(stream, "@r%d",rs & 0x7); break;
- case ABS8SRC:
- case ABS16SRC:
- case ABS16DST:
- case ABS8DST:
- fprintf(stream, "@0x%x", (unsigned)abs); break;
- case DISP8:
- fprintf(stream, ".%s%d (%x)",(char)abs>0 ? "+" :"", (char)abs,
- addr + (char)abs);
- break;
- case DISPSRC:
- case DISPDST:
- fprintf(stream, "@(0x%x,r%d)", abs, rdisp & 0x7); break;
- case CCR:
- fprintf(stream, "ccr"); break;
- case KBIT:
- fprintf(stream, "#%d",abs); break;
- default:
- abort();
- }
- hadone = 1;
- args++;
- }
- }
- return q->length;
-}
-
-
-
-unsigned int DEFUN(print_insn_h8300,(addr, data, file),
-bfd_vma addr AND
-CONST char *data AND
-PTR file)
-{
- static boolean init;
- if (!init) {
- bfd_h8_disassemble_init();
- init= 1;
- }
-
- return bfd_h8_disassemble(addr, (bfd_byte *)data, file);
-}
-
-/*
-Relocations for the H8
-
-*/
-static bfd_reloc_status_type
-DEFUN(howto16_callback,(abfd, reloc_entry, symbol_in, data, ignore_input_section),
-bfd *abfd AND
-arelent *reloc_entry AND
-asymbol *symbol_in AND
-unsigned char *data AND
-asection *ignore_input_section)
-{
- long relocation = 0;
- bfd_vma addr = reloc_entry->address;
- long x = bfd_get_16(abfd, (bfd_byte *)data + addr);
-
- HOWTO_PREPARE(relocation, symbol_in);