Changeset 609 for branches/GNU/src/binutils/opcodes/avr-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/avr-dis.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 22 22 #include "dis-asm.h" 23 23 #include "opintl.h" 24 24 #include "libiberty.h" 25 25 26 26 struct avr_opcodes_s … … 32 32 int isa; 33 33 unsigned int bin_opcode; 34 unsigned int bin_mask;35 34 }; 36 35 37 36 #define AVR_INSN(NAME, CONSTR, OPCODE, SIZE, ISA, BIN) \ 38 {#NAME, CONSTR, OPCODE, SIZE, ISA, BIN , 0},39 40 struct avr_opcodes_s avr_opcodes[] =37 {#NAME, CONSTR, OPCODE, SIZE, ISA, BIN}, 38 39 const struct avr_opcodes_s avr_opcodes[] = 41 40 { 42 41 #include "opcode/avr.h" 43 {NULL, NULL, NULL, 0, 0, 0 , 0}42 {NULL, NULL, NULL, 0, 0, 0} 44 43 }; 45 44 … … 258 257 { 259 258 unsigned int insn, insn2; 260 struct avr_opcodes_s *opcode; 259 const struct avr_opcodes_s *opcode; 260 static unsigned int *maskptr; 261 261 void *stream = info->stream; 262 262 fprintf_ftype prin = info->fprintf_func; 263 static unsigned int *avr_bin_masks; 263 264 static int initialized; 264 265 int cmd_len = 2; … … 268 269 if (!initialized) 269 270 { 270 initialized = 1; 271 272 for (opcode = avr_opcodes; opcode->name; opcode++) 271 unsigned int nopcodes; 272 273 nopcodes = sizeof (avr_opcodes) / sizeof (struct avr_opcodes_s); 274 275 avr_bin_masks = (unsigned int *) 276 xmalloc (nopcodes * sizeof (unsigned int)); 277 278 for (opcode = avr_opcodes, maskptr = avr_bin_masks; 279 opcode->name; 280 opcode++, maskptr++) 273 281 { 274 282 char * s; … … 285 293 assert (s - opcode->opcode == 16); 286 294 assert (opcode->bin_opcode == bin); 287 opcode->bin_mask= mask;295 *maskptr = mask; 288 296 } 297 298 initialized = 1; 289 299 } 290 300 291 301 insn = avrdis_opcode (addr, info); 292 302 293 for (opcode = avr_opcodes; opcode->name; opcode++) 294 { 295 if ((insn & opcode->bin_mask) == opcode->bin_opcode) 303 for (opcode = avr_opcodes, maskptr = avr_bin_masks; 304 opcode->name; 305 opcode++, maskptr++) 306 { 307 if ((insn & *maskptr) == opcode->bin_opcode) 296 308 break; 297 309 } -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.