Changeset 609 for branches/GNU/src/binutils/opcodes/h8300-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/h8300-dis.c
-
Property cvs2svn:cvs-rev
changed from
1.1
to1.1.1.2
r608 r609 1 1 /* Disassemble h8300 instructions. 2 Copyright 1993, 1994, 1996, 1998, 2000 Free Software Foundation, Inc. 2 Copyright 1993, 1994, 1996, 1998, 2000, 2001, 2002 3 Free Software Foundation, Inc. 3 4 4 5 This program is free software; you can redistribute it and/or modify … … 23 24 #include "dis-asm.h" 24 25 #include "opintl.h" 26 #include "libiberty.h" 27 28 struct h8_instruction 29 { 30 int length; 31 const struct h8_opcode *opcode; 32 }; 33 34 struct h8_instruction *h8_instructions; 35 36 static void bfd_h8_disassemble_init PARAMS ((void)); 37 static unsigned int bfd_h8_disassemble 38 PARAMS ((bfd_vma, disassemble_info *, int)); 25 39 26 40 /* Run through the opcodes and sort them into order to make them easy … … 30 44 { 31 45 unsigned int i; 32 struct h8_opcode *p; 33 34 for (p = h8_opcodes; p->name; p++) 46 unsigned int nopcodes; 47 const struct h8_opcode *p; 48 struct h8_instruction *pi; 49 50 nopcodes = sizeof (h8_opcodes) / sizeof (struct h8_opcode); 51 52 h8_instructions = (struct h8_instruction *) 53 xmalloc (nopcodes * sizeof (struct h8_instruction)); 54 55 for (p = h8_opcodes, pi = h8_instructions; p->name; p++, pi++) 35 56 { 36 57 int n1 = 0; … … 55 76 abort (); 56 77 57 p->length = i / 2; 78 pi->length = i / 2; 79 pi->opcode = p; 58 80 } 81 82 /* Add entry for the NULL vector terminator. */ 83 pi->length = 0; 84 pi->opcode = p; 59 85 } 60 86 61 unsigned int87 static unsigned int 62 88 bfd_h8_disassemble (addr, info, mode) 63 89 bfd_vma addr; … … 66 92 { 67 93 /* Find the first entry in the table for this opcode. */ 68 static CONSTchar *regnames[] =94 static const char *regnames[] = 69 95 { 70 96 "r0h", "r1h", "r2h", "r3h", "r4h", "r5h", "r6h", "r7h", 71 97 "r0l", "r1l", "r2l", "r3l", "r4l", "r5l", "r6l", "r7l" 72 98 }; 73 static CONSTchar *wregnames[] =99 static const char *wregnames[] = 74 100 { 75 101 "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", 76 102 "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7" 77 103 }; 78 static CONSTchar *lregnames[] =104 static const char *lregnames[] = 79 105 { 80 106 "er0", "er1", "er2", "er3", "er4", "er5", "er6", "er7", … … 87 113 int bit = 0; 88 114 int plen = 0; 89 static b oolean init = 0;90 struct h8_opcode *q;91 char CONST**pregnames = mode != 0 ? lregnames : wregnames;115 static bfd_boolean init = 0; 116 const struct h8_instruction *qi; 117 char const **pregnames = mode != 0 ? lregnames : wregnames; 92 118 int status; 93 119 int l; … … 113 139 114 140 /* Find the exact opcode/arg combo. */ 115 for (q = h8_opcodes; q->name; q++) 116 { 141 for (qi = h8_instructions; qi->opcode->name; qi++) 142 { 143 const struct h8_opcode *q = qi->opcode; 117 144 op_type *nib = q->data.nib; 118 145 unsigned int len = 0; … … 243 270 int i; 244 271 245 for (i = 0; i < q ->length; i++)272 for (i = 0; i < qi->length; i++) 246 273 fprintf (stream, "%02x ", data[i]); 247 274 … … 260 287 261 288 fprintf (stream, "@sp+,er%d-er%d", high - count, high); 262 return q ->length;289 return qi->length; 263 290 } 264 291 … … 271 298 272 299 fprintf (stream, "er%d-er%d,@-sp", low, low + count); 273 return q ->length;300 return qi->length; 274 301 } 275 302 … … 385 412 } 386 413 387 return q ->length;414 return qi->length; 388 415 } 389 416 else -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.