xref: /openbsd-src/gnu/usr.bin/binutils-2.17/include/opcode/mn10200.h (revision 3d8817e467ea46cf4772788d6804dd293abfb01a)
1*3d8817e4Smiod /* mn10200.h -- Header file for Matsushita 10200 opcode table
2*3d8817e4Smiod    Copyright 1996, 1997 Free Software Foundation, Inc.
3*3d8817e4Smiod    Written by Jeff Law, Cygnus Support
4*3d8817e4Smiod 
5*3d8817e4Smiod This file is part of GDB, GAS, and the GNU binutils.
6*3d8817e4Smiod 
7*3d8817e4Smiod GDB, GAS, and the GNU binutils are free software; you can redistribute
8*3d8817e4Smiod them and/or modify them under the terms of the GNU General Public
9*3d8817e4Smiod License as published by the Free Software Foundation; either version
10*3d8817e4Smiod 1, or (at your option) any later version.
11*3d8817e4Smiod 
12*3d8817e4Smiod GDB, GAS, and the GNU binutils are distributed in the hope that they
13*3d8817e4Smiod will be useful, but WITHOUT ANY WARRANTY; without even the implied
14*3d8817e4Smiod warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
15*3d8817e4Smiod the GNU General Public License for more details.
16*3d8817e4Smiod 
17*3d8817e4Smiod You should have received a copy of the GNU General Public License
18*3d8817e4Smiod along with this file; see the file COPYING.  If not, write to the Free
19*3d8817e4Smiod Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.  */
20*3d8817e4Smiod 
21*3d8817e4Smiod #ifndef MN10200_H
22*3d8817e4Smiod #define MN10200_H
23*3d8817e4Smiod 
24*3d8817e4Smiod /* The opcode table is an array of struct mn10200_opcode.  */
25*3d8817e4Smiod 
26*3d8817e4Smiod struct mn10200_opcode
27*3d8817e4Smiod {
28*3d8817e4Smiod   /* The opcode name.  */
29*3d8817e4Smiod   const char *name;
30*3d8817e4Smiod 
31*3d8817e4Smiod   /* The opcode itself.  Those bits which will be filled in with
32*3d8817e4Smiod      operands are zeroes.  */
33*3d8817e4Smiod   unsigned long opcode;
34*3d8817e4Smiod 
35*3d8817e4Smiod   /* The opcode mask.  This is used by the disassembler.  This is a
36*3d8817e4Smiod      mask containing ones indicating those bits which must match the
37*3d8817e4Smiod      opcode field, and zeroes indicating those bits which need not
38*3d8817e4Smiod      match (and are presumably filled in by operands).  */
39*3d8817e4Smiod   unsigned long mask;
40*3d8817e4Smiod 
41*3d8817e4Smiod   /* The format of this opcode.  */
42*3d8817e4Smiod   unsigned char format;
43*3d8817e4Smiod 
44*3d8817e4Smiod   /* An array of operand codes.  Each code is an index into the
45*3d8817e4Smiod      operand table.  They appear in the order which the operands must
46*3d8817e4Smiod      appear in assembly code, and are terminated by a zero.  */
47*3d8817e4Smiod   unsigned char operands[8];
48*3d8817e4Smiod };
49*3d8817e4Smiod 
50*3d8817e4Smiod /* The table itself is sorted by major opcode number, and is otherwise
51*3d8817e4Smiod    in the order in which the disassembler should consider
52*3d8817e4Smiod    instructions.  */
53*3d8817e4Smiod extern const struct mn10200_opcode mn10200_opcodes[];
54*3d8817e4Smiod extern const int mn10200_num_opcodes;
55*3d8817e4Smiod 
56*3d8817e4Smiod 
57*3d8817e4Smiod /* The operands table is an array of struct mn10200_operand.  */
58*3d8817e4Smiod 
59*3d8817e4Smiod struct mn10200_operand
60*3d8817e4Smiod {
61*3d8817e4Smiod   /* The number of bits in the operand.  */
62*3d8817e4Smiod   int bits;
63*3d8817e4Smiod 
64*3d8817e4Smiod   /* How far the operand is left shifted in the instruction.  */
65*3d8817e4Smiod   int shift;
66*3d8817e4Smiod 
67*3d8817e4Smiod   /* One bit syntax flags.  */
68*3d8817e4Smiod   int flags;
69*3d8817e4Smiod };
70*3d8817e4Smiod 
71*3d8817e4Smiod /* Elements in the table are retrieved by indexing with values from
72*3d8817e4Smiod    the operands field of the mn10200_opcodes table.  */
73*3d8817e4Smiod 
74*3d8817e4Smiod extern const struct mn10200_operand mn10200_operands[];
75*3d8817e4Smiod 
76*3d8817e4Smiod /* Values defined for the flags field of a struct mn10200_operand.  */
77*3d8817e4Smiod #define MN10200_OPERAND_DREG 0x1
78*3d8817e4Smiod 
79*3d8817e4Smiod #define MN10200_OPERAND_AREG 0x2
80*3d8817e4Smiod 
81*3d8817e4Smiod #define MN10200_OPERAND_PSW 0x4
82*3d8817e4Smiod 
83*3d8817e4Smiod #define MN10200_OPERAND_MDR 0x8
84*3d8817e4Smiod 
85*3d8817e4Smiod #define MN10200_OPERAND_SIGNED 0x10
86*3d8817e4Smiod 
87*3d8817e4Smiod #define MN10200_OPERAND_PROMOTE 0x20
88*3d8817e4Smiod 
89*3d8817e4Smiod #define MN10200_OPERAND_PAREN 0x40
90*3d8817e4Smiod 
91*3d8817e4Smiod #define MN10200_OPERAND_REPEATED 0x80
92*3d8817e4Smiod 
93*3d8817e4Smiod #define MN10200_OPERAND_EXTENDED 0x100
94*3d8817e4Smiod 
95*3d8817e4Smiod #define MN10200_OPERAND_NOCHECK 0x200
96*3d8817e4Smiod 
97*3d8817e4Smiod #define MN10200_OPERAND_PCREL 0x400
98*3d8817e4Smiod 
99*3d8817e4Smiod #define MN10200_OPERAND_MEMADDR 0x800
100*3d8817e4Smiod 
101*3d8817e4Smiod #define MN10200_OPERAND_RELAX 0x1000
102*3d8817e4Smiod 
103*3d8817e4Smiod #define FMT_1 1
104*3d8817e4Smiod #define FMT_2 2
105*3d8817e4Smiod #define FMT_3 3
106*3d8817e4Smiod #define FMT_4 4
107*3d8817e4Smiod #define FMT_5 5
108*3d8817e4Smiod #define FMT_6 6
109*3d8817e4Smiod #define FMT_7 7
110*3d8817e4Smiod #endif /* MN10200_H */
111