Back to index

cell-binutils  2.17cvs20070401
mn10200.h
Go to the documentation of this file.
00001 /* mn10200.h -- Header file for Matsushita 10200 opcode table
00002    Copyright 1996, 1997 Free Software Foundation, Inc.
00003    Written by Jeff Law, Cygnus Support
00004 
00005 This file is part of GDB, GAS, and the GNU binutils.
00006 
00007 GDB, GAS, and the GNU binutils are free software; you can redistribute
00008 them and/or modify them under the terms of the GNU General Public
00009 License as published by the Free Software Foundation; either version
00010 1, or (at your option) any later version.
00011 
00012 GDB, GAS, and the GNU binutils are distributed in the hope that they
00013 will be useful, but WITHOUT ANY WARRANTY; without even the implied
00014 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
00015 the GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with this file; see the file COPYING.  If not, write to the Free
00019 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
00020 
00021 #ifndef MN10200_H
00022 #define MN10200_H
00023 
00024 /* The opcode table is an array of struct mn10200_opcode.  */
00025 
00026 struct mn10200_opcode
00027 {
00028   /* The opcode name.  */
00029   const char *name;
00030 
00031   /* The opcode itself.  Those bits which will be filled in with
00032      operands are zeroes.  */
00033   unsigned long opcode;
00034 
00035   /* The opcode mask.  This is used by the disassembler.  This is a
00036      mask containing ones indicating those bits which must match the
00037      opcode field, and zeroes indicating those bits which need not
00038      match (and are presumably filled in by operands).  */
00039   unsigned long mask;
00040 
00041   /* The format of this opcode.  */
00042   unsigned char format;
00043 
00044   /* An array of operand codes.  Each code is an index into the
00045      operand table.  They appear in the order which the operands must
00046      appear in assembly code, and are terminated by a zero.  */
00047   unsigned char operands[8];
00048 };
00049 
00050 /* The table itself is sorted by major opcode number, and is otherwise
00051    in the order in which the disassembler should consider
00052    instructions.  */
00053 extern const struct mn10200_opcode mn10200_opcodes[];
00054 extern const int mn10200_num_opcodes;
00055 
00056 
00057 /* The operands table is an array of struct mn10200_operand.  */
00058 
00059 struct mn10200_operand
00060 {
00061   /* The number of bits in the operand.  */
00062   int bits;
00063 
00064   /* How far the operand is left shifted in the instruction.  */
00065   int shift;
00066 
00067   /* One bit syntax flags.  */
00068   int flags;
00069 };
00070 
00071 /* Elements in the table are retrieved by indexing with values from
00072    the operands field of the mn10200_opcodes table.  */
00073 
00074 extern const struct mn10200_operand mn10200_operands[];
00075 
00076 /* Values defined for the flags field of a struct mn10200_operand.  */
00077 #define MN10200_OPERAND_DREG 0x1
00078 
00079 #define MN10200_OPERAND_AREG 0x2
00080 
00081 #define MN10200_OPERAND_PSW 0x4
00082 
00083 #define MN10200_OPERAND_MDR 0x8
00084 
00085 #define MN10200_OPERAND_SIGNED 0x10
00086 
00087 #define MN10200_OPERAND_PROMOTE 0x20
00088 
00089 #define MN10200_OPERAND_PAREN 0x40
00090 
00091 #define MN10200_OPERAND_REPEATED 0x80
00092 
00093 #define MN10200_OPERAND_EXTENDED 0x100
00094 
00095 #define MN10200_OPERAND_NOCHECK 0x200
00096 
00097 #define MN10200_OPERAND_PCREL 0x400
00098 
00099 #define MN10200_OPERAND_MEMADDR 0x800
00100 
00101 #define MN10200_OPERAND_RELAX 0x1000
00102 
00103 #define FMT_1 1
00104 #define FMT_2 2
00105 #define FMT_3 3
00106 #define FMT_4 4
00107 #define FMT_5 5
00108 #define FMT_6 6
00109 #define FMT_7 7
00110 #endif /* MN10200_H */