xref: /openbsd-src/gnu/usr.bin/binutils/opcodes/arc-dis.h (revision 5f210c2af8ad7a823d98e333e3a6e3d7999783f5)
1*5f210c2aSfgsch /* Disassembler structures definitions for the ARC.
2*5f210c2aSfgsch    Copyright 1994, 1995, 1997, 1998, 2000, 2001
3*5f210c2aSfgsch    Free Software Foundation, Inc.
4*5f210c2aSfgsch    Contributed by Doug Evans (dje@cygnus.com).
5*5f210c2aSfgsch 
6*5f210c2aSfgsch    This program is free software; you can redistribute it and/or modify
7*5f210c2aSfgsch    it under the terms of the GNU General Public License as published by
8*5f210c2aSfgsch    the Free Software Foundation; either version 2 of the License, or
9*5f210c2aSfgsch    (at your option) any later version.
10*5f210c2aSfgsch 
11*5f210c2aSfgsch    This program is distributed in the hope that it will be useful,
12*5f210c2aSfgsch    but WITHOUT ANY WARRANTY; without even the implied warranty of
13*5f210c2aSfgsch    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14*5f210c2aSfgsch    GNU General Public License for more details.
15*5f210c2aSfgsch 
16*5f210c2aSfgsch    You should have received a copy of the GNU General Public License
17*5f210c2aSfgsch    along with this program; if not, write to the Free Software Foundation,
18*5f210c2aSfgsch    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
19*5f210c2aSfgsch 
20*5f210c2aSfgsch #ifndef ARCDIS_H
21*5f210c2aSfgsch #define ARCDIS_H
22*5f210c2aSfgsch 
23*5f210c2aSfgsch enum
24*5f210c2aSfgsch {
25*5f210c2aSfgsch   BR_exec_when_no_jump,
26*5f210c2aSfgsch   BR_exec_always,
27*5f210c2aSfgsch   BR_exec_when_jump
28*5f210c2aSfgsch };
29*5f210c2aSfgsch 
30*5f210c2aSfgsch enum Flow
31*5f210c2aSfgsch {
32*5f210c2aSfgsch   noflow,
33*5f210c2aSfgsch   direct_jump,
34*5f210c2aSfgsch   direct_call,
35*5f210c2aSfgsch   indirect_jump,
36*5f210c2aSfgsch   indirect_call,
37*5f210c2aSfgsch   invalid_instr
38*5f210c2aSfgsch };
39*5f210c2aSfgsch 
40*5f210c2aSfgsch enum { no_reg = 99 };
41*5f210c2aSfgsch enum { allOperandsSize = 256 };
42*5f210c2aSfgsch 
43*5f210c2aSfgsch struct arcDisState
44*5f210c2aSfgsch {
45*5f210c2aSfgsch   void *_this;
46*5f210c2aSfgsch   int instructionLen;
47*5f210c2aSfgsch   void (*err)(void*, const char*);
48*5f210c2aSfgsch   const char *(*coreRegName)(void*, int);
49*5f210c2aSfgsch   const char *(*auxRegName)(void*, int);
50*5f210c2aSfgsch   const char *(*condCodeName)(void*, int);
51*5f210c2aSfgsch   const char *(*instName)(void*, int, int, int*);
52*5f210c2aSfgsch 
53*5f210c2aSfgsch   unsigned char* instruction;
54*5f210c2aSfgsch   unsigned index;
55*5f210c2aSfgsch   const char *comm[6]; /* instr name, cond, NOP, 3 operands  */
56*5f210c2aSfgsch   int opWidth;
57*5f210c2aSfgsch   int targets[4];
58*5f210c2aSfgsch   int addresses[4];
59*5f210c2aSfgsch   /* Set as a side-effect of calling the disassembler.
60*5f210c2aSfgsch      Used only by the debugger.  */
61*5f210c2aSfgsch   enum Flow flow;
62*5f210c2aSfgsch   int register_for_indirect_jump;
63*5f210c2aSfgsch   int ea_reg1, ea_reg2, _offset;
64*5f210c2aSfgsch   int _cond, _opcode;
65*5f210c2aSfgsch   unsigned long words[2];
66*5f210c2aSfgsch   char *commentBuffer;
67*5f210c2aSfgsch   char instrBuffer[40];
68*5f210c2aSfgsch   char operandBuffer[allOperandsSize];
69*5f210c2aSfgsch   char _ea_present;
70*5f210c2aSfgsch   char _mem_load;
71*5f210c2aSfgsch   char _load_len;
72*5f210c2aSfgsch   char nullifyMode;
73*5f210c2aSfgsch   unsigned char commNum;
74*5f210c2aSfgsch   unsigned char isBranch;
75*5f210c2aSfgsch   unsigned char tcnt;
76*5f210c2aSfgsch   unsigned char acnt;
77*5f210c2aSfgsch };
78*5f210c2aSfgsch 
79*5f210c2aSfgsch #define __TRANSLATION_REQUIRED(state) ((state).acnt != 0)
80*5f210c2aSfgsch 
81*5f210c2aSfgsch #endif
82