Back to index

cell-binutils  2.17cvs20070401
arc-dis.h
Go to the documentation of this file.
00001 /* Disassembler structures definitions for the ARC.
00002    Copyright 1994, 1995, 1997, 1998, 2000, 2001
00003    Free Software Foundation, Inc.
00004    Contributed by Doug Evans (dje@cygnus.com).
00005 
00006    This program is free software; you can redistribute it and/or modify
00007    it under the terms of the GNU General Public License as published by
00008    the Free Software Foundation; either version 2 of the License, or
00009    (at your option) any later version.
00010 
00011    This program is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014    GNU General Public License for more details.
00015 
00016    You should have received a copy of the GNU General Public License
00017    along with this program; if not, write to the Free Software Foundation,
00018    Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00019 
00020 #ifndef ARCDIS_H
00021 #define ARCDIS_H
00022 
00023 enum 
00024 {
00025   BR_exec_when_no_jump,
00026   BR_exec_always,
00027   BR_exec_when_jump
00028 };
00029 
00030 enum Flow 
00031 {
00032   noflow,
00033   direct_jump,
00034   direct_call,
00035   indirect_jump,
00036   indirect_call,
00037   invalid_instr
00038 };
00039 
00040 enum { no_reg = 99 };
00041 enum { allOperandsSize = 256 };
00042 
00043 struct arcDisState 
00044 {
00045   void *_this;
00046   int instructionLen;
00047   void (*err)(void*, const char*);
00048   const char *(*coreRegName)(void*, int);
00049   const char *(*auxRegName)(void*, int);
00050   const char *(*condCodeName)(void*, int);
00051   const char *(*instName)(void*, int, int, int*);
00052   
00053   unsigned char* instruction;
00054   unsigned index;
00055   const char *comm[6]; /* instr name, cond, NOP, 3 operands  */
00056   int opWidth;
00057   int targets[4];
00058   int addresses[4];
00059   /* Set as a side-effect of calling the disassembler.
00060      Used only by the debugger.  */
00061   enum Flow flow;
00062   int register_for_indirect_jump;
00063   int ea_reg1, ea_reg2, _offset;
00064   int _cond, _opcode;
00065   unsigned long words[2];
00066   char *commentBuffer;
00067   char instrBuffer[40];
00068   char operandBuffer[allOperandsSize];
00069   char _ea_present;
00070   char _mem_load;
00071   char _load_len;
00072   char nullifyMode;
00073   unsigned char commNum;
00074   unsigned char isBranch;
00075   unsigned char tcnt;
00076   unsigned char acnt;
00077 };
00078 
00079 #define __TRANSLATION_REQUIRED(state) ((state).acnt != 0)
00080 
00081 #endif