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/alpha-dis.c

    • Property cvs2svn:cvs-rev changed from 1.1 to 1.1.1.2
    r608 r609  
    11/* alpha-dis.c -- Disassemble Alpha AXP instructions
    2    Copyright 1996, 1998, 1999, 2000 Free Software Foundation, Inc.
     2   Copyright 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
    33   Contributed by Richard Henderson <rth@tamu.edu>,
    44   patterned after the PPC opcode handling written by Ian Lance Taylor.
     
    2828/* OSF register names.  */
    2929
    30 static const char * const osf_regnames[64] =
    31 {
     30static const char * const osf_regnames[64] = {
    3231  "v0", "t0", "t1", "t2", "t3", "t4", "t5", "t6",
    3332  "t7", "s0", "s1", "s2", "s3", "s4", "s5", "fp",
     
    4241/* VMS register names.  */
    4342
    44 static const char * const vms_regnames[64] =
    45 {
     43static const char * const vms_regnames[64] = {
    4644  "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7",
    4745  "R8", "R9", "R10", "R11", "R12", "R13", "R14", "R15",
     
    7573
    7674      for (op = 0; op < AXP_NOPS; ++op)
    77         {
    78           opcode_index[op] = opcode;
    79           while (opcode < opcode_end && op == AXP_OP (opcode->opcode))
     75        {
     76          opcode_index[op] = opcode;
     77          while (opcode < opcode_end && op == AXP_OP (opcode->opcode))
    8078            ++opcode;
    81         }
     79        }
    8280      opcode_index[op] = opcode;
    8381    }
     
    108106    if (status != 0)
    109107      {
    110         (*info->memory_error_func) (status, memaddr, info);
    111         return -1;
     108        (*info->memory_error_func) (status, memaddr, info);
     109        return -1;
    112110      }
    113111    insn = bfd_getl32 (buffer);
     
    118116
    119117  /* Find the first match in the opcode table.  */
    120   opcode_end = opcode_index[op+1];
     118  opcode_end = opcode_index[op + 1];
    121119  for (opcode = opcode_index[op]; opcode < opcode_end; ++opcode)
    122120    {
    123       if ((insn & opcode->mask) != opcode->opcode)
     121      if ((insn ^ opcode->opcode) & opcode->mask)
    124122        continue;
    125123
     
    131129         instruction is valid.  */
    132130      {
    133         int invalid = 0;
    134         for (opindex = opcode->operands; *opindex != 0; opindex++)
     131        int invalid = 0;
     132        for (opindex = opcode->operands; *opindex != 0; opindex++)
    135133          {
    136             const struct alpha_operand *operand = alpha_operands + *opindex;
     134            const struct alpha_operand *operand = alpha_operands + *opindex;
    137135            if (operand->extract)
    138136              (*operand->extract) (insn, &invalid);
    139137          }
    140         if (invalid)
     138        if (invalid)
    141139          continue;
    142140      }
     
    148146  /* No instruction found */
    149147  (*info->fprintf_func) (info->stream, ".long %#08x", insn);
    150    
     148
    151149  return 4;
    152150
     
    183181
    184182      if (need_comma &&
    185           ((operand->flags & (AXP_OPERAND_PARENS|AXP_OPERAND_COMMA))
     183          ((operand->flags & (AXP_OPERAND_PARENS | AXP_OPERAND_COMMA))
    186184           != AXP_OPERAND_PARENS))
    187185        {
     
    195193        (*info->fprintf_func) (info->stream, "%s", regnames[value]);
    196194      else if (operand->flags & AXP_OPERAND_FPR)
    197         (*info->fprintf_func) (info->stream, "%s", regnames[value+32]);
     195        (*info->fprintf_func) (info->stream, "%s", regnames[value + 32]);
    198196      else if (operand->flags & AXP_OPERAND_RELATIVE)
    199197        (*info->print_address_func) (memaddr + 4 + value, info);
Note: See TracChangeset for help on using the changeset viewer.