Copyright 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1999, 2000,
2003, 2004, 2005, 2007 Free Software Foundation, Inc.
This file is part of GAS, the GNU Assembler.
GAS is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
GAS is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GAS; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
#ifndef M68K_PARSE_H
#define M68K_PARSE_H
operand parser in m68k.y and the m68k assembler proper in
tc-m68k.c. */
0-7==data reg, 8-15==addr reg for operands that take both types.
We don't use forms like "ADDR0 = ADDR" here because this file is
likely to be used on an Apollo, and the broken Apollo compiler
gives an `undefined variable' error if we do that, according to
troy@cbme.unsw.edu.au. */
#define DATA DATA0
#define ADDR ADDR0
#define SP ADDR7
#define BAD BAD0
#define BAC BAC0
enum m68k_register
{
DATA0 = 1,
DATA1,
DATA2,
DATA3,
DATA4,
DATA5,
DATA6,
DATA7,
ADDR0,
ADDR1,
ADDR2,
ADDR3,
ADDR4,
ADDR5,
ADDR6,
ADDR7,
FP0,
FP1,
FP2,
FP3,
FP4,
FP5,
FP6,
FP7,
COP0,
COP1,
COP2,
COP3,
COP4,
COP5,
COP6,
COP7,
PC,
ZPC,
SR,
CCR,
ACC,
ACC1,
ACC2,
ACC3,
ACCEXT01,
ACCEXT23,
MACSR,
MASK,
USP,
ISP,
SFC,
DFC,
CACR,
VBR,
CAAR,
MSP,
ITT0,
ITT1,
DTT0,
DTT1,
MMUSR,
TC,
SRP,
URP,
BUSCR,
PCR,
ROMBAR,
RAMBAR_ALT,
RAMBAR0's number */
RAMBAR0,
RAMBAR1,
MMUBAR,
ROMBAR0,
ROMBAR1,
MPCR, EDRAMBAR, SECMBAR,
PCR1U0, PCR1L0, PCR1U1, PCR1L1,
PCR2U0, PCR2L0, PCR2U1, PCR2L1,
PCR3U0, PCR3L0, PCR3U1, PCR3L1,
MBAR0, MBAR1,
ACR0, ACR1, ACR2, ACR3,
FLASHBAR, RAMBAR,
MBAR2,
MBAR,
ASID,
CAC,
MBO,
#define last_movec_reg MBO
FPI,
FPS,
FPC,
DRP,
CRP,
CAL,
VAL,
SCC,
AC,
BAD0,
BAD1,
BAD2,
BAD3,
BAD4,
BAD5,
BAD6,
BAD7,
BAC0,
BAC1,
BAC2,
BAC3,
BAC4,
BAC5,
BAC6,
BAC7,
PSR,
and ACUSR on 68ec030 */
PCSR,
IC,
DC,
NC,
BC,
TT0,
TT1,
ZDATA0,
ZDATA1,
ZDATA2,
ZDATA3,
ZDATA4,
ZDATA5,
ZDATA6,
ZDATA7,
ZADDR0,
ZADDR1,
ZADDR2,
ZADDR3,
ZADDR4,
ZADDR5,
ZADDR6,
ZADDR7,
be DATAxL, ADDRxL, DATAxU, ADDRxU. */
DATA0L,
DATA1L,
DATA2L,
DATA3L,
DATA4L,
DATA5L,
DATA6L,
DATA7L,
ADDR0L,
ADDR1L,
ADDR2L,
ADDR3L,
ADDR4L,
ADDR5L,
ADDR6L,
ADDR7L,
DATA0U,
DATA1U,
DATA2U,
DATA3U,
DATA4U,
DATA5U,
DATA6U,
DATA7U,
ADDR0U,
ADDR1U,
ADDR2U,
ADDR3U,
ADDR4U,
ADDR5U,
ADDR6U,
ADDR7U,
};
enum m68k_size
{
SIZE_UNSPEC,
SIZE_BYTE,
SIZE_WORD,
SIZE_LONG
};
struct m68k_indexreg
{
enum m68k_register reg;
enum m68k_size size;
int scale;
};
#ifdef OBJ_ELF
enum pic_relocation
{
pic_none,
pic_plt_pcrel,
pic_got_pcrel,
pic_plt_off,
pic_got_off
};
#endif
struct m68k_exp
{
enum m68k_size size;
#ifdef OBJ_ELF
enum pic_relocation pic_reloc;
#endif
expressionS exp;
};
enum m68k_operand_type
{
IMMED = 1,
ABSL,
DREG,
AREG,
FPREG,
CONTROL,
AINDR,
AINC,
ADEC,
DISP,
BASE,
POST,
PRE,
LSH,
RSH,
REGLST
};
struct m68k_op
{
enum m68k_operand_type mode;
enum m68k_register reg;
unsigned long mask;
const char *error;
struct m68k_indexreg index;
struct m68k_exp disp;
struct m68k_exp odisp;
int trailing_ampersand;
};
#endif
extern int m68k_ip_op (char *, struct m68k_op *);
extern int flag_reg_prefix_optional;