Ignore:
Timestamp:
Aug 16, 2003, 6:59:22 PM (22 years ago)
Author:
bird
Message:

binutils v2.14 - offical sources.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/GNU/src/binutils/opcodes/vax-dis.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* Print VAX instructions.
    2    Copyright 1995, 1998, 2000, 2001 Free Software Foundation, Inc.
     2   Copyright 1995, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
    33   Contributed by Pauline Middelink <middelin@polyware.iaf.nl>
    44
     
    2222
    2323/* Local function prototypes */
    24 static int
    25 print_insn_arg PARAMS ((const char *, unsigned char *, bfd_vma,
    26                         disassemble_info *));
    27 
    28 static int
    29 print_insn_mode PARAMS ((int, unsigned char *, bfd_vma, disassemble_info *));
     24static int fetch_data PARAMS ((struct disassemble_info *, bfd_byte *));
     25static int print_insn_arg
     26  PARAMS ((const char *, unsigned char *, bfd_vma, disassemble_info *));
     27static int print_insn_mode
     28  PARAMS ((const char *, int, unsigned char *, bfd_vma, disassemble_info *));
     29
    3030
    3131static char *reg_names[] =
     
    113113{
    114114  const struct vot *votp;
    115   const char *argp = NULL;
     115  const char *argp;
    116116  unsigned char *arg;
    117117  struct private priv;
     
    121121  priv.max_fetched = priv.the_buffer;
    122122  priv.insn_start = memaddr;
     123
    123124  if (setjmp (priv.bailout) != 0)
    124125    {
     
    127128    }
    128129
     130  argp = NULL;
    129131  /* Check if the info buffer has more than one byte left since
    130132     the last opcode might be a single byte with no argument data.  */
     
    222224    }
    223225
    224   return print_insn_mode (arg_len, p0, addr, info);
     226  return print_insn_mode (d, arg_len, p0, addr, info);
    225227}
    226228
    227229static int
    228 print_insn_mode (size, p0, addr, info)
     230print_insn_mode (d, size, p0, addr, info)
     231     const char *d;
    229232     int size;
    230233     unsigned char *p0;
     
    244247    case 0x20:
    245248    case 0x30: /* literal mode                  $number */
    246       (*info->fprintf_func) (info->stream, "$0x%x", mode);
     249      if (d[1] == 'd' || d[1] == 'f' || d[1] == 'g' || d[1] == 'h')
     250        (*info->fprintf_func) (info->stream, "$0x%x [%c-float]", mode, d[1]);
     251      else
     252        (*info->fprintf_func) (info->stream, "$0x%x", mode);
    247253      break;
    248254    case 0x40: /* index:                        base-addr[Rn] */
    249       p += print_insn_mode (size, p0 + 1, addr + 1, info);
     255      p += print_insn_mode (d, size, p0 + 1, addr + 1, info);
    250256      (*info->fprintf_func) (info->stream, "[%s]", reg_names[reg]);
    251257      break;
     
    266272          FETCH_DATA (info, p + size);
    267273          (*info->fprintf_func) (info->stream, "$0x");
    268           for (i = 0; i < size; i++)
    269             (*info->fprintf_func) (info->stream, "%02x", p[size - i - 1]);
     274          if (d[1] == 'd' || d[1] == 'f' || d[1] == 'g' || d[1] == 'h')
     275            {
     276              int float_word;
     277
     278              float_word = p[0] | (p[1] << 8);
     279              if ((d[1] == 'd' || d[1] == 'f')
     280                  && (float_word & 0xff80) == 0x8000)
     281                {
     282                  (*info->fprintf_func) (info->stream, "[invalid %c-float]",
     283                                         d[1]);
     284                }
     285              else
     286                {
     287                  for (i = 0; i < size; i++)
     288                    (*info->fprintf_func) (info->stream, "%02x",
     289                                           p[size - i - 1]);
     290                  (*info->fprintf_func) (info->stream, " [%c-float]", d[1]);
     291                }
     292            }
     293          else
     294            {
     295              for (i = 0; i < size; i++)
     296                (*info->fprintf_func) (info->stream, "%02x", p[size - i - 1]);
     297            }
    270298          p += size;
    271299        }
Note: See TracChangeset for help on using the changeset viewer.