/* Disassembler code for CRIS.
- Copyright (C) 2000 Free Software Foundation, Inc.
+ Copyright 2000, 2001 Free Software Foundation, Inc.
Contributed by Axis Communications AB, Lund, Sweden.
Written by Hans-Peter Nilsson.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
-Software Foundation; either version 2 of the License, or (at your option)
+Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
PARAMS ((bfd_vma, disassemble_info *));
static int print_insn_cris_without_register_prefix
PARAMS ((bfd_vma, disassemble_info *));
+static const struct cris_opcode *get_opcode_entry
+ PARAMS ((unsigned int, unsigned int));
/* Return the descriptor of a special register.
FIXME: Depend on a CPU-version specific argument when all machinery
{
int bits;
- for (bits = 0; val != 0; val &= val-1)
+ for (bits = 0; val != 0; val &= val - 1)
bits++;
return bits;
int prefix_ok = 0;
const char *s;
- for (s = cs; *s; s++)
+ for (s = cs; *s; s++)
switch (*s)
{
case '!':
bytes; stacked prefixes will not be expanded. */
unsigned char buffer[MAX_BYTES_PER_CRIS_INSN];
unsigned char *bufp;
- int status;
+ int status = 0;
bfd_vma addr;
/* There will be an "out of range" error after the last instruction.
cris_get_disassembler (abfd)
bfd *abfd;
{
- if (bfd_get_symbol_leading_char (abfd) == 0)
+ /* If there's no bfd in sight, we return what is valid as input in all
+ contexts if fed back to the assembler: disassembly *with* register
+ prefix. */
+ if (abfd == NULL || bfd_get_symbol_leading_char (abfd) == 0)
return print_insn_cris_with_register_prefix;
return print_insn_cris_without_register_prefix;