| 1 | /* mn10200.h -- Header file for Matsushita 10200 opcode table
|
|---|
| 2 | Copyright 1996, 1997 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
|
|---|
| 10 | 1, 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 COPYING. If not, write to the Free
|
|---|
| 19 | Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|---|
| 20 |
|
|---|
| 21 | #ifndef MN10200_H
|
|---|
| 22 | #define MN10200_H
|
|---|
| 23 |
|
|---|
| 24 | /* The opcode table is an array of struct mn10200_opcode. */
|
|---|
| 25 |
|
|---|
| 26 | struct mn10200_opcode
|
|---|
| 27 | {
|
|---|
| 28 | /* The opcode name. */
|
|---|
| 29 | const char *name;
|
|---|
| 30 |
|
|---|
| 31 | /* The opcode itself. Those bits which will be filled in with
|
|---|
| 32 | operands are zeroes. */
|
|---|
| 33 | unsigned long opcode;
|
|---|
| 34 |
|
|---|
| 35 | /* The opcode mask. This is used by the disassembler. This is a
|
|---|
| 36 | mask containing ones indicating those bits which must match the
|
|---|
| 37 | opcode field, and zeroes indicating those bits which need not
|
|---|
| 38 | match (and are presumably filled in by operands). */
|
|---|
| 39 | unsigned long mask;
|
|---|
| 40 |
|
|---|
| 41 | /* The format of this opcode. */
|
|---|
| 42 | unsigned char format;
|
|---|
| 43 |
|
|---|
| 44 | /* An array of operand codes. Each code is an index into the
|
|---|
| 45 | operand table. They appear in the order which the operands must
|
|---|
| 46 | appear in assembly code, and are terminated by a zero. */
|
|---|
| 47 | unsigned char operands[8];
|
|---|
| 48 | };
|
|---|
| 49 |
|
|---|
| 50 | /* The table itself is sorted by major opcode number, and is otherwise
|
|---|
| 51 | in the order in which the disassembler should consider
|
|---|
| 52 | instructions. */
|
|---|
| 53 | extern const struct mn10200_opcode mn10200_opcodes[];
|
|---|
| 54 | extern const int mn10200_num_opcodes;
|
|---|
| 55 |
|
|---|
| 56 | |
|---|
| 57 |
|
|---|
| 58 | /* The operands table is an array of struct mn10200_operand. */
|
|---|
| 59 |
|
|---|
| 60 | struct mn10200_operand
|
|---|
| 61 | {
|
|---|
| 62 | /* The number of bits in the operand. */
|
|---|
| 63 | int bits;
|
|---|
| 64 |
|
|---|
| 65 | /* How far the operand is left shifted in the instruction. */
|
|---|
| 66 | int shift;
|
|---|
| 67 |
|
|---|
| 68 | /* One bit syntax flags. */
|
|---|
| 69 | int flags;
|
|---|
| 70 | };
|
|---|
| 71 |
|
|---|
| 72 | /* Elements in the table are retrieved by indexing with values from
|
|---|
| 73 | the operands field of the mn10200_opcodes table. */
|
|---|
| 74 |
|
|---|
| 75 | extern const struct mn10200_operand mn10200_operands[];
|
|---|
| 76 |
|
|---|
| 77 | /* Values defined for the flags field of a struct mn10200_operand. */
|
|---|
| 78 | #define MN10200_OPERAND_DREG 0x1
|
|---|
| 79 |
|
|---|
| 80 | #define MN10200_OPERAND_AREG 0x2
|
|---|
| 81 |
|
|---|
| 82 | #define MN10200_OPERAND_PSW 0x4
|
|---|
| 83 |
|
|---|
| 84 | #define MN10200_OPERAND_MDR 0x8
|
|---|
| 85 |
|
|---|
| 86 | #define MN10200_OPERAND_SIGNED 0x10
|
|---|
| 87 |
|
|---|
| 88 | #define MN10200_OPERAND_PROMOTE 0x20
|
|---|
| 89 |
|
|---|
| 90 | #define MN10200_OPERAND_PAREN 0x40
|
|---|
| 91 |
|
|---|
| 92 | #define MN10200_OPERAND_REPEATED 0x80
|
|---|
| 93 |
|
|---|
| 94 | #define MN10200_OPERAND_EXTENDED 0x100
|
|---|
| 95 |
|
|---|
| 96 | #define MN10200_OPERAND_NOCHECK 0x200
|
|---|
| 97 |
|
|---|
| 98 | #define MN10200_OPERAND_PCREL 0x400
|
|---|
| 99 |
|
|---|
| 100 | #define MN10200_OPERAND_MEMADDR 0x800
|
|---|
| 101 |
|
|---|
| 102 | #define MN10200_OPERAND_RELAX 0x1000
|
|---|
| 103 |
|
|---|
| 104 | #define FMT_1 1
|
|---|
| 105 | #define FMT_2 2
|
|---|
| 106 | #define FMT_3 3
|
|---|
| 107 | #define FMT_4 4
|
|---|
| 108 | #define FMT_5 5
|
|---|
| 109 | #define FMT_6 6
|
|---|
| 110 | #define FMT_7 7
|
|---|
| 111 | #endif /* MN10200_H */
|
|---|