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