⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mips-dis.c

📁 qemu虚拟机代码
💻 C
📖 第 1 页 / 共 5 页
字号:
/* Modifies the register in MIPS16OP_*_RX.  */#define MIPS16_INSN_WRITE_X		    0x00000001/* Modifies the register in MIPS16OP_*_RY.  */#define MIPS16_INSN_WRITE_Y		    0x00000002/* Modifies the register in MIPS16OP_*_RZ.  */#define MIPS16_INSN_WRITE_Z		    0x00000004/* Modifies the T ($24) register.  */#define MIPS16_INSN_WRITE_T		    0x00000008/* Modifies the SP ($29) register.  */#define MIPS16_INSN_WRITE_SP		    0x00000010/* Modifies the RA ($31) register.  */#define MIPS16_INSN_WRITE_31		    0x00000020/* Modifies the general purpose register in MIPS16OP_*_REG32R.  */#define MIPS16_INSN_WRITE_GPR_Y		    0x00000040/* Reads the register in MIPS16OP_*_RX.  */#define MIPS16_INSN_READ_X		    0x00000080/* Reads the register in MIPS16OP_*_RY.  */#define MIPS16_INSN_READ_Y		    0x00000100/* Reads the register in MIPS16OP_*_MOVE32Z.  */#define MIPS16_INSN_READ_Z		    0x00000200/* Reads the T ($24) register.  */#define MIPS16_INSN_READ_T		    0x00000400/* Reads the SP ($29) register.  */#define MIPS16_INSN_READ_SP		    0x00000800/* Reads the RA ($31) register.  */#define MIPS16_INSN_READ_31		    0x00001000/* Reads the program counter.  */#define MIPS16_INSN_READ_PC		    0x00002000/* Reads the general purpose register in MIPS16OP_*_REGR32.  */#define MIPS16_INSN_READ_GPR_X		    0x00004000/* Is a branch insn. */#define MIPS16_INSN_BRANCH                  0x00010000/* The following flags have the same value for the mips16 opcode   table:   INSN_UNCOND_BRANCH_DELAY   INSN_COND_BRANCH_DELAY   INSN_COND_BRANCH_LIKELY (never used)   INSN_READ_HI   INSN_READ_LO   INSN_WRITE_HI   INSN_WRITE_LO   INSN_TRAP   INSN_ISA3   */extern const struct mips_opcode mips16_opcodes[];extern const int bfd_mips16_num_opcodes;/* Short hand so the lines aren't too long.  */#define LDD     INSN_LOAD_MEMORY_DELAY#define LCD	INSN_LOAD_COPROC_DELAY#define UBD     INSN_UNCOND_BRANCH_DELAY#define CBD	INSN_COND_BRANCH_DELAY#define COD     INSN_COPROC_MOVE_DELAY#define CLD	INSN_COPROC_MEMORY_DELAY#define CBL	INSN_COND_BRANCH_LIKELY#define TRAP	INSN_TRAP#define SM	INSN_STORE_MEMORY#define WR_d    INSN_WRITE_GPR_D#define WR_t    INSN_WRITE_GPR_T#define WR_31   INSN_WRITE_GPR_31#define WR_D    INSN_WRITE_FPR_D#define WR_T	INSN_WRITE_FPR_T#define WR_S	INSN_WRITE_FPR_S#define RD_s    INSN_READ_GPR_S#define RD_b    INSN_READ_GPR_S#define RD_t    INSN_READ_GPR_T#define RD_S    INSN_READ_FPR_S#define RD_T    INSN_READ_FPR_T#define RD_R	INSN_READ_FPR_R#define WR_CC	INSN_WRITE_COND_CODE#define RD_CC	INSN_READ_COND_CODE#define RD_C0   INSN_COP#define RD_C1	INSN_COP#define RD_C2   INSN_COP#define RD_C3   INSN_COP#define WR_C0   INSN_COP#define WR_C1	INSN_COP#define WR_C2   INSN_COP#define WR_C3   INSN_COP#define WR_HI	INSN_WRITE_HI#define RD_HI	INSN_READ_HI#define MOD_HI  WR_HI|RD_HI#define WR_LO	INSN_WRITE_LO#define RD_LO	INSN_READ_LO#define MOD_LO  WR_LO|RD_LO#define WR_HILO WR_HI|WR_LO#define RD_HILO RD_HI|RD_LO#define MOD_HILO WR_HILO|RD_HILO#define IS_M    INSN_MULT#define WR_MACC INSN_WRITE_MDMX_ACC#define RD_MACC INSN_READ_MDMX_ACC#define I1	INSN_ISA1#define I2	INSN_ISA2#define I3	INSN_ISA3#define I4	INSN_ISA4#define I5	INSN_ISA5#define I32	INSN_ISA32#define I64     INSN_ISA64#define I33	INSN_ISA32R2#define I65	INSN_ISA64R2/* MIPS64 MIPS-3D ASE support.  */#define I16     INSN_MIPS16/* MIPS64 MIPS-3D ASE support.  */#define M3D     INSN_MIPS3D/* MIPS64 MDMX ASE support.  */#define MX      INSN_MDMX#define P3	INSN_4650#define L1	INSN_4010#define V1	(INSN_4100 | INSN_4111 | INSN_4120)#define T3      INSN_3900#define M1	INSN_10000#define SB1     INSN_SB1#define N411	INSN_4111#define N412	INSN_4120#define N5	(INSN_5400 | INSN_5500)#define N54	INSN_5400#define N55	INSN_5500#define G1      (T3             \                 )#define G2      (T3             \                 )#define G3      (I4             \                 )/* The order of overloaded instructions matters.  Label arguments and   register arguments look the same. Instructions that can have either   for arguments must apear in the correct order in this table for the   assembler to pick the right one. In other words, entries with   immediate operands must apear after the same instruction with   registers.   Because of the lookup algorithm used, entries with the same opcode   name must be contiguous.    Many instructions are short hand for other instructions (i.e., The   jal <register> instruction is short for jalr <register>).  */const struct mips_opcode mips_builtin_opcodes[] ={/* These instructions appear first so that the disassembler will find   them first.  The assemblers uses a hash table based on the   instruction name anyhow.  *//* name,    args,	match,	    mask,	pinfo,          	membership */{"pref",    "k,o(b)",   0xcc000000, 0xfc000000, RD_b,           	I4|I32|G3	},{"prefx",   "h,t(b)",	0x4c00000f, 0xfc0007ff, RD_b|RD_t,		I4	},{"nop",     "",         0x00000000, 0xffffffff, 0,              	I1      }, /* sll */{"ssnop",   "",         0x00000040, 0xffffffff, 0,              	I32|N55	}, /* sll */{"ehb",     "",         0x000000c0, 0xffffffff, 0,              	I33	}, /* sll */{"li",      "t,j",      0x24000000, 0xffe00000, WR_t,			I1	}, /* addiu */{"li",	    "t,i",	0x34000000, 0xffe00000, WR_t,			I1	}, /* ori */{"li",      "t,I",	0,    (int) M_LI,	INSN_MACRO,		I1	},{"move",    "d,s",	0,    (int) M_MOVE,	INSN_MACRO,		I1	},{"move",    "d,s",	0x0000002d, 0xfc1f07ff, WR_d|RD_s,		I3	},/* daddu */{"move",    "d,s",	0x00000021, 0xfc1f07ff, WR_d|RD_s,		I1	},/* addu */{"move",    "d,s",	0x00000025, 0xfc1f07ff,	WR_d|RD_s,		I1	},/* or */{"b",       "p",	0x10000000, 0xffff0000,	UBD,			I1	},/* beq 0,0 */{"b",       "p",	0x04010000, 0xffff0000,	UBD,			I1	},/* bgez 0 */{"bal",     "p",	0x04110000, 0xffff0000,	UBD|WR_31,		I1	},/* bgezal 0*/{"abs",     "d,v",	0,    (int) M_ABS,	INSN_MACRO,		I1	},{"abs.s",   "D,V",	0x46000005, 0xffff003f,	WR_D|RD_S|FP_S,		I1	},{"abs.d",   "D,V",	0x46200005, 0xffff003f,	WR_D|RD_S|FP_D,		I1	},{"abs.ps",  "D,V",	0x46c00005, 0xffff003f,	WR_D|RD_S|FP_D,		I5	},{"add",     "d,v,t",	0x00000020, 0xfc0007ff,	WR_d|RD_s|RD_t,		I1	},{"add",     "t,r,I",	0,    (int) M_ADD_I,	INSN_MACRO,		I1	},{"add.s",   "D,V,T",	0x46000000, 0xffe0003f,	WR_D|RD_S|RD_T|FP_S,	I1	},{"add.d",   "D,V,T",	0x46200000, 0xffe0003f,	WR_D|RD_S|RD_T|FP_D,	I1	},{"add.ob",  "X,Y,Q",	0x7800000b, 0xfc20003f,	WR_D|RD_S|RD_T|FP_D,	MX|SB1	},{"add.ob",  "D,S,T",	0x4ac0000b, 0xffe0003f,	WR_D|RD_S|RD_T,		N54	},{"add.ob",  "D,S,T[e]",	0x4800000b, 0xfe20003f,	WR_D|RD_S|RD_T,		N54	},{"add.ob",  "D,S,k",	0x4bc0000b, 0xffe0003f,	WR_D|RD_S|RD_T,		N54	},{"add.ps",  "D,V,T",	0x46c00000, 0xffe0003f,	WR_D|RD_S|RD_T|FP_D,	I5	},{"add.qh",  "X,Y,Q",	0x7820000b, 0xfc20003f,	WR_D|RD_S|RD_T|FP_D,	MX	},{"adda.ob", "Y,Q",	0x78000037, 0xfc2007ff,	WR_MACC|RD_S|RD_T|FP_D,	MX|SB1	},{"adda.qh", "Y,Q",	0x78200037, 0xfc2007ff,	WR_MACC|RD_S|RD_T|FP_D,	MX	},{"addi",    "t,r,j",	0x20000000, 0xfc000000,	WR_t|RD_s,		I1	},{"addiu",   "t,r,j",	0x24000000, 0xfc000000,	WR_t|RD_s,		I1	},{"addl.ob", "Y,Q",	0x78000437, 0xfc2007ff,	WR_MACC|RD_S|RD_T|FP_D,	MX|SB1	},{"addl.qh", "Y,Q",	0x78200437, 0xfc2007ff,	WR_MACC|RD_S|RD_T|FP_D,	MX	},{"addr.ps", "D,S,T",	0x46c00018, 0xffe0003f,	WR_D|RD_S|RD_T|FP_D,	M3D	},{"addu",    "d,v,t",	0x00000021, 0xfc0007ff,	WR_d|RD_s|RD_t,		I1	},{"addu",    "t,r,I",	0,    (int) M_ADDU_I,	INSN_MACRO,		I1	},{"alni.ob", "X,Y,Z,O",	0x78000018, 0xff00003f,	WR_D|RD_S|RD_T|FP_D,	MX|SB1	},{"alni.ob", "D,S,T,%",	0x48000018, 0xff00003f,	WR_D|RD_S|RD_T, 	N54	},{"alni.qh", "X,Y,Z,O",	0x7800001a, 0xff00003f,	WR_D|RD_S|RD_T|FP_D,	MX	},{"alnv.ps", "D,V,T,s",	0x4c00001e, 0xfc00003f,	WR_D|RD_S|RD_T|FP_D,	I5	},{"alnv.ob", "X,Y,Z,s",	0x78000019, 0xfc00003f,	WR_D|RD_S|RD_T|RD_s|FP_D, MX|SB1	},{"alnv.qh", "X,Y,Z,s",	0x7800001b, 0xfc00003f,	WR_D|RD_S|RD_T|RD_s|FP_D, MX	},{"and",     "d,v,t",	0x00000024, 0xfc0007ff,	WR_d|RD_s|RD_t,		I1	},{"and",     "t,r,I",	0,    (int) M_AND_I,	INSN_MACRO,		I1	},{"and.ob",  "X,Y,Q",	0x7800000c, 0xfc20003f,	WR_D|RD_S|RD_T|FP_D,	MX|SB1	},{"and.ob",  "D,S,T",	0x4ac0000c, 0xffe0003f,	WR_D|RD_S|RD_T,		N54	},{"and.ob",  "D,S,T[e]",	0x4800000c, 0xfe20003f,	WR_D|RD_S|RD_T,		N54	},{"and.ob",  "D,S,k",	0x4bc0000c, 0xffe0003f,	WR_D|RD_S|RD_T,		N54	},{"and.qh",  "X,Y,Q",	0x7820000c, 0xfc20003f,	WR_D|RD_S|RD_T|FP_D,	MX	},{"andi",    "t,r,i",	0x30000000, 0xfc000000,	WR_t|RD_s,		I1	},/* b is at the top of the table.  *//* bal is at the top of the table.  */{"bc0f",    "p",	0x41000000, 0xffff0000,	CBD|RD_CC,		I1	},{"bc0fl",   "p",	0x41020000, 0xffff0000,	CBL|RD_CC,		I2|T3	},{"bc0t",    "p",	0x41010000, 0xffff0000,	CBD|RD_CC,		I1	},{"bc0tl",   "p",	0x41030000, 0xffff0000,	CBL|RD_CC,		I2|T3	},{"bc1any2f", "N,p",	0x45200000, 0xffe30000,	CBD|RD_CC|FP_S,		M3D	},{"bc1any2t", "N,p",	0x45210000, 0xffe30000,	CBD|RD_CC|FP_S,		M3D	},{"bc1any4f", "N,p",	0x45400000, 0xffe30000,	CBD|RD_CC|FP_S,		M3D	},{"bc1any4t", "N,p",	0x45410000, 0xffe30000,	CBD|RD_CC|FP_S,		M3D	},{"bc1f",    "p",	0x45000000, 0xffff0000,	CBD|RD_CC|FP_S,		I1	},{"bc1f",    "N,p",      0x45000000, 0xffe30000, CBD|RD_CC|FP_S, 	I4|I32	},{"bc1fl",   "p",	0x45020000, 0xffff0000,	CBL|RD_CC|FP_S,		I2|T3	},{"bc1fl",   "N,p",      0x45020000, 0xffe30000, CBL|RD_CC|FP_S, 	I4|I32	},{"bc1t",    "p",	0x45010000, 0xffff0000,	CBD|RD_CC|FP_S,		I1	},{"bc1t",    "N,p",      0x45010000, 0xffe30000, CBD|RD_CC|FP_S, 	I4|I32	},{"bc1tl",   "p",	0x45030000, 0xffff0000,	CBL|RD_CC|FP_S,		I2|T3	},{"bc1tl",   "N,p",      0x45030000, 0xffe30000, CBL|RD_CC|FP_S, 	I4|I32	},/* bc2* are at the bottom of the table.  */{"bc3f",    "p",	0x4d000000, 0xffff0000,	CBD|RD_CC,		I1	},{"bc3fl",   "p",	0x4d020000, 0xffff0000,	CBL|RD_CC,		I2|T3	},{"bc3t",    "p",	0x4d010000, 0xffff0000,	CBD|RD_CC,		I1	},{"bc3tl",   "p",	0x4d030000, 0xffff0000,	CBL|RD_CC,		I2|T3	},{"beqz",    "s,p",	0x10000000, 0xfc1f0000,	CBD|RD_s,		I1	},{"beqzl",   "s,p",	0x50000000, 0xfc1f0000,	CBL|RD_s,		I2|T3	},{"beq",     "s,t,p",	0x10000000, 0xfc000000,	CBD|RD_s|RD_t,		I1	},{"beq",     "s,I,p",	0,    (int) M_BEQ_I,	INSN_MACRO,		I1	},{"beql",    "s,t,p",	0x50000000, 0xfc000000,	CBL|RD_s|RD_t,		I2|T3	},{"beql",    "s,I,p",	0,    (int) M_BEQL_I,	INSN_MACRO,		I2|T3	},{"bge",     "s,t,p",	0,    (int) M_BGE,	INSN_MACRO,		I1	},{"bge",     "s,I,p",	0,    (int) M_BGE_I,	INSN_MACRO,		I1	},{"bgel",    "s,t,p",	0,    (int) M_BGEL,	INSN_MACRO,		I2|T3	},{"bgel",    "s,I,p",	0,    (int) M_BGEL_I,	INSN_MACRO,		I2|T3	},{"bgeu",    "s,t,p",	0,    (int) M_BGEU,	INSN_MACRO,		I1	},{"bgeu",    "s,I,p",	0,    (int) M_BGEU_I,	INSN_MACRO,		I1	},{"bgeul",   "s,t,p",	0,    (int) M_BGEUL,	INSN_MACRO,		I2|T3	},{"bgeul",   "s,I,p",	0,    (int) M_BGEUL_I,	INSN_MACRO,		I2|T3	},{"bgez",    "s,p",	0x04010000, 0xfc1f0000,	CBD|RD_s,		I1	},{"bgezl",   "s,p",	0x04030000, 0xfc1f0000,	CBL|RD_s,		I2|T3	},{"bgezal",  "s,p",	0x04110000, 0xfc1f0000,	CBD|RD_s|WR_31,		I1	},{"bgezall", "s,p",	0x04130000, 0xfc1f0000,	CBL|RD_s|WR_31,		I2|T3	},{"bgt",     "s,t,p",	0,    (int) M_BGT,	INSN_MACRO,		I1	},{"bgt",     "s,I,p",	0,    (int) M_BGT_I,	INSN_MACRO,		I1	},{"bgtl",    "s,t,p",	0,    (int) M_BGTL,	INSN_MACRO,		I2|T3	},{"bgtl",    "s,I,p",	0,    (int) M_BGTL_I,	INSN_MACRO,		I2|T3	},{"bgtu",    "s,t,p",	0,    (int) M_BGTU,	INSN_MACRO,		I1	},{"bgtu",    "s,I,p",	0,    (int) M_BGTU_I,	INSN_MACRO,		I1	},{"bgtul",   "s,t,p",	0,    (int) M_BGTUL,	INSN_MACRO,		I2|T3	},{"bgtul",   "s,I,p",	0,    (int) M_BGTUL_I,	INSN_MACRO,		I2|T3	},{"bgtz",    "s,p",	0x1c000000, 0xfc1f0000,	CBD|RD_s,		I1	},{"bgtzl",   "s,p",	0x5c000000, 0xfc1f0000,	CBL|RD_s,		I2|T3	},{"ble",     "s,t,p",	0,    (int) M_BLE,	INSN_MACRO,		I1	},{"ble",     "s,I,p",	0,    (int) M_BLE_I,	INSN_MACRO,		I1	},{"blel",    "s,t,p",	0,    (int) M_BLEL,	INSN_MACRO,		I2|T3	},{"blel",    "s,I,p",	0,    (int) M_BLEL_I,	INSN_MACRO,		I2|T3	},{"bleu",    "s,t,p",	0,    (int) M_BLEU,	INSN_MACRO,		I1	},{"bleu",    "s,I,p",	0,    (int) M_BLEU_I,	INSN_MACRO,		I1	},{"bleul",   "s,t,p",	0,    (int) M_BLEUL,	INSN_MACRO,		I2|T3	},{"bleul",   "s,I,p",	0,    (int) M_BLEUL_I,	INSN_MACRO,		I2|T3	},{"blez",    "s,p",	0x18000000, 0xfc1f0000,	CBD|RD_s,		I1	},{"blezl",   "s,p",	0x58000000, 0xfc1f0000,	CBL|RD_s,		I2|T3	},{"blt",     "s,t,p",	0,    (int) M_BLT,	INSN_MACRO,		I1	},{"blt",     "s,I,p",	0,    (int) M_BLT_I,	INSN_MACRO,		I1	},{"bltl",    "s,t,p",	0,    (int) M_BLTL,	INSN_MACRO,		I2|T3	},{"bltl",    "s,I,p",	0,    (int) M_BLTL_I,	INSN_MACRO,		I2|T3	},{"bltu",    "s,t,p",	0,    (int) M_BLTU,	INSN_MACRO,		I1	},{"bltu",    "s,I,p",	0,    (int) M_BLTU_I,	INSN_MACRO,		I1	},{"bltul",   "s,t,p",	0,    (int) M_BLTUL,	INSN_MACRO,		I2|T3	},{"bltul",   "s,I,p",	0,    (int) M_BLTUL_I,	INSN_MACRO,		I2|T3	},{"bltz",    "s,p",	0x04000000, 0xfc1f0000,	CBD|RD_s,		I1	},{"bltzl",   "s,p",	0x04020000, 0xfc1f0000,	CBL|RD_s,		I2|T3	},{"bltzal",  "s,p",	0x04100000, 0xfc1f0000,	CBD|RD_s|WR_31,		I1	},{"bltzall", "s,p",	0x04120000, 0xfc1f0000,	CBL|RD_s|WR_31,		I2|T3	},{"bnez",    "s,p",	0x14000000, 0xfc1f0000,	CBD|RD_s,		I1	},{"bnezl",   "s,p",	0x54000000, 0xfc1f0000,	CBL|RD_s,		I2|T3	},{"bne",     "s,t,p",	0x14000000, 0xfc000000,	CBD|RD_s|RD_t,		I1	},{"bne",     "s,I,p",	0,    (int) M_BNE_I,	INSN_MACRO,		I1	},{"bnel",    "s,t,p",	0x54000000, 0xfc000000,	CBL|RD_s|RD_t, 		I2|T3	},{"bnel",    "s,I,p",	0,    (int) M_BNEL_I,	INSN_MACRO,		I2|T3	},{"break",   "",		0x0000000d, 0xffffffff,	TRAP,			I1	},{"break",   "c",	0x0000000d, 0xfc00ffff,	TRAP,			I1	},{"break",   "c,q",	0x0000000d, 0xfc00003f,	TRAP,			I1	},{"c.f.d",   "S,T",	0x46200030, 0xffe007ff,	RD_S|RD_T|WR_CC|FP_D,	I1	},{"c.f.d",   "M,S,T",    0x46200030, 0xffe000ff, RD_S|RD_T|WR_CC|FP_D,   I4|I32	},{"c.f.s",   "S,T",      0x46000030, 0xffe007ff, RD_S|RD_T|WR_CC|FP_S,   I1      },{"c.f.s",   "M,S,T",    0x46000030, 0xffe000ff, RD_S|RD_T|WR_CC|FP_S,   I4|I32	},{"c.f.ps",  "S,T",	0x46c00030, 0xffe007ff,	RD_S|RD_T|WR_CC|FP_D,	I5	},{"c.f.ps",  "M,S,T",	0x46c00030, 0xffe000ff,	RD_S|RD_T|WR_CC|FP_D,	I5	},

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -