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