1 /* m68k-parse.h -- header file for m68k assembler
2 Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000,
3 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
5 This file is part of GAS, the GNU Assembler.
7 GAS 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 3, or (at your option)
12 GAS 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 GAS; see the file COPYING. If not, write to the Free
19 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
25 /* This header file defines things which are shared between the
26 operand parser in m68k.y and the m68k assembler proper in
29 /* The various m68k registers. */
31 /* DATA and ADDR have to be contiguous, so that reg-DATA gives
32 0-7==data reg, 8-15==addr reg for operands that take both types.
34 We don't use forms like "ADDR0 = ADDR" here because this file is
35 likely to be used on an Apollo, and the broken Apollo compiler
36 gives an `undefined variable' error if we do that, according to
37 troy@cbme.unsw.edu.au. */
47 DATA0 = 1, /* 1- 8 == data registers 0-7 */
65 FP0, /* Eight FP registers */
74 COP0, /* Co-processor #0-#7 */
83 PC, /* Program counter */
84 ZPC, /* Hack for Program space, but 0 addressing */
86 CCR, /* Condition code Reg */
87 ACC, /* Accumulator Reg0 (EMAC or ACC on MAC). */
88 ACC1, /* Accumulator Reg 1 (EMAC). */
89 ACC2, /* Accumulator Reg 2 (EMAC). */
90 ACC3, /* Accumulator Reg 3 (EMAC). */
91 ACCEXT01, /* Accumulator extension 0&1 (EMAC). */
92 ACCEXT23, /* Accumulator extension 2&3 (EMAC). */
93 MACSR, /* MAC Status Reg */
94 MASK, /* Modulus Reg */
96 /* These have to be grouped together for the movec instruction to work. */
97 USP, /* User Stack Pointer */
98 ISP, /* Interrupt stack pointer */
114 BUSCR, /* 68060 added these. */
116 ROMBAR, /* mcf5200 added these. */
117 RAMBAR_ALT, /* Some CF chips have RAMBAR using
121 MMUBAR, /* mcfv4e added these. */
122 ROMBAR0, /* mcfv4e added these. */
123 ROMBAR1, /* mcfv4e added these. */
124 MPCR, EDRAMBAR, SECMBAR, /* mcfv4e added these. */
125 PCR1U0, PCR1L0, PCR1U1, PCR1L1,/* mcfv4e added these. */
126 PCR2U0, PCR2L0, PCR2U1, PCR2L1,/* mcfv4e added these. */
127 PCR3U0, PCR3L0, PCR3U1, PCR3L1,/* mcfv4e added these. */
128 MBAR0, MBAR1, /* mcfv4e added these. */
129 ACR0, ACR1, ACR2, ACR3, /* mcf5200 added these. */
130 FLASHBAR, RAMBAR, /* mcf528x added these. */
131 MBAR2, /* mcf5249 added this. */
134 CAC, /* fido added this. */
136 #define last_movec_reg MBO
137 /* End of movec ordering constraints. */
143 DRP, /* 68851 or 68030 MMU regs */
165 PSR, /* aka MMUSR on 68030 (but not MMUSR on 68040)
166 and ACUSR on 68ec030 */
169 IC, /* instruction cache token */
170 DC, /* data cache token */
171 NC, /* no cache token */
172 BC, /* both caches token */
174 TT0, /* 68030 access control unit regs */
177 ZDATA0, /* suppressed data registers. */
186 ZADDR0, /* suppressed address registers. */
195 /* Upper and lower half of data and address registers. Order *must*
196 be DATAxL, ADDRxL, DATAxU, ADDRxU. */
197 DATA0L, /* lower half of data registers */
206 ADDR0L, /* lower half of address registers */
215 DATA0U, /* upper half of data registers */
224 ADDR0U, /* upper half of address registers */
234 /* Size information. */
244 /* Word (2 bytes). */
247 /* Longword (4 bytes). */
251 /* The structure used to hold information about an index register. */
255 /* The index register itself. */
256 enum m68k_register reg;
258 /* The size to use. */
261 /* The value to scale by. */
266 /* The type of a PIC expression. */
270 pic_none, /* not pic */
271 pic_plt_pcrel, /* @PLTPC */
272 pic_got_pcrel, /* @GOTPC */
273 pic_plt_off, /* @PLT */
274 pic_got_off, /* @GOT */
275 pic_tls_gd, /* @TLSGD */
276 pic_tls_ldm, /* @TLSLDM */
277 pic_tls_ldo, /* @TLSLDO */
278 pic_tls_ie, /* @TLSIE */
279 pic_tls_le /* @TLSLE */
283 /* The structure used to hold information about an expression. */
287 /* The size to use. */
291 /* The type of pic relocation if any. */
292 enum pic_relocation pic_reloc;
295 /* The expression itself. */
299 /* The operand modes. */
301 enum m68k_operand_type
316 LSH, /* MAC/EMAC scalefactor '<<'. */
317 RSH, /* MAC/EMAC scalefactor '>>'. */
321 /* The structure used to hold a parsed operand. */
325 /* The type of operand. */
326 enum m68k_operand_type mode;
328 /* The main register. */
329 enum m68k_register reg;
331 /* The register mask for mode REGLST. */
334 /* An error message. */
337 /* The index register. */
338 struct m68k_indexreg index;
340 /* The displacement. */
341 struct m68k_exp disp;
343 /* The outer displacement. */
344 struct m68k_exp odisp;
346 /* Is a trailing '&' added to an <ea>? (for MAC/EMAC mask addressing). */
347 int trailing_ampersand;
350 #endif /* ! defined (M68K_PARSE_H) */
352 /* The parsing function. */
354 extern int m68k_ip_op (char *, struct m68k_op *);
356 /* Whether register prefixes are optional. */
357 extern int flag_reg_prefix_optional;