xref: /netbsd-src/external/gpl3/binutils.old/dist/include/opcode/mn10200.h (revision e992f068c547fd6e84b3f104dc2340adcc955732)
175fd0b74Schristos /* mn10200.h -- Header file for Matsushita 10200 opcode table
2*e992f068Schristos    Copyright (C) 1996-2022 Free Software Foundation, Inc.
375fd0b74Schristos    Written by Jeff Law, Cygnus Support
475fd0b74Schristos 
575fd0b74Schristos    This file is part of GDB, GAS, and the GNU binutils.
675fd0b74Schristos 
775fd0b74Schristos    GDB, GAS, and the GNU binutils are free software; you can redistribute
875fd0b74Schristos    them and/or modify them under the terms of the GNU General Public
975fd0b74Schristos    License as published by the Free Software Foundation; either version 3,
1075fd0b74Schristos    or (at your option) any later version.
1175fd0b74Schristos 
1275fd0b74Schristos    GDB, GAS, and the GNU binutils are distributed in the hope that they
1375fd0b74Schristos    will be useful, but WITHOUT ANY WARRANTY; without even the implied
1475fd0b74Schristos    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1575fd0b74Schristos    the GNU General Public License for more details.
1675fd0b74Schristos 
1775fd0b74Schristos    You should have received a copy of the GNU General Public License
1875fd0b74Schristos    along with this file; see the file COPYING3.  If not, write to the Free
1975fd0b74Schristos    Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
2075fd0b74Schristos    MA 02110-1301, USA.  */
2175fd0b74Schristos 
2275fd0b74Schristos #ifndef MN10200_H
2375fd0b74Schristos #define MN10200_H
2475fd0b74Schristos 
2575fd0b74Schristos /* The opcode table is an array of struct mn10200_opcode.  */
2675fd0b74Schristos 
2775fd0b74Schristos struct mn10200_opcode
2875fd0b74Schristos {
2975fd0b74Schristos   /* The opcode name.  */
3075fd0b74Schristos   const char *name;
3175fd0b74Schristos 
3275fd0b74Schristos   /* The opcode itself.  Those bits which will be filled in with
3375fd0b74Schristos      operands are zeroes.  */
3475fd0b74Schristos   unsigned long opcode;
3575fd0b74Schristos 
3675fd0b74Schristos   /* The opcode mask.  This is used by the disassembler.  This is a
3775fd0b74Schristos      mask containing ones indicating those bits which must match the
3875fd0b74Schristos      opcode field, and zeroes indicating those bits which need not
3975fd0b74Schristos      match (and are presumably filled in by operands).  */
4075fd0b74Schristos   unsigned long mask;
4175fd0b74Schristos 
4275fd0b74Schristos   /* The format of this opcode.  */
4375fd0b74Schristos   unsigned char format;
4475fd0b74Schristos 
4575fd0b74Schristos   /* An array of operand codes.  Each code is an index into the
4675fd0b74Schristos      operand table.  They appear in the order which the operands must
4775fd0b74Schristos      appear in assembly code, and are terminated by a zero.  */
4875fd0b74Schristos   unsigned char operands[8];
4975fd0b74Schristos };
5075fd0b74Schristos 
5175fd0b74Schristos /* The table itself is sorted by major opcode number, and is otherwise
5275fd0b74Schristos    in the order in which the disassembler should consider
5375fd0b74Schristos    instructions.  */
5475fd0b74Schristos extern const struct mn10200_opcode mn10200_opcodes[];
5575fd0b74Schristos extern const int mn10200_num_opcodes;
5675fd0b74Schristos 
5775fd0b74Schristos 
5875fd0b74Schristos /* The operands table is an array of struct mn10200_operand.  */
5975fd0b74Schristos 
6075fd0b74Schristos struct mn10200_operand
6175fd0b74Schristos {
6275fd0b74Schristos   /* The number of bits in the operand.  */
6375fd0b74Schristos   int bits;
6475fd0b74Schristos 
6575fd0b74Schristos   /* How far the operand is left shifted in the instruction.  */
6675fd0b74Schristos   int shift;
6775fd0b74Schristos 
6875fd0b74Schristos   /* One bit syntax flags.  */
6975fd0b74Schristos   int flags;
7075fd0b74Schristos };
7175fd0b74Schristos 
7275fd0b74Schristos /* Elements in the table are retrieved by indexing with values from
7375fd0b74Schristos    the operands field of the mn10200_opcodes table.  */
7475fd0b74Schristos 
7575fd0b74Schristos extern const struct mn10200_operand mn10200_operands[];
7675fd0b74Schristos 
7775fd0b74Schristos /* Values defined for the flags field of a struct mn10200_operand.  */
7875fd0b74Schristos #define MN10200_OPERAND_DREG 0x1
7975fd0b74Schristos 
8075fd0b74Schristos #define MN10200_OPERAND_AREG 0x2
8175fd0b74Schristos 
8275fd0b74Schristos #define MN10200_OPERAND_PSW 0x4
8375fd0b74Schristos 
8475fd0b74Schristos #define MN10200_OPERAND_MDR 0x8
8575fd0b74Schristos 
8675fd0b74Schristos #define MN10200_OPERAND_SIGNED 0x10
8775fd0b74Schristos 
8875fd0b74Schristos #define MN10200_OPERAND_PROMOTE 0x20
8975fd0b74Schristos 
9075fd0b74Schristos #define MN10200_OPERAND_PAREN 0x40
9175fd0b74Schristos 
9275fd0b74Schristos #define MN10200_OPERAND_REPEATED 0x80
9375fd0b74Schristos 
9475fd0b74Schristos #define MN10200_OPERAND_EXTENDED 0x100
9575fd0b74Schristos 
9675fd0b74Schristos #define MN10200_OPERAND_NOCHECK 0x200
9775fd0b74Schristos 
9875fd0b74Schristos #define MN10200_OPERAND_PCREL 0x400
9975fd0b74Schristos 
10075fd0b74Schristos #define MN10200_OPERAND_MEMADDR 0x800
10175fd0b74Schristos 
10275fd0b74Schristos #define MN10200_OPERAND_RELAX 0x1000
10375fd0b74Schristos 
10475fd0b74Schristos #define FMT_1 1
10575fd0b74Schristos #define FMT_2 2
10675fd0b74Schristos #define FMT_3 3
10775fd0b74Schristos #define FMT_4 4
10875fd0b74Schristos #define FMT_5 5
10975fd0b74Schristos #define FMT_6 6
11075fd0b74Schristos #define FMT_7 7
11175fd0b74Schristos #endif /* MN10200_H */
112