xref: /netbsd-src/external/gpl3/gdb/dist/include/opcode/mn10200.h (revision aab831cebf6361fb2b518a47c70732e608d9abd2)
198b9484cSchristos /* mn10200.h -- Header file for Matsushita 10200 opcode table
2*aab831ceSchristos    Copyright (C) 1996-2024 Free Software Foundation, Inc.
398b9484cSchristos    Written by Jeff Law, Cygnus Support
498b9484cSchristos 
598b9484cSchristos    This file is part of GDB, GAS, and the GNU binutils.
698b9484cSchristos 
798b9484cSchristos    GDB, GAS, and the GNU binutils are free software; you can redistribute
898b9484cSchristos    them and/or modify them under the terms of the GNU General Public
998b9484cSchristos    License as published by the Free Software Foundation; either version 3,
1098b9484cSchristos    or (at your option) any later version.
1198b9484cSchristos 
1298b9484cSchristos    GDB, GAS, and the GNU binutils are distributed in the hope that they
1398b9484cSchristos    will be useful, but WITHOUT ANY WARRANTY; without even the implied
1498b9484cSchristos    warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
1598b9484cSchristos    the GNU General Public License for more details.
1698b9484cSchristos 
1798b9484cSchristos    You should have received a copy of the GNU General Public License
1898b9484cSchristos    along with this file; see the file COPYING3.  If not, write to the Free
1998b9484cSchristos    Software Foundation, 51 Franklin Street - Fifth Floor, Boston,
2098b9484cSchristos    MA 02110-1301, USA.  */
2198b9484cSchristos 
2298b9484cSchristos #ifndef MN10200_H
2398b9484cSchristos #define MN10200_H
2498b9484cSchristos 
2598b9484cSchristos /* The opcode table is an array of struct mn10200_opcode.  */
2698b9484cSchristos 
2798b9484cSchristos struct mn10200_opcode
2898b9484cSchristos {
2998b9484cSchristos   /* The opcode name.  */
3098b9484cSchristos   const char *name;
3198b9484cSchristos 
3298b9484cSchristos   /* The opcode itself.  Those bits which will be filled in with
3398b9484cSchristos      operands are zeroes.  */
3498b9484cSchristos   unsigned long opcode;
3598b9484cSchristos 
3698b9484cSchristos   /* The opcode mask.  This is used by the disassembler.  This is a
3798b9484cSchristos      mask containing ones indicating those bits which must match the
3898b9484cSchristos      opcode field, and zeroes indicating those bits which need not
3998b9484cSchristos      match (and are presumably filled in by operands).  */
4098b9484cSchristos   unsigned long mask;
4198b9484cSchristos 
4298b9484cSchristos   /* The format of this opcode.  */
4398b9484cSchristos   unsigned char format;
4498b9484cSchristos 
4598b9484cSchristos   /* An array of operand codes.  Each code is an index into the
4698b9484cSchristos      operand table.  They appear in the order which the operands must
4798b9484cSchristos      appear in assembly code, and are terminated by a zero.  */
4898b9484cSchristos   unsigned char operands[8];
4998b9484cSchristos };
5098b9484cSchristos 
5198b9484cSchristos /* The table itself is sorted by major opcode number, and is otherwise
5298b9484cSchristos    in the order in which the disassembler should consider
5398b9484cSchristos    instructions.  */
5498b9484cSchristos extern const struct mn10200_opcode mn10200_opcodes[];
5598b9484cSchristos extern const int mn10200_num_opcodes;
5698b9484cSchristos 
5798b9484cSchristos 
5898b9484cSchristos /* The operands table is an array of struct mn10200_operand.  */
5998b9484cSchristos 
6098b9484cSchristos struct mn10200_operand
6198b9484cSchristos {
6298b9484cSchristos   /* The number of bits in the operand.  */
6398b9484cSchristos   int bits;
6498b9484cSchristos 
6598b9484cSchristos   /* How far the operand is left shifted in the instruction.  */
6698b9484cSchristos   int shift;
6798b9484cSchristos 
6898b9484cSchristos   /* One bit syntax flags.  */
6998b9484cSchristos   int flags;
7098b9484cSchristos };
7198b9484cSchristos 
7298b9484cSchristos /* Elements in the table are retrieved by indexing with values from
7398b9484cSchristos    the operands field of the mn10200_opcodes table.  */
7498b9484cSchristos 
7598b9484cSchristos extern const struct mn10200_operand mn10200_operands[];
7698b9484cSchristos 
7798b9484cSchristos /* Values defined for the flags field of a struct mn10200_operand.  */
7898b9484cSchristos #define MN10200_OPERAND_DREG 0x1
7998b9484cSchristos 
8098b9484cSchristos #define MN10200_OPERAND_AREG 0x2
8198b9484cSchristos 
8298b9484cSchristos #define MN10200_OPERAND_PSW 0x4
8398b9484cSchristos 
8498b9484cSchristos #define MN10200_OPERAND_MDR 0x8
8598b9484cSchristos 
8698b9484cSchristos #define MN10200_OPERAND_SIGNED 0x10
8798b9484cSchristos 
8898b9484cSchristos #define MN10200_OPERAND_PROMOTE 0x20
8998b9484cSchristos 
9098b9484cSchristos #define MN10200_OPERAND_PAREN 0x40
9198b9484cSchristos 
9298b9484cSchristos #define MN10200_OPERAND_REPEATED 0x80
9398b9484cSchristos 
9498b9484cSchristos #define MN10200_OPERAND_EXTENDED 0x100
9598b9484cSchristos 
9698b9484cSchristos #define MN10200_OPERAND_NOCHECK 0x200
9798b9484cSchristos 
9898b9484cSchristos #define MN10200_OPERAND_PCREL 0x400
9998b9484cSchristos 
10098b9484cSchristos #define MN10200_OPERAND_MEMADDR 0x800
10198b9484cSchristos 
10298b9484cSchristos #define MN10200_OPERAND_RELAX 0x1000
10398b9484cSchristos 
10498b9484cSchristos #define FMT_1 1
10598b9484cSchristos #define FMT_2 2
10698b9484cSchristos #define FMT_3 3
10798b9484cSchristos #define FMT_4 4
10898b9484cSchristos #define FMT_5 5
10998b9484cSchristos #define FMT_6 6
11098b9484cSchristos #define FMT_7 7
11198b9484cSchristos #endif /* MN10200_H */
112