1 /* m68k-parse.h -- header file for m68k assembler
2 Copyright (C) 1987-2018 Free Software Foundation, Inc.
4 This file is part of GAS, the GNU Assembler.
6 GAS is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
11 GAS is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GAS; see the file COPYING. If not, write to the Free
18 Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
24 /* This header file defines things which are shared between the
25 operand parser in m68k.y and the m68k assembler proper in
28 /* The various m68k registers. */
30 /* DATA and ADDR have to be contiguous, so that reg-DATA gives
31 0-7==data reg, 8-15==addr reg for operands that take both types.
33 We don't use forms like "ADDR0 = ADDR" here because this file is
34 likely to be used on an Apollo, and the broken Apollo compiler
35 gives an `undefined variable' error if we do that, according to
36 troy@cbme.unsw.edu.au. */
46 DATA0 = 1, /* 1- 8 == data registers 0-7 */
64 FP0, /* Eight FP registers */
73 COP0, /* Co-processor #0-#7 */
82 PC, /* Program counter */
83 ZPC, /* Hack for Program space, but 0 addressing */
85 CCR, /* Condition code Reg */
86 ACC, /* Accumulator Reg0 (EMAC or ACC on MAC). */
87 ACC1, /* Accumulator Reg 1 (EMAC). */
88 ACC2, /* Accumulator Reg 2 (EMAC). */
89 ACC3, /* Accumulator Reg 3 (EMAC). */
90 ACCEXT01, /* Accumulator extension 0&1 (EMAC). */
91 ACCEXT23, /* Accumulator extension 2&3 (EMAC). */
92 MACSR, /* MAC Status Reg */
93 MASK, /* Modulus Reg */
95 /* These have to be grouped together for the movec instruction to work. */
96 USP, /* User Stack Pointer */
97 ISP, /* Interrupt stack pointer */
113 BUSCR, /* 68060 added these. */
115 ROMBAR, /* mcf5200 added these. */
116 RAMBAR_ALT, /* Some CF chips have RAMBAR using
120 MMUBAR, /* mcfv4e added these. */
121 ROMBAR0, /* mcfv4e added these. */
122 ROMBAR1, /* mcfv4e added these. */
123 MPCR, EDRAMBAR, SECMBAR, /* mcfv4e added these. */
124 PCR1U0, PCR1L0, PCR1U1, PCR1L1,/* mcfv4e added these. */
125 PCR2U0, PCR2L0, PCR2U1, PCR2L1,/* mcfv4e added these. */
126 PCR3U0, PCR3L0, PCR3U1, PCR3L1,/* mcfv4e added these. */
127 MBAR0, MBAR1, /* mcfv4e added these. */
128 ACR0, ACR1, ACR2, ACR3, /* mcf5200 added these. */
129 ACR4, ACR5, ACR6, ACR7, /* mcf54418 added these. */
130 FLASHBAR, RAMBAR, /* mcf528x added these. */
131 MBAR2, /* mcf5249 added this. */
133 RGPIOBAR, /* mcf54418 added this. */
135 CAC, /* fido added this. */
137 #define last_movec_reg MBO
138 /* End of movec ordering constraints. */
144 DRP, /* 68851 or 68030 MMU regs */
166 PSR, /* aka MMUSR on 68030 (but not MMUSR on 68040)
167 and ACUSR on 68ec030 */
170 IC, /* instruction cache token */
171 DC, /* data cache token */
172 NC, /* no cache token */
173 BC, /* both caches token */
175 TT0, /* 68030 access control unit regs */
178 ZDATA0, /* suppressed data registers. */
187 ZADDR0, /* suppressed address registers. */
196 /* Upper and lower half of data and address registers. Order *must*
197 be DATAxL, ADDRxL, DATAxU, ADDRxU. */
198 DATA0L, /* lower half of data registers */
207 ADDR0L, /* lower half of address registers */
216 DATA0U, /* upper half of data registers */
225 ADDR0U, /* upper half of address registers */
235 /* Size information. */
245 /* Word (2 bytes). */
248 /* Longword (4 bytes). */
252 /* The structure used to hold information about an index register. */
256 /* The index register itself. */
257 enum m68k_register reg;
259 /* The size to use. */
262 /* The value to scale by. */
267 /* The type of a PIC expression. */
271 pic_none, /* not pic */
272 pic_plt_pcrel, /* @PLTPC */
273 pic_got_pcrel, /* @GOTPC */
274 pic_plt_off, /* @PLT */
275 pic_got_off, /* @GOT */
276 pic_tls_gd, /* @TLSGD */
277 pic_tls_ldm, /* @TLSLDM */
278 pic_tls_ldo, /* @TLSLDO */
279 pic_tls_ie, /* @TLSIE */
280 pic_tls_le /* @TLSLE */
284 /* The structure used to hold information about an expression. */
288 /* The size to use. */
292 /* The type of pic relocation if any. */
293 enum pic_relocation pic_reloc;
296 /* The expression itself. */
300 /* The operand modes. */
302 enum m68k_operand_type
317 LSH, /* MAC/EMAC scalefactor '<<'. */
318 RSH, /* MAC/EMAC scalefactor '>>'. */
322 /* The structure used to hold a parsed operand. */
326 /* The type of operand. */
327 enum m68k_operand_type mode;
329 /* The main register. */
330 enum m68k_register reg;
332 /* The register mask for mode REGLST. */
335 /* An error message. */
338 /* The index register. */
339 struct m68k_indexreg index;
341 /* The displacement. */
342 struct m68k_exp disp;
344 /* The outer displacement. */
345 struct m68k_exp odisp;
347 /* Is a trailing '&' added to an <ea>? (for MAC/EMAC mask addressing). */
348 int trailing_ampersand;
351 #endif /* ! defined (M68K_PARSE_H) */
353 /* The parsing function. */
355 extern int m68k_ip_op (char *, struct m68k_op *);
357 /* Whether register prefixes are optional. */
358 extern int flag_reg_prefix_optional;