Copyright 1999, 2000, 2001 Free Software Foundation, Inc.
Written by Timothy Wall (twall@cygnus.com)
This file is part of GDB, GAS, and the GNU binutils.
GDB, GAS, and the GNU binutils are free software; you can redistribute
them and/or modify them under the terms of the GNU General Public
License as published by the Free Software Foundation; either version
1, or (at your option) any later version.
GDB, GAS, and the GNU binutils are distributed in the hope that they
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 this file; see the file COPYING. If not, write to the Free
Software Foundation, 51 Franklin Street - Fifth Floor, Boston, MA
02110-1301, USA. */
#ifndef _opcode_tic54x_h_
#define _opcode_tic54x_h_
typedef struct _symbol
{
const char *name;
unsigned short value;
} symbol;
enum optype {
OPT = 0x8000,
OP_None = 0x0,
OP_Xmem,
OP_Ymem,
OP_pmad,
OP_dmad,
OP_Smem,
OP_Lmem,
OP_MMR,
OP_PA,
OP_Sind,
OP_xpmad,
OP_xpmad_ms7,
OP_MMRX,
OP_MMRY,
OP_SRC1,
OP_SRC,
OP_RND,
OP_DST,
OP_ARX,
OP_SHIFT,
OP_SHFT,
OP_B,
OP_A,
OP_lk,
OP_TS,
OP_k8,
OP_16,
OP_BITC,
OP_CC,
OP_CC2,
OP_CC3,
OP_123,
OP_031,
OP_k5,
OP_k8u,
OP_ASM,
OP_T,
OP_DP,
OP_ARP,
OP_k3,
OP_lku,
OP_N,
OP_SBIT,
OP_12,
OP_k9,
OP_TRN,
};
typedef struct _template
{
const char *name;
unsigned int words;
int minops, maxops;
Instructions with more than 16 bits of opcode store the rest in the upper
16 bits.
*/
unsigned short opcode;
#define INDIRECT(OP) ((OP)&0x80)
#define MOD(OP) (((OP)>>3)&0xF)
#define ARF(OP) ((OP)&0x7)
#define IS_LKADDR(OP) (INDIRECT(OP) && MOD(OP)>=12)
#define SRC(OP) ((OP)&0x200)
#define DST(OP) ((OP)&0x100)
#define SRC1(OP) ((OP)&0x100)
#define SHIFT(OP) (((OP)&0x10)?(((OP)&0x1F)-32):((OP)&0x1F))
#define SHFT(OP) ((OP)&0xF)
#define ARX(OP) ((OP)&0x7)
#define XMEM(OP) (((OP)&0x00F0)>>4)
#define YMEM(OP) ((OP)&0x000F)
#define XMOD(C) (((C)&0xC)>>2)
#define XARX(C) (((C)&0x3)+2)
#define CC3(OP) (((OP)>>8)&0x3)
#define SBIT(OP) ((OP)&0xF)
#define MMR(OP) ((OP)&0x7F)
#define MMRX(OP) ((((OP)>>4)&0xF)+16)
#define MMRY(OP) (((OP)&0xF)+16)
#define OPTYPE(X) ((X)&~OPT)
Zeroes indicate don't care bits (operands and/or opcode options) */
unsigned short mask;
#define MAX_OPERANDS 4
enum optype operand_types[MAX_OPERANDS];
*/
unsigned short flags;
#define B_NEXT 0 /* normal execution, next insn is next address */
#define B_BRANCH 1 /* next insn is in opcode */
#define B_RET 2 /* next insn is on stack */
#define B_BACC 3 /* next insn is in acc */
#define B_REPEAT 4 /* next insn repeats */
#define FL_BMASK 0x07
#define FL_DELAY 0x10 /* instruction uses delay slots */
#define FL_EXT 0x20 /* instruction takes two words */
#define FL_FAR 0x40 /* far mode addressing */
#define FL_LP 0x80 /* LP-only instruction */
#define FL_NR 0x100 /* no repeat allowed */
#define FL_SMR 0x200 /* Smem read (for flagging write-only *+ARx */
#define FL_PAR 0x400 /* Parallel instruction. */
unsigned short opcode2, mask2;
const char* parname;
enum optype paroperand_types[MAX_OPERANDS];
} template;
extern const template tic54x_unknown_opcode;
extern const template tic54x_optab[];
extern const template tic54x_paroptab[];
extern const symbol mmregs[], regs[];
extern const symbol condition_codes[], cc2_codes[], status_bits[];
extern const symbol cc3_codes[];
extern const char *misc_symbols[];
struct disassemble_info;
extern const template* tic54x_get_insn (struct disassemble_info *,
bfd_vma, unsigned short, int *);
#endif