source: trunk/src/binutils/opcodes/xtensa-dis.c@ 1917

Last change on this file since 1917 was 607, checked in by bird, 22 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 13.9 KB
Line 
1/* xtensa-dis.c. Disassembly functions for Xtensa.
2 Copyright 2003 Free Software Foundation, Inc.
3 Contributed by Bob Wilson at Tensilica, Inc. ([email protected])
4
5 This file is part of GDB, GAS, and the GNU binutils.
6
7 GDB, GAS, and the GNU binutils are free software; you can redistribute
8 them and/or modify them under the terms of the GNU General Public
9 License as published by the Free Software Foundation; either version 2,
10 or (at your option) any later version.
11
12 GDB, GAS, and the GNU binutils are distributed in the hope that they
13 will be useful, but WITHOUT ANY WARRANTY; without even the implied
14 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
15 the GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License along
18 with this file; see the file COPYING. If not, write to the Free
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
20 USA. */
21
22#include <stdlib.h>
23#include <stdio.h>
24#include <sys/types.h>
25#include <string.h>
26#include "xtensa-isa.h"
27#include "ansidecl.h"
28#include "sysdep.h"
29#include "dis-asm.h"
30
31#include <setjmp.h>
32
33#ifndef MAX
34#define MAX(a,b) (a > b ? a : b)
35#endif
36
37static char* state_names[256] =
38{
39 "lbeg", /* 0 */
40 "lend", /* 1 */
41 "lcount", /* 2 */
42 "sar", /* 3 */
43 "br", /* 4 */
44
45 "reserved_5", /* 5 */
46 "reserved_6", /* 6 */
47 "reserved_7", /* 7 */
48
49 "av", /* 8 */
50 "avh", /* 9 */
51 "bv", /* 10 */
52 "sav", /* 11 */
53 "scompare1", /* 12 */
54
55 "reserved_13", /* 13 */
56 "reserved_14", /* 14 */
57 "reserved_15", /* 15 */
58
59 "acclo", /* 16 */
60 "acchi", /* 17 */
61
62 "reserved_18", /* 18 */
63 "reserved_19", /* 19 */
64 "reserved_20", /* 20 */
65 "reserved_21", /* 21 */
66 "reserved_22", /* 22 */
67 "reserved_23", /* 23 */
68 "reserved_24", /* 24 */
69 "reserved_25", /* 25 */
70 "reserved_26", /* 26 */
71 "reserved_27", /* 27 */
72 "reserved_28", /* 28 */
73 "reserved_29", /* 29 */
74 "reserved_30", /* 30 */
75 "reserved_31", /* 31 */
76
77 "mr0", /* 32 */
78 "mr1", /* 33 */
79 "mr2", /* 34 */
80 "mr3", /* 35 */
81
82 "reserved_36", /* 36 */
83 "reserved_37", /* 37 */
84 "reserved_38", /* 38 */
85 "reserved_39", /* 39 */
86 "reserved_40", /* 40 */
87 "reserved_41", /* 41 */
88 "reserved_42", /* 42 */
89 "reserved_43", /* 43 */
90 "reserved_44", /* 44 */
91 "reserved_45", /* 45 */
92 "reserved_46", /* 46 */
93 "reserved_47", /* 47 */
94 "reserved_48", /* 48 */
95 "reserved_49", /* 49 */
96 "reserved_50", /* 50 */
97 "reserved_51", /* 51 */
98 "reserved_52", /* 52 */
99 "reserved_53", /* 53 */
100 "reserved_54", /* 54 */
101 "reserved_55", /* 55 */
102 "reserved_56", /* 56 */
103 "reserved_57", /* 57 */
104 "reserved_58", /* 58 */
105 "reserved_59", /* 59 */
106 "reserved_60", /* 60 */
107 "reserved_61", /* 61 */
108 "reserved_62", /* 62 */
109 "reserved_63", /* 63 */
110
111 "reserved_64", /* 64 */
112 "reserved_65", /* 65 */
113 "reserved_66", /* 66 */
114 "reserved_67", /* 67 */
115 "reserved_68", /* 68 */
116 "reserved_69", /* 69 */
117 "reserved_70", /* 70 */
118 "reserved_71", /* 71 */
119
120 "wb", /* 72 */
121 "ws", /* 73 */