Subversion Repositories Kolibri OS

Rev

Rev 5191 | Blame | Compare with Previous | Last modification | View Log | RSS feed

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