Changeset 609 for branches/GNU/src/binutils/opcodes/alpha-dis.c
- Timestamp:
- Aug 16, 2003, 6:59:22 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/binutils/opcodes/alpha-dis.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* 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. 3 3 Contributed by Richard Henderson <rth@tamu.edu>, 4 4 patterned after the PPC opcode handling written by Ian Lance Taylor. … … 28 28 /* OSF register names. */ 29 29 30 static const char * const osf_regnames[64] = 31 { 30 static const char * const osf_regnames[64] = { 32 31 "v0", "t0", "t1", "t2", "t3", "t4", "t5", "t6", 33 32 "t7", "s0", "s1", "s2", "s3", "s4", "s5", "fp", … … 42 41 /* VMS register names. */ 43 42 44 static const char * const vms_regnames[64] = 45 { 43 static const char * const vms_regnames[64] = { 46 44 "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", 47 45 "R8", "R9", "R10", "R11", "R12", "R13", "R14", "R15", … … 75 73 76 74 for (op = 0; op < AXP_NOPS; ++op) 77 78 79 75 { 76 opcode_index[op] = opcode; 77 while (opcode < opcode_end && op == AXP_OP (opcode->opcode)) 80 78 ++opcode; 81 79 } 82 80 opcode_index[op] = opcode; 83 81 } … … 108 106 if (status != 0) 109 107 { 110 111 108 (*info->memory_error_func) (status, memaddr, info); 109 return -1; 112 110 } 113 111 insn = bfd_getl32 (buffer); … … 118 116 119 117 /* Find the first match in the opcode table. */ 120 opcode_end = opcode_index[op +1];118 opcode_end = opcode_index[op + 1]; 121 119 for (opcode = opcode_index[op]; opcode < opcode_end; ++opcode) 122 120 { 123 if ((insn & opcode->mask) != opcode->opcode)121 if ((insn ^ opcode->opcode) & opcode->mask) 124 122 continue; 125 123 … … 131 129 instruction is valid. */ 132 130 { 133 134 131 int invalid = 0; 132 for (opindex = opcode->operands; *opindex != 0; opindex++) 135 133 { 136 134 const struct alpha_operand *operand = alpha_operands + *opindex; 137 135 if (operand->extract) 138 136 (*operand->extract) (insn, &invalid); 139 137 } 140 138 if (invalid) 141 139 continue; 142 140 } … … 148 146 /* No instruction found */ 149 147 (*info->fprintf_func) (info->stream, ".long %#08x", insn); 150 148 151 149 return 4; 152 150 … … 183 181 184 182 if (need_comma && 185 ((operand->flags & (AXP_OPERAND_PARENS |AXP_OPERAND_COMMA))183 ((operand->flags & (AXP_OPERAND_PARENS | AXP_OPERAND_COMMA)) 186 184 != AXP_OPERAND_PARENS)) 187 185 { … … 195 193 (*info->fprintf_func) (info->stream, "%s", regnames[value]); 196 194 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]); 198 196 else if (operand->flags & AXP_OPERAND_RELATIVE) 199 197 (*info->print_address_func) (memaddr + 4 + value, info); -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.