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