OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [opcodes/] [disassemble.c] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 106 markom
/* Select disassembly routine for specified architecture.
2
   Copyright (C) 1994, 95, 96, 97, 98, 99, 2000
3
   Free Software Foundation, Inc.
4
 
5
This program is free software; you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation; either version 2 of the License, or
8
(at your option) any later version.
9
 
10
This program is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
GNU General Public License for more details.
14
 
15
You should have received a copy of the GNU General Public License
16
along with this program; if not, write to the Free Software
17
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
18
 
19
#include "ansidecl.h"
20
#include "dis-asm.h"
21
 
22
#ifdef ARCH_all
23
#define ARCH_or32
24
#define ARCH_or16
25
#define ARCH_a29k
26
#define ARCH_alpha
27
#define ARCH_arc
28
#define ARCH_arm
29
#define ARCH_avr
30
#define ARCH_d10v
31
#define ARCH_d30v
32
#define ARCH_h8300
33
#define ARCH_h8500
34
#define ARCH_hppa
35
#define ARCH_i370
36
#define ARCH_i386
37
#define ARCH_i960
38
#define ARCH_fr30
39
#define ARCH_m32r
40
#define ARCH_m68k
41
#define ARCH_m88k
42
#define ARCH_mcore
43
#define ARCH_mips
44
#define ARCH_mn10200
45
#define ARCH_mn10300
46
#define ARCH_ns32k
47
#define ARCH_pj
48
#define ARCH_powerpc
49
#define ARCH_rs6000
50
#define ARCH_sh
51
#define ARCH_sparc
52
#define ARCH_tic30
53
#define ARCH_tic80
54
#define ARCH_v850
55
#define ARCH_vax
56
#define ARCH_w65
57
#define ARCH_z8k
58
#endif
59
 
60
 
61
disassembler_ftype
62
disassembler (abfd)
63
     bfd *abfd;
64
{
65
  enum bfd_architecture a = bfd_get_arch (abfd);
66
  disassembler_ftype disassemble;
67
 
68
  switch (a)
69
    {
70
      /* If you add a case to this table, also add it to the
71
         ARCH_all definition right above this function.  */
72
#ifdef ARCH_a29k
73
    case bfd_arch_a29k:
74
      /* As far as I know we only handle big-endian 29k objects.  */
75
      disassemble = print_insn_big_a29k;
76
      break;
77
#endif
78
#ifdef ARCH_alpha
79
    case bfd_arch_alpha:
80
      disassemble = print_insn_alpha;
81
      break;
82
#endif
83
#ifdef ARCH_arc
84
    case bfd_arch_arc:
85
      {
86
        disassemble = arc_get_disassembler (bfd_get_mach (abfd),
87
                                            bfd_big_endian (abfd));
88
        break;
89
      }
90
#endif
91
#ifdef ARCH_arm
92
    case bfd_arch_arm:
93
      if (bfd_big_endian (abfd))
94
        disassemble = print_insn_big_arm;
95
      else
96
        disassemble = print_insn_little_arm;
97
      break;
98
#endif
99
#ifdef ARCH_avr
100
    case bfd_arch_avr:
101
      disassemble = print_insn_avr;
102
      break;
103
#endif
104
#ifdef ARCH_d10v
105
    case bfd_arch_d10v:
106
      disassemble = print_insn_d10v;
107
      break;
108
#endif
109
#ifdef ARCH_d30v
110
    case bfd_arch_d30v:
111
      disassemble = print_insn_d30v;
112
      break;
113
#endif
114
#ifdef ARCH_h8300
115
    case bfd_arch_h8300:
116
      if (bfd_get_mach(abfd) == bfd_mach_h8300h)
117
        disassemble = print_insn_h8300h;
118
      else if (bfd_get_mach(abfd) == bfd_mach_h8300s)
119
        disassemble = print_insn_h8300s;
120
      else
121
        disassemble = print_insn_h8300;
122
      break;
123
#endif
124
#ifdef ARCH_h8500
125
    case bfd_arch_h8500:
126
      disassemble = print_insn_h8500;
127
      break;
128
#endif
129
#ifdef ARCH_hppa
130
    case bfd_arch_hppa:
131
      disassemble = print_insn_hppa;
132
      break;
133
#endif
134
#ifdef ARCH_i370
135
    case bfd_arch_i370:
136
      disassemble = print_insn_i370;
137
      break;
138
#endif
139
#ifdef ARCH_i386
140
    case bfd_arch_i386:
141
      if (bfd_get_mach (abfd) == bfd_mach_i386_i386_intel_syntax)
142
        disassemble = print_insn_i386_intel;
143
      else
144
        disassemble = print_insn_i386_att;
145
      break;
146
#endif
147
#ifdef ARCH_i960
148
    case bfd_arch_i960:
149
      disassemble = print_insn_i960;
150
      break;
151
#endif
152
#ifdef ARCH_fr30
153
    case bfd_arch_fr30:
154
      disassemble = print_insn_fr30;
155
      break;
156
#endif
157
#ifdef ARCH_m32r
158
    case bfd_arch_m32r:
159
      disassemble = print_insn_m32r;
160
      break;
161
#endif
162
#ifdef ARCH_m68k
163
    case bfd_arch_m68k:
164
      disassemble = print_insn_m68k;
165
      break;
166
#endif
167
#ifdef ARCH_m88k
168
    case bfd_arch_m88k:
169
      disassemble = print_insn_m88k;
170
      break;
171
#endif
172
#ifdef ARCH_ns32k
173
    case bfd_arch_ns32k:
174
      disassemble = print_insn_ns32k;
175
      break;
176
#endif
177
#ifdef ARCH_mcore
178
    case bfd_arch_mcore:
179
      disassemble = print_insn_mcore;
180
      break;
181
#endif
182
#ifdef ARCH_mips
183
    case bfd_arch_mips:
184
      if (bfd_big_endian (abfd))
185
        disassemble = print_insn_big_mips;
186
      else
187
        disassemble = print_insn_little_mips;
188
      break;
189
#endif
190
#ifdef ARCH_mn10200
191
    case bfd_arch_mn10200:
192
      disassemble = print_insn_mn10200;
193
      break;
194
#endif
195
#ifdef ARCH_mn10300
196
    case bfd_arch_mn10300:
197
      disassemble = print_insn_mn10300;
198
      break;
199
#endif
200
#ifdef ARCH_or1k
201
    case bfd_arch_or1k:
202
      if (bfd_big_endian (abfd))
203
        disassemble = print_insn_big_or1k;
204
      else
205
        disassemble = print_insn_little_or1k;
206
      break;
207
#endif
208
#ifdef ARCH_or32
209
    case bfd_arch_or32:
210
      if (bfd_big_endian (abfd))
211
        disassemble = print_insn_big_or32;
212
      else
213
        disassemble = print_insn_little_or32;
214
      break;
215
#endif
216
#ifdef ARCH_or16
217
    case bfd_arch_or16:
218
      if (bfd_big_endian (abfd))
219
        disassemble = print_insn_big_or16;
220
      else
221
        disassemble = print_insn_little_or16;
222
      break;
223
#endif
224
#ifdef ARCH_pj
225
    case bfd_arch_pj:
226
      disassemble = print_insn_pj;
227
      break;
228
#endif
229
#ifdef ARCH_powerpc
230
    case bfd_arch_powerpc:
231
      if (bfd_big_endian (abfd))
232
        disassemble = print_insn_big_powerpc;
233
      else
234
        disassemble = print_insn_little_powerpc;
235
      break;
236
#endif
237
#ifdef ARCH_rs6000
238
    case bfd_arch_rs6000:
239
      disassemble = print_insn_rs6000;
240
      break;
241
#endif
242
#ifdef ARCH_sh
243
    case bfd_arch_sh:
244
      if (bfd_big_endian (abfd))
245
        disassemble = print_insn_sh;
246
      else
247
        disassemble = print_insn_shl;
248
      break;
249
#endif
250
#ifdef ARCH_sparc
251
    case bfd_arch_sparc:
252
      disassemble = print_insn_sparc;
253
      break;
254
#endif
255
#ifdef ARCH_tic30
256
    case bfd_arch_tic30:
257
      disassemble = print_insn_tic30;
258
      break;
259
#endif
260
#ifdef ARCH_tic80
261
    case bfd_arch_tic80:
262
      disassemble = print_insn_tic80;
263
      break;
264
#endif
265
#ifdef ARCH_v850
266
    case bfd_arch_v850:
267
      disassemble = print_insn_v850;
268
      break;
269
#endif
270
#ifdef ARCH_w65
271
    case bfd_arch_w65:
272
      disassemble = print_insn_w65;
273
      break;
274
#endif
275
#ifdef ARCH_z8k
276
    case bfd_arch_z8k:
277
      if (bfd_get_mach(abfd) == bfd_mach_z8001)
278
        disassemble = print_insn_z8001;
279
      else
280
        disassemble = print_insn_z8002;
281
      break;
282
#endif
283
#ifdef ARCH_vax
284
    case bfd_arch_vax:
285
      disassemble = print_insn_vax;
286
      break;
287
#endif
288
    default:
289
      return 0;
290
    }
291
  return disassemble;
292
}
293
 
294
void
295
disassembler_usage (stream)
296
     FILE *stream ATTRIBUTE_UNUSED;
297
{
298
#ifdef ARCH_arm
299
  print_arm_disassembler_options (stream);
300
#endif
301
 
302
  return;
303
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.