* addr2line.c (main): Protoype.
[binutils.git] / include / opcode / s390.h
blob1a42be6603a7fb554cc7edf150314d47475c8ae8
1 /* s390.h -- Header file for S390 opcode table
2 Copyright 2000, 2001 Free Software Foundation, Inc.
3 Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
5 This file is part of BFD, the Binary File Descriptor library.
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 02111-1307, USA. */
22 #ifndef S390_H
23 #define S390_H
25 /* List of instruction sets variations. */
27 enum s390_opcode_arch_val
29 S390_OPCODE_ESA = 0,
30 S390_OPCODE_ESAME
33 /* The opcode table is an array of struct s390_opcode. */
35 struct s390_opcode
37 /* The opcode name. */
38 const char * name;
40 /* The opcode itself. Those bits which will be filled in with
41 operands are zeroes. */
42 unsigned char opcode[6];
44 /* The opcode mask. This is used by the disassembler. This is a
45 mask containing ones indicating those bits which must match the
46 opcode field, and zeroes indicating those bits which need not
47 match (and are presumably filled in by operands). */
48 unsigned char mask[6];
50 /* The opcode length in bytes. */
51 int oplen;
53 /* An array of operand codes. Each code is an index into the
54 operand table. They appear in the order which the operands must
55 appear in assembly code, and are terminated by a zero. */
56 unsigned char operands[6];
58 /* Bitmask of architectures this opcode is available for. */
59 unsigned int architecture;
62 /* The table itself is sorted by major opcode number, and is otherwise
63 in the order in which the disassembler should consider
64 instructions. */
65 extern const struct s390_opcode s390_opcodes[];
66 extern const int s390_num_opcodes;
68 /* A opcode format table for the .insn pseudo mnemonic. */
69 extern const struct s390_opcode s390_opformats[];
70 extern const int s390_num_opformats;
72 /* Values defined for the flags field of a struct powerpc_opcode. */
74 /* The operands table is an array of struct s390_operand. */
76 struct s390_operand
78 /* The number of bits in the operand. */
79 int bits;
81 /* How far the operand is left shifted in the instruction. */
82 int shift;
84 /* One bit syntax flags. */
85 unsigned long flags;
88 /* Elements in the table are retrieved by indexing with values from
89 the operands field of the powerpc_opcodes table. */
91 extern const struct s390_operand s390_operands[];
93 /* Values defined for the flags field of a struct s390_operand. */
95 /* This operand names a register. The disassembler uses this to print
96 register names with a leading 'r'. */
97 #define S390_OPERAND_GPR 0x1
99 /* This operand names a floating point register. The disassembler
100 prints these with a leading 'f'. */
101 #define S390_OPERAND_FPR 0x2
103 /* This operand names an access register. The disassembler
104 prints these with a leading 'a'. */
105 #define S390_OPERAND_AR 0x4
107 /* This operand names a control register. The disassembler
108 prints these with a leading 'c'. */
109 #define S390_OPERAND_CR 0x8
111 /* This operand is a displacement. */
112 #define S390_OPERAND_DISP 0x10
114 /* This operand names a base register. */
115 #define S390_OPERAND_BASE 0x20
117 /* This operand names an index register, it can be skipped. */
118 #define S390_OPERAND_INDEX 0x40
120 /* This operand is a relative branch displacement. The disassembler
121 prints these symbolically if possible. */
122 #define S390_OPERAND_PCREL 0x80
124 /* This operand takes signed values. */
125 #define S390_OPERAND_SIGNED 0x100
127 /* This operand is a length. */
128 #define S390_OPERAND_LENGTH 0x200
130 #endif /* S390_H */