(Laying the groundwork (that will be incrementally fleshed out) for
[deliverable/binutils-gdb.git] / include / opcode / tic80.h
1 /* tic80.h -- Header file for TI TMS320C80 (MV) opcode table
2 Copyright 1996 Free Software Foundation, Inc.
3 Written by Fred Fish (fnf@cygnus.com), Cygnus Support
4 using other opcode/*.h files as templates.
5
6 This file is part of GDB, GAS, and the GNU binutils.
7
8 GDB, GAS, and the GNU binutils are free software; you can redistribute
9 them and/or modify them under the terms of the GNU General Public
10 License as published by the Free Software Foundation; either version
11 1, or (at your option) any later version.
12
13 GDB, GAS, and the GNU binutils are distributed in the hope that they
14 will be useful, but WITHOUT ANY WARRANTY; without even the implied
15 warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
16 the GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this file; see the file COPYING. If not, write to the Free
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
21
22 #ifndef TIC80_H
23 #define TIC80_H
24
25 /* The opcode table is an array of struct TIc80_opcode. */
26
27 struct TIc80_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 tic80_opcode tic80_opcodes[];
55 extern const int tic80_num_opcodes;
56
57 \f
58 /* The operands table is an array of struct tic80_operand. */
59
60 struct tic80_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 tic80_opcodes table. */
74
75 extern const struct tic80_operand tic80_operands[];
76
77 /* Values defined for the flags field of a struct tic80_operand. */
78 #define TIC80_OPERAND_DREG 0x1
79
80 #define TIC80_OPERAND_AREG 0x2
81
82 #define TIC80_OPERAND_PSW 0x4
83
84 #define TIC80_OPERAND_MDR 0x8
85
86 #define TIC80_OPERAND_SIGNED 0x10
87
88 #define TIC80_OPERAND_PROMOTE 0x20
89
90 #define TIC80_OPERAND_PAREN 0x40
91
92 #define TIC80_OPERAND_REPEATED 0x80
93
94 #define TIC80_OPERAND_EXTENDED 0x100
95
96 #define TIC80_OPERAND_PCREL 0x400
97
98 #define TIC80_OPERAND_MEMADDR 0x800
99
100 #define FMT_1 1
101 #define FMT_2 2
102 #define FMT_3 3
103 #define FMT_4 4
104 #define FMT_5 5
105 #define FMT_6 6
106 #define FMT_7 7
107
108 #endif /* TIC80_H */
This page took 0.032179 seconds and 4 git commands to generate.