📄 arm-dis.c.svn-base
字号:
/* Instruction printing code for the ARM Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 2007, Free Software Foundation, Inc. Contributed by Richard Earnshaw (rwe@pegasus.esprit.ec.org) Modification by James G. Smith (jsmith@cygnus.co.uk) This file is part of libopcodes. This program 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 2 of the License, or (at your option) any later version. This program 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 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. *//* Start of qemu specific additions. Mostly this is stub definitions for things we don't care about. */#include "dis-asm.h"#define FALSE 0#define TRUE (!FALSE)#define ATTRIBUTE_UNUSED __attribute__((unused))#define ISSPACE(x) ((x) == ' ' || (x) == '\t' || (x) == '\n')#define ARM_EXT_V1 0#define ARM_EXT_V2 0#define ARM_EXT_V2S 0#define ARM_EXT_V3 0#define ARM_EXT_V3M 0#define ARM_EXT_V4 0#define ARM_EXT_V4T 0#define ARM_EXT_V5 0#define ARM_EXT_V5T 0#define ARM_EXT_V5ExP 0#define ARM_EXT_V5E 0#define ARM_EXT_V5J 0#define ARM_EXT_V6 0#define ARM_EXT_V6K 0#define ARM_EXT_V6Z 0#define ARM_EXT_V6T2 0#define ARM_EXT_V7 0#define ARM_EXT_DIV 0/* Co-processor space extensions. */#define ARM_CEXT_XSCALE 0#define ARM_CEXT_MAVERICK 0#define ARM_CEXT_IWMMXT 0#define FPU_FPA_EXT_V1 0#define FPU_FPA_EXT_V2 0#define FPU_VFP_EXT_NONE 0#define FPU_VFP_EXT_V1xD 0#define FPU_VFP_EXT_V1 0#define FPU_VFP_EXT_V2 0#define FPU_MAVERICK 0#define FPU_VFP_EXT_V3 0#define FPU_NEON_EXT_V1 0int floatformat_ieee_single_little;/* Assume host uses ieee float. */static void floatformat_to_double (int *ignored, unsigned char *data, double *dest){ union { uint32_t i; float f; } u; u.i = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24); *dest = u.f;}/* End of qemu specific additions. *//* FIXME: Belongs in global header. */#ifndef strneq#define strneq(a,b,n) (strncmp ((a), (b), (n)) == 0)#endif#ifndef NUM_ELEM#define NUM_ELEM(a) (sizeof (a) / sizeof (a)[0])#endifstruct opcode32{ unsigned long arch; /* Architecture defining this insn. */ unsigned long value, mask; /* Recognise insn if (op&mask)==value. */ const char *assembler; /* How to disassemble this insn. */};struct opcode16{ unsigned long arch; /* Architecture defining this insn. */ unsigned short value, mask; /* Recognise insn if (op&mask)==value. */ const char *assembler; /* How to disassemble this insn. */};/* print_insn_coprocessor recognizes the following format control codes: %% % %c print condition code (always bits 28-31 in ARM mode) %q print shifter argument %u print condition code (unconditional in ARM mode) %A print address for ldc/stc/ldf/stf instruction %B print vstm/vldm register list %C print vstr/vldr address operand %I print cirrus signed shift immediate: bits 0..3|4..6 %F print the COUNT field of a LFM/SFM instruction. %P print floating point precision in arithmetic insn %Q print floating point precision in ldf/stf insn %R print floating point rounding mode %<bitfield>r print as an ARM register %<bitfield>d print the bitfield in decimal %<bitfield>k print immediate for VFPv3 conversion instruction %<bitfield>x print the bitfield in hex %<bitfield>X print the bitfield as 1 hex digit without leading "0x" %<bitfield>f print a floating point constant if >7 else a floating point register %<bitfield>w print as an iWMMXt width field - [bhwd]ss/us %<bitfield>g print as an iWMMXt 64-bit register %<bitfield>G print as an iWMMXt general purpose or control register %<bitfield>D print as a NEON D register %<bitfield>Q print as a NEON Q register %y<code> print a single precision VFP reg. Codes: 0=>Sm, 1=>Sd, 2=>Sn, 3=>multi-list, 4=>Sm pair %z<code> print a double precision VFP reg Codes: 0=>Dm, 1=>Dd, 2=>Dn, 3=>multi-list %<bitfield>'c print specified char iff bitfield is all ones %<bitfield>`c print specified char iff bitfield is all zeroes %<bitfield>?ab... select from array of values in big endian order %L print as an iWMMXt N/M width field. %Z print the Immediate of a WSHUFH instruction. %l like 'A' except use byte offsets for 'B' & 'H' versions. %i print 5-bit immediate in bits 8,3..0 (print "32" when 0) %r print register offset address for wldt/wstr instruction*//* Common coprocessor opcodes shared between Arm and Thumb-2. */static const struct opcode32 coprocessor_opcodes[] ={ /* XScale instructions. */ {ARM_CEXT_XSCALE, 0x0e200010, 0x0fff0ff0, "mia%c\tacc0, %0-3r, %12-15r"}, {ARM_CEXT_XSCALE, 0x0e280010, 0x0fff0ff0, "miaph%c\tacc0, %0-3r, %12-15r"}, {ARM_CEXT_XSCALE, 0x0e2c0010, 0x0ffc0ff0, "mia%17'T%17`B%16'T%16`B%c\tacc0, %0-3r, %12-15r"}, {ARM_CEXT_XSCALE, 0x0c400000, 0x0ff00fff, "mar%c\tacc0, %12-15r, %16-19r"}, {ARM_CEXT_XSCALE, 0x0c500000, 0x0ff00fff, "mra%c\t%12-15r, %16-19r, acc0"}, /* Intel Wireless MMX technology instructions. */#define FIRST_IWMMXT_INSN 0x0e130130#define IWMMXT_INSN_COUNT 73 {ARM_CEXT_IWMMXT, 0x0e130130, 0x0f3f0fff, "tandc%22-23w%c\t%12-15r"}, {ARM_CEXT_XSCALE, 0x0e400010, 0x0ff00f3f, "tbcst%6-7w%c\t%16-19g, %12-15r"}, {ARM_CEXT_XSCALE, 0x0e130170, 0x0f3f0ff8, "textrc%22-23w%c\t%12-15r, #%0-2d"}, {ARM_CEXT_XSCALE, 0x0e100070, 0x0f300ff0, "textrm%3?su%22-23w%c\t%12-15r, %16-19g, #%0-2d"}, {ARM_CEXT_XSCALE, 0x0e600010, 0x0ff00f38, "tinsr%6-7w%c\t%16-19g, %12-15r, #%0-2d"}, {ARM_CEXT_XSCALE, 0x0e000110, 0x0ff00fff, "tmcr%c\t%16-19G, %12-15r"}, {ARM_CEXT_XSCALE, 0x0c400000, 0x0ff00ff0, "tmcrr%c\t%0-3g, %12-15r, %16-19r"}, {ARM_CEXT_XSCALE, 0x0e2c0010, 0x0ffc0e10, "tmia%17?tb%16?tb%c\t%5-8g, %0-3r, %12-15r"}, {ARM_CEXT_XSCALE, 0x0e200010, 0x0fff0e10, "tmia%c\t%5-8g, %0-3r, %12-15r"}, {ARM_CEXT_XSCALE, 0x0e280010, 0x0fff0e10, "tmiaph%c\t%5-8g, %0-3r, %12-15r"}, {ARM_CEXT_XSCALE, 0x0e100030, 0x0f300fff, "tmovmsk%22-23w%c\t%12-15r, %16-19g"}, {ARM_CEXT_XSCALE, 0x0e100110, 0x0ff00ff0, "tmrc%c\t%12-15r, %16-19G"}, {ARM_CEXT_XSCALE, 0x0c500000, 0x0ff00ff0, "tmrrc%c\t%12-15r, %16-19r, %0-3g"}, {ARM_CEXT_XSCALE, 0x0e130150, 0x0f3f0fff, "torc%22-23w%c\t%12-15r"}, {ARM_CEXT_XSCALE, 0x0e130190, 0x0f3f0fff, "torvsc%22-23w%c\t%12-15r"}, {ARM_CEXT_XSCALE, 0x0e2001c0, 0x0f300fff, "wabs%22-23w%c\t%12-15g, %16-19g"}, {ARM_CEXT_XSCALE, 0x0e0001c0, 0x0f300fff, "wacc%22-23w%c\t%12-15g, %16-19g"}, {ARM_CEXT_XSCALE, 0x0e000180, 0x0f000ff0, "wadd%20-23w%c\t%12-15g, %16-19g, %0-3g"}, {ARM_CEXT_XSCALE, 0x0e2001a0, 0x0f300ff0, "waddbhus%22?ml%c\t%12-15g, %16-19g, %0-3g"}, {ARM_CEXT_XSCALE, 0x0ea001a0, 0x0ff00ff0, "waddsubhx%c\t%12-15g, %16-19g, %0-3g"}, {ARM_CEXT_XSCALE, 0x0e000020, 0x0f800ff0, "waligni%c\t%12-15g, %16-19g, %0-3g, #%20-22d"}, {ARM_CEXT_XSCALE, 0x0e800020, 0x0fc00ff0, "walignr%20-21d%c\t%12-15g, %16-19g, %0-3g"}, {ARM_CEXT_XSCALE, 0x0e200000, 0x0fe00ff0, "wand%20'n%c\t%12-15g, %16-19g, %0-3g"}, {ARM_CEXT_XSCALE, 0x0e800000, 0x0fa00ff0, "wavg2%22?hb%20'r%c\t%12-15g, %16-19g, %0-3g"}, {ARM_CEXT_XSCALE, 0x0e400000, 0x0fe00ff0, "wavg4%20'r%c\t%12-15g, %16-19g, %0-3g"}, {ARM_CEXT_XSCALE, 0x0e000060, 0x0f300ff0, "wcmpeq%22-23w%c\t%12-15g, %16-19g, %0-3g"}, {ARM_CEXT_XSCALE, 0x0e100060, 0x0f100ff0, "wcmpgt%21?su%22-23w%c\t%12-15g, %16-19g, %0-3g"}, {ARM_CEXT_XSCALE, 0xfc500100, 0xfe500f00, "wldrd\t%12-15g, %r"}, {ARM_CEXT_XSCALE, 0xfc100100, 0xfe500f00, "wldrw\t%12-15G, %A"},
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -