diff --git a/desmume/src/Disassembler.c b/desmume/src/Disassembler.c new file mode 100644 index 000000000..8365e71c5 --- /dev/null +++ b/desmume/src/Disassembler.c @@ -0,0 +1,3692 @@ +/* Copyright (C) 2006 yopyop + yopyop156@ifrance.com + yopyop156.ifrance.com + + This file is part of DeSmuME + + DeSmuME 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. + + DeSmuME 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 DeSmuME; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include "Disassembler.h" +#include "bits.h" + +#define ROR(i, j) ((((u32)(i))>>(j)) | (((u32)(i))<<(32-(j)))) + +const char Condition[16][3] = { + "EQ", + "NE", + "CS", + "CC", + "MI", + "PL", + "VS", + "VC", + "HI", + "LS", + "GE", + "LT", + "GT", + "LE", + "", + "" + }; + +const char Registre[16][4] = { + "R0", + "R1", + "R2", + "R3", + "R4", + "R5", + "R6", + "R7", + "R8", + "R9", + "R10", + "R11", + "R12", + "SP", + "LR", + "PC", + }; + +const char MSR_FIELD[16][5] = { + "", + "c", + "x", + "xc", + "s", + "sc", + "sx", + "sxc", + "f", + "fc", + "fx", + "fxc", + "fs", + "fsc", + "fsx", + "fsxc" + }; + +#define DATAPROC_LSL_IMM(nom, s) char tmp[10] = "";\ + if(((i>>7)&0x1F)!=0)\ + sprintf(tmp, ", LSL #%X", (int)((i>>7)&0x1F));\ + sprintf(txt, "%s%s%s %s, %s, %s%s",\ + #nom,\ + Condition[CONDITION(i)],\ + s,\ + Registre[REG_POS(i,12)],\ + Registre[REG_POS(i,16)],\ + Registre[REG_POS(i,0)],\ + tmp); +#define DATAPROC_ROR_IMM(nom, s) char tmp[10] = "";\ + if(((i>>7)&0x1F)!=0)\ + sprintf(tmp, ", RRX");\ + sprintf(txt, "%s%s%s %s, %s, %s%s",\ + #nom,\ + Condition[CONDITION(i)],\ + s,\ + Registre[REG_POS(i,12)],\ + Registre[REG_POS(i,16)],\ + Registre[REG_POS(i,0)],\ + tmp\ + ); + +#define DATAPROC_REG_SHIFT(nom, shift,s) sprintf(txt, "%s%s%s %s, %s, %s, %s %s",\ + #nom,\ + Condition[CONDITION(i)],\ + s,\ + Registre[REG_POS(i,12)],\ + Registre[REG_POS(i,16)],\ + Registre[REG_POS(i,0)],\ + #shift,\ + Registre[REG_POS(i,8)]\ + ); + +#define DATAPROC_IMM_SHIFT(nom, shift, s) sprintf(txt, "%s%s%s %s, %s, %s, %s #%X",\ + #nom,\ + Condition[CONDITION(i)],\ + s,\ + Registre[REG_POS(i,12)],\ + Registre[REG_POS(i,16)],\ + Registre[REG_POS(i,0)],\ + #shift,\ + (int)((i>>7)&0x1F)\ + ); + +#define DATAPROC_IMM_VALUE(nom,s) u32 shift_op = ROR((i&0xFF), (i>>7)&0x1E);\ + sprintf(txt, "%s%s%s %s, %s, #%X",\ + #nom,\ + Condition[CONDITION(i)],\ + s,\ + Registre[REG_POS(i,12)],\ + Registre[REG_POS(i,16)],\ + (int)shift_op\ + ); + +#define DATAPROC_ONE_OP_LSL_IMM(nom, s, v) char tmp[10] = "";\ + if(((i>>7)&0x1F)!=0)\ + sprintf(tmp, ", LSL #%X", (int)((i>>7)&0x1F));\ + sprintf(txt, "%s%s%s %s, %s%s",\ + #nom,\ + Condition[CONDITION(i)],\ + s,\ + Registre[REG_POS(i,v)],\ + Registre[REG_POS(i,0)],\ + tmp); + +#define DATAPROC_ONE_OP_ROR_IMM(nom, s, v) char tmp[10] = "";\ + if(((i>>7)&0x1F)==0)\ + sprintf(tmp, ", RRX");\ + else\ + sprintf(tmp, ", ROR %d", (int)((i>>7)&0x1F));\ + sprintf(txt, "%s%s%s %s, %s%s",\ + #nom,\ + Condition[CONDITION(i)],\ + s,\ + Registre[REG_POS(i,v)],\ + Registre[REG_POS(i,0)],\ + tmp\ + ); + +#define DATAPROC_ONE_OP_REG_SHIFT(nom, shift,s, v) sprintf(txt, "%s%s%s %s, %s, %s %s",\ + #nom,\ + Condition[CONDITION(i)],\ + s,\ + Registre[REG_POS(i,v)],\ + Registre[REG_POS(i,0)],\ + #shift,\ + Registre[REG_POS(i,8)]\ + ); + +#define DATAPROC_ONE_OP_IMM_SHIFT(nom, shift, s, v) sprintf(txt, "%s%s%s %s, %s, %s #%X",\ + #nom,\ + Condition[CONDITION(i)],\ + s,\ + Registre[REG_POS(i,v)],\ + Registre[REG_POS(i,0)],\ + #shift,\ + (int)((i>>7)&0x1F)\ + ); + +#define DATAPROC_ONE_OP_IMM_VALUE(nom, s, v)\ + u32 shift_op = ROR((i&0xFF), (i>>7)&0x1E);\ + sprintf(txt, "%s%s%s %s, #%X",\ + #nom,\ + Condition[CONDITION(i)],\ + s,\ + Registre[REG_POS(i,v)],\ + (int)shift_op\ + ); + +#define SIGNEXTEND_24(i) (((i)&0xFFFFFF)|(0xFF000000*BIT23(i))) + +#define LDRSTR_LSL_IMM(nom, op, op2, op3) char tmp[10] = "";\ + if(((i>>7)&0x1F)!=0)\ + sprintf(tmp, ", LSL #%X", (int)((i>>7)&0x1F));\ + sprintf(txt, "%s%s %s, [%s%s, %s%s%s%s",\ + #nom,\ + Condition[CONDITION(i)],\ + Registre[REG_POS(i,12)],\ + Registre[REG_POS(i,16)],\ + op2,\ + op,\ + Registre[REG_POS(i,0)],\ + tmp,\ + op3); +#define LDRSTR_ROR_IMM(nom, op, op2, op3) char tmp[10] = "";\ + if(((i>>7)&0x1F)!=0)\ + sprintf(tmp, ", RRX");\ + sprintf(txt, "%s%s %s, [%s%s, %s%s%s%s",\ + #nom,\ + Condition[CONDITION(i)],\ + Registre[REG_POS(i,12)],\ + Registre[REG_POS(i,16)],\ + op2,\ + op,\ + Registre[REG_POS(i,0)],\ + tmp,\ + op3\ + ); + +#define LDRSTR_IMM_SHIFT(nom, shift, op, op2, op3)\ + sprintf(txt, "%s%s %s, [%s%s, %s%s, %s #%X%s",\ + #nom,\ + Condition[CONDITION(i)],\ + Registre[REG_POS(i,12)],\ + Registre[REG_POS(i,16)],\ + op2,\ + op,\ + Registre[REG_POS(i,0)],\ + #shift,\ + (int)((i>>7)&0x1F),\ + op3\ + ); + +#define RegList(nb) char lreg[100] = "";\ + int prec = 0;\ + int j;\ + for(j = 0; j < nb; j++)\ + {\ + if(prec)\ + {\ + if((!BIT_N(i, j+1))||(j==nb-1))\ + {\ + sprintf(lreg, "%s%s,", lreg, Registre[j]);\ + prec = 0;\ + }\ + }\ + else\ + {\ + if(BIT_N(i, j))\ + {\ + if((BIT_N(i, j+1))&&(j!=nb-1))\ + {\ + sprintf(lreg, "%s%s-", lreg, Registre[j]);\ + prec = 1;\ + }\ + else\ + sprintf(lreg, "%s%s,", lreg, Registre[j]);\ + }\ + }\ + }\ + lreg[strlen(lreg)-1]='\0'; + +char * OP_UND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "----"); + return txt; +} + +//-----------------------AND------------------------------------ +char * OP_AND_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(AND, ""); + return txt; +} + +char * OP_AND_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(AND, LSL, ""); + return txt; +} + +char * OP_AND_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(AND, LSR, ""); + return txt; +} + +char * OP_AND_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(AND, LSR, ""); + return txt; +} + +char * OP_AND_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(AND, ASR, ""); + return txt; +} + +char * OP_AND_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(AND, ASR, ""); + return txt; +} + +char * OP_AND_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(AND, ""); + return txt; +} + +char * OP_AND_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(AND, ROR, ""); + return txt; +} + +char * OP_AND_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(AND, ""); + return txt; +} + +char * OP_AND_S_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(AND, "S"); + return txt; +} + +char * OP_AND_S_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(AND, LSL, "S"); + return txt; +} + +char * OP_AND_S_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(AND, LSR, "S"); + return txt; +} + +char * OP_AND_S_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(AND, LSR, "S"); + return txt; +} + +char * OP_AND_S_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(AND, ASR, "S"); + return txt; +} + +char * OP_AND_S_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(AND, ASR, "S"); + return txt; +} + +char * OP_AND_S_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(AND, "S"); + return txt; +} + +char * OP_AND_S_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(AND, ROR, "S"); + return txt; +} + +char * OP_AND_S_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(AND, "S"); + return txt; +} + +//--------------EOR------------------------------ +char * OP_EOR_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(EOR, ""); + return txt; +} + +char * OP_EOR_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(EOR, LSL, ""); + return txt; +} + +char * OP_EOR_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(EOR, LSR, ""); + return txt; +} + +char * OP_EOR_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(EOR, LSR, ""); + return txt; +} + +char * OP_EOR_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(EOR, ASR, ""); + return txt; +} + +char * OP_EOR_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(EOR, ASR, ""); + return txt; +} + +char * OP_EOR_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(EOR, ""); + return txt; +} + +char * OP_EOR_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(EOR, ROR, ""); + return txt; +} + +char * OP_EOR_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(EOR, ""); + return txt; +} + +char * OP_EOR_S_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(EOR, "S"); + return txt; +} + +char * OP_EOR_S_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(EOR, LSL, "S"); + return txt; +} + +char * OP_EOR_S_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(EOR, LSR, "S"); + return txt; +} + +char * OP_EOR_S_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(EOR, LSR, "S"); + return txt; +} + +char * OP_EOR_S_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(EOR, ASR, "S"); + return txt; +} + +char * OP_EOR_S_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(EOR, ASR, "S"); + return txt; +} + +char * OP_EOR_S_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(EOR, "S"); + return txt; +} + +char * OP_EOR_S_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(EOR, ROR, "S"); + return txt; +} + +char * OP_EOR_S_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(EOR, "S"); + return txt; +} + +//-------------SUB------------------------------------- + +char * OP_SUB_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(SUB, ""); + return txt; +} + +char * OP_SUB_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(SUB, LSL, ""); + return txt; +} + +char * OP_SUB_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(SUB, LSR, ""); + return txt; +} + +char * OP_SUB_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(SUB, LSR, ""); + return txt; +} + +char * OP_SUB_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(SUB, ASR, ""); + return txt; +} + +char * OP_SUB_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(SUB, ASR, ""); +return txt;} + +char * OP_SUB_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(SUB, ""); +return txt;} + +char * OP_SUB_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(SUB, ROR, ""); +return txt;} + +char * OP_SUB_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(SUB, ""); +return txt;} + +char * OP_SUB_S_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(SUB, "S"); +return txt;} + +char * OP_SUB_S_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(SUB, LSL, "S"); +return txt;} + +char * OP_SUB_S_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(SUB, LSR, "S"); +return txt;} + +char * OP_SUB_S_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(SUB, LSR, "S"); +return txt;} + +char * OP_SUB_S_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(SUB, ASR, "S"); +return txt;} + +char * OP_SUB_S_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(SUB, ASR, "S"); +return txt;} + +char * OP_SUB_S_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(SUB, "S"); +return txt;} + +char * OP_SUB_S_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(SUB, ROR, "S"); +return txt;} + +char * OP_SUB_S_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(SUB, "S"); +return txt;} + +//------------------RSB------------------------ + +char * OP_RSB_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(RSB, ""); +return txt;} + +char * OP_RSB_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(RSB, LSL, ""); +return txt;} + +char * OP_RSB_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(RSB, LSR, ""); +return txt;} + +char * OP_RSB_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(RSB, LSR, ""); +return txt;} + +char * OP_RSB_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(RSB, ASR, ""); +return txt;} + +char * OP_RSB_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(RSB, ASR, ""); +return txt;} + +char * OP_RSB_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(RSB, ""); +return txt;} + +char * OP_RSB_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(RSB, ROR, ""); +return txt;} + +char * OP_RSB_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(RSB, ""); +return txt;} + +char * OP_RSB_S_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(RSB, "S"); +return txt;} + +char * OP_RSB_S_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(RSB, LSL, "S"); +return txt;} + +char * OP_RSB_S_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(RSB, LSR, "S"); +return txt;} + +char * OP_RSB_S_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(RSB, LSR, "S"); +return txt;} + +char * OP_RSB_S_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(RSB, ASR, "S"); +return txt;} + +char * OP_RSB_S_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(RSB, ASR, "S"); +return txt;} + +char * OP_RSB_S_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(RSB, "S"); +return txt;} + +char * OP_RSB_S_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(RSB, ROR, "S"); +return txt;} + +char * OP_RSB_S_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(RSB, "S"); +return txt;} + +//------------------ADD----------------------------------- + +char * OP_ADD_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(ADD, ""); +return txt;} + +char * OP_ADD_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ADD, LSL, ""); +return txt;} + +char * OP_ADD_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(ADD, LSR, ""); +return txt;} + +char * OP_ADD_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ADD, LSR, ""); +return txt;} + +char * OP_ADD_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(ADD, ASR, ""); +return txt;} + +char * OP_ADD_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ADD, ASR, ""); +return txt;} + +char * OP_ADD_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(ADD, ""); +return txt;} + +char * OP_ADD_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ADD, ROR, ""); +return txt;} + +char * OP_ADD_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(ADD, ""); +return txt;} + +char * OP_ADD_S_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(ADD, "S"); +return txt;} + +char * OP_ADD_S_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ADD, LSL, "S"); +return txt;} + +char * OP_ADD_S_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(ADD, LSR, "S"); +return txt;} + +char * OP_ADD_S_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ADD, LSR, "S"); +return txt;} + +char * OP_ADD_S_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(ADD, ASR, "S"); +return txt;} + +char * OP_ADD_S_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ADD, ASR, "S"); +return txt;} + +char * OP_ADD_S_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(ADD, "S"); +return txt;} + +char * OP_ADD_S_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ADD, ROR, "S"); +return txt;} + +char * OP_ADD_S_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(ADD, "S"); +return txt;} + +//------------------ADC----------------------------------- + +char * OP_ADC_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(ADC, ""); +return txt;} + +char * OP_ADC_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ADC, LSL, ""); +return txt;} + +char * OP_ADC_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(ADC, LSR, ""); +return txt;} + +char * OP_ADC_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ADC, LSR, ""); +return txt;} + +char * OP_ADC_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(ADC, ASR, ""); +return txt;} + +char * OP_ADC_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ADC, ASR, ""); +return txt;} + +char * OP_ADC_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(ADC, ""); +return txt;} + +char * OP_ADC_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ADC, ROR, ""); +return txt;} + +char * OP_ADC_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(ADC, ""); +return txt;} + +char * OP_ADC_S_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(ADC, "S"); +return txt;} + +char * OP_ADC_S_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ADC, LSL, "S"); +return txt;} + +char * OP_ADC_S_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(ADC, LSR, "S"); +return txt;} + +char * OP_ADC_S_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ADC, LSR, "S"); +return txt;} + +char * OP_ADC_S_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(ADC, ASR, "S"); +return txt;} + +char * OP_ADC_S_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ADC, ASR, "S"); +return txt;} + +char * OP_ADC_S_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(ADC, "S"); +return txt;} + +char * OP_ADC_S_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ADC, ROR, "S"); +return txt;} + +char * OP_ADC_S_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(ADC, "S"); +return txt;} + +//-------------SBC------------------------------------- + +char * OP_SBC_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(SBC, ""); +return txt;} + +char * OP_SBC_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(SBC, LSL, ""); +return txt;} + +char * OP_SBC_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(SBC, LSR, ""); +return txt;} + +char * OP_SBC_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(SBC, LSR, ""); +return txt;} + +char * OP_SBC_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(SBC, ASR, ""); +return txt;} + +char * OP_SBC_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(SBC, ASR, ""); +return txt;} + +char * OP_SBC_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(SBC, ""); +return txt;} + +char * OP_SBC_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(SBC, ROR, ""); +return txt;} + +char * OP_SBC_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(SBC, ""); +return txt;} + +char * OP_SBC_S_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(SBC, "S"); +return txt;} + +char * OP_SBC_S_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(SBC, LSL, "S"); +return txt;} + +char * OP_SBC_S_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(SBC, LSR, "S"); +return txt;} + +char * OP_SBC_S_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(SBC, LSR, "S"); +return txt;} + +char * OP_SBC_S_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(SBC, ASR, "S"); +return txt;} + +char * OP_SBC_S_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(SBC, ASR, "S"); +return txt;} + +char * OP_SBC_S_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(SBC, "S"); +return txt;} + +char * OP_SBC_S_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(SBC, ROR, "S"); +return txt;} + +char * OP_SBC_S_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(SBC, "S"); +return txt;} + +//---------------RSC---------------------------------- + +char * OP_RSC_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(RSC, ""); +return txt;} + +char * OP_RSC_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(RSC, LSL, ""); +return txt;} + +char * OP_RSC_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(RSC, LSR, ""); +return txt;} + +char * OP_RSC_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(RSC, LSR, ""); +return txt;} + +char * OP_RSC_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(RSC, ASR, ""); +return txt;} + +char * OP_RSC_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(RSC, ASR, ""); +return txt;} + +char * OP_RSC_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(RSC, ""); +return txt;} + +char * OP_RSC_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(RSC, ROR, ""); +return txt;} + +char * OP_RSC_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(RSC, ""); +return txt;} + +char * OP_RSC_S_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(RSC, "S"); +return txt;} + +char * OP_RSC_S_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(RSC, LSL, "S"); +return txt;} + +char * OP_RSC_S_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(RSC, LSR, "S"); +return txt;} + +char * OP_RSC_S_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(RSC, LSR, "S"); +return txt;} + +char * OP_RSC_S_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(RSC, ASR, "S"); +return txt;} + +char * OP_RSC_S_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(RSC, ASR, "S"); +return txt;} + +char * OP_RSC_S_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(RSC, "S"); +return txt;} + +char * OP_RSC_S_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(RSC, ROR, "S"); +return txt;} + +char * OP_RSC_S_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(RSC, "S"); +return txt;} + +//-------------------TST---------------------------- + +char * OP_TST_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_LSL_IMM(TST, "", 16); +return txt;} + +char * OP_TST_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(TST, LSL, "", 16); +return txt;} + +char * OP_TST_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_SHIFT(TST, LSR, "", 16); +return txt;} + +char * OP_TST_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(TST, LSR, "", 16); +return txt;} + +char * OP_TST_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_SHIFT(TST, ASR, "", 16); +return txt;} + +char * OP_TST_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(TST, ASR, "", 16); +return txt;} + +char * OP_TST_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_ROR_IMM(TST, "", 16); +return txt;} + +char * OP_TST_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(TST, ROR, "", 16); +return txt;} + +char * OP_TST_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_VALUE(TST, "", 16); +return txt;} + +//-------------------TEQ---------------------------- + +char * OP_TEQ_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_LSL_IMM(TEQ, "", 16); +return txt;} + +char * OP_TEQ_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(TEQ, LSL, "", 16); +return txt;} + +char * OP_TEQ_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_SHIFT(TEQ, LSR, "", 16); +return txt;} + +char * OP_TEQ_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(TEQ, LSR, "", 16); +return txt;} + +char * OP_TEQ_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_SHIFT(TEQ, ASR, "", 16); +return txt;} + +char * OP_TEQ_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(TEQ, ASR, "", 16); +return txt;} + +char * OP_TEQ_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_ROR_IMM(TEQ, "", 16); +return txt;} + +char * OP_TEQ_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(TEQ, ROR, "", 16); +return txt;} + +char * OP_TEQ_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_VALUE(TEQ, "", 16); +return txt;} + +//-------------CMP------------------------------------- + +char * OP_CMP_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_LSL_IMM(CMP, "", 16); +return txt;} + +char * OP_CMP_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(CMP, LSL, "", 16); +return txt;} + +char * OP_CMP_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_SHIFT(CMP, LSR, "", 16); +return txt;} + +char * OP_CMP_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(CMP, LSR, "", 16); +return txt;} + +char * OP_CMP_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_SHIFT(CMP, ASR, "", 16); +return txt;} + +char * OP_CMP_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(CMP, ASR, "", 16); +return txt;} + +char * OP_CMP_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_ROR_IMM(CMP, "", 16); +return txt;} + +char * OP_CMP_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(CMP, ROR, "", 16); +return txt;} + +char * OP_CMP_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_VALUE(CMP, "", 16); +return txt;} + +//---------------CMN--------------------------- + +char * OP_CMN_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_LSL_IMM(CMN, "", 16); +return txt;} + +char * OP_CMN_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(CMN, LSL, "", 16); +return txt;} + +char * OP_CMN_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_SHIFT(CMP, ASR, "", 16); +return txt;} + +char * OP_CMN_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(CMN, LSR, "", 16); +return txt;} + +char * OP_CMN_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_SHIFT(CMN, ASR, "", 16); +return txt;} + +char * OP_CMN_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(CMN, ASR, "", 16); +return txt;} + +char * OP_CMN_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_ROR_IMM(CMN, "", 16); +return txt;} + +char * OP_CMN_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(CMN, ROR, "", 16); +return txt;} + +char * OP_CMN_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_VALUE(CMN, "", 16); +return txt;} + +//------------------ORR------------------- + +char * OP_ORR_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(ORR, ""); +return txt;} + +char * OP_ORR_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ORR, LSL, ""); +return txt;} + +char * OP_ORR_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(ORR, LSR, ""); +return txt;} + +char * OP_ORR_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ORR, LSR, ""); +return txt;} + +char * OP_ORR_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(ORR, ASR, ""); +return txt;} + +char * OP_ORR_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ORR, ASR, ""); +return txt;} + +char * OP_ORR_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(ORR, ""); +return txt;} + +char * OP_ORR_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ORR, ROR, ""); +return txt;} + +char * OP_ORR_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(ORR, ""); +return txt;} + +char * OP_ORR_S_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(ORR, "S"); +return txt;} + +char * OP_ORR_S_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ORR, LSL, "S"); +return txt;} + +char * OP_ORR_S_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(ORR, LSR, "S"); +return txt;} + +char * OP_ORR_S_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ORR, LSR, "S"); +return txt;} + +char * OP_ORR_S_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(ORR, ASR, "S"); +return txt;} + +char * OP_ORR_S_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ORR, ASR, "S"); +return txt;} + +char * OP_ORR_S_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(ORR, "S"); +return txt;} + +char * OP_ORR_S_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(ORR, ROR, "S"); +return txt;} + +char * OP_ORR_S_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(ORR, "S"); +return txt;} + +//------------------MOV------------------- + +char * OP_MOV_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_LSL_IMM(MOV, "", 12); +return txt;} + +char * OP_MOV_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(MOV, LSL, "", 12); +return txt;} + +char * OP_MOV_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_SHIFT(MOV, LSR, "", 12); +return txt;} + +char * OP_MOV_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(MOV, LSR, "", 12); +return txt;} + +char * OP_MOV_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_SHIFT(MOV, ASR, "", 12); +return txt;} + +char * OP_MOV_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(MOV, ASR, "", 12); +return txt;} + +char * OP_MOV_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_ROR_IMM(MOV, "", 12); +return txt;} + +char * OP_MOV_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(MOV, ROR, "", 12); +return txt;} + +char * OP_MOV_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_VALUE(MOV, "", 12); +return txt;} + +char * OP_MOV_S_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_LSL_IMM(MOV, "S", 12); +return txt;} + +char * OP_MOV_S_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(MOV, LSL, "S", 12); +return txt;} + +char * OP_MOV_S_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_SHIFT(MOV, LSR, "S", 12); +return txt;} + +char * OP_MOV_S_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(MOV, LSR, "S", 12); +return txt;} + +char * OP_MOV_S_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_SHIFT(MOV, ASR, "S", 12); +return txt;} + +char * OP_MOV_S_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(MOV, ASR, "S", 12); +return txt;} + +char * OP_MOV_S_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_ROR_IMM(MOV, "S", 12); +return txt;} + +char * OP_MOV_S_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(MOV, ROR, "S", 12); +return txt;} + +char * OP_MOV_S_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_VALUE(MOV, "S", 12); +return txt;} + +//------------------BIC------------------- + +char * OP_BIC_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(BIC, ""); +return txt;} + +char * OP_BIC_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(BIC, LSL, ""); +return txt;} + +char * OP_BIC_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(BIC, LSR, ""); +return txt;} + +char * OP_BIC_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(BIC, LSR, ""); +return txt;} + +char * OP_BIC_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(BIC, ASR, ""); +return txt;} + +char * OP_BIC_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(BIC, ASR, ""); +return txt;} + +char * OP_BIC_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(BIC, ""); +return txt;} + +char * OP_BIC_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(BIC, ROR, ""); +return txt;} + +char * OP_BIC_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(BIC, ""); +return txt;} + +char * OP_BIC_S_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_LSL_IMM(BIC, "S"); +return txt;} + +char * OP_BIC_S_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(BIC, LSL, "S"); +return txt;} + +char * OP_BIC_S_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(BIC, LSR, "S"); +return txt;} + +char * OP_BIC_S_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(BIC, LSR, "S"); +return txt;} + +char * OP_BIC_S_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_SHIFT(BIC, ASR, "S"); +return txt;} + +char * OP_BIC_S_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(BIC, ASR, "S"); +return txt;} + +char * OP_BIC_S_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ROR_IMM(BIC, "S"); +return txt;} + +char * OP_BIC_S_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_REG_SHIFT(BIC, ROR, "S"); +return txt;} + +char * OP_BIC_S_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_IMM_VALUE(BIC, "S"); +return txt;} + +//------------------MVN------------------- + +char * OP_MVN_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_LSL_IMM(MVN, "", 12); +return txt;} + +char * OP_MVN_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(MVN, LSL, "", 12); +return txt;} + +char * OP_MVN_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_SHIFT(MVN, LSR, "", 12); +return txt;} + +char * OP_MVN_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(MVN, LSR, "", 12); +return txt;} + +char * OP_MVN_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_SHIFT(MVN, ASR, "", 12); +return txt;} + +char * OP_MVN_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(MVN, ASR, "", 12); +return txt;} + +char * OP_MVN_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_ROR_IMM(MVN, "", 12); +return txt;} + +char * OP_MVN_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(MVN, ROR, "", 12); +return txt;} + +char * OP_MVN_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_VALUE(MVN, "", 12); +return txt;} + +char * OP_MVN_S_LSL_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_LSL_IMM(MVN, "S", 12); +return txt;} + +char * OP_MVN_S_LSL_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(MVN, LSL, "S", 12); +return txt;} + +char * OP_MVN_S_LSR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_SHIFT(MVN, LSR, "S", 12); +return txt;} + +char * OP_MVN_S_LSR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(MVN, LSR, "S", 12); +return txt;} + +char * OP_MVN_S_ASR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_SHIFT(MOV, ASR, "S", 12); +return txt;} + +char * OP_MVN_S_ASR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(MVN, ASR, "S", 12); +return txt;} + +char * OP_MVN_S_ROR_IMM(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_ROR_IMM(MVN, "S", 12); +return txt;} + +char * OP_MVN_S_ROR_REG(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_REG_SHIFT(MVN, ROR, "S", 12); +return txt;} + +char * OP_MVN_S_IMM_VAL(u32 adr, u32 i, char * txt) +{ + DATAPROC_ONE_OP_IMM_VALUE(MVN, "S", 12); +return txt;} + + +//-------------MUL------------------------ + +char * OP_MUL(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "MUL%s %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +char * OP_MLA(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "MLA%s %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)], Registre[REG_POS(i,12)]); +return txt;} + +char * OP_MUL_S(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "MUL%sS %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +char * OP_MLA_S(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "MLA%sS %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)], Registre[REG_POS(i,12)]); +return txt;} + + +//----------UMUL-------------------------- + +char * OP_UMULL(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "UMULL%s %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +char * OP_UMLAL(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "UMLAL%s %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +char * OP_UMULL_S(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "UMULL%sS %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +char * OP_UMLAL_S(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "UMLAL%sS %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +//----------SMUL-------------------------- + +char * OP_SMULL(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMULL%s %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +char * OP_SMLAL(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMLAL%s %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +char * OP_SMULL_S(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMULL%sS %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +char * OP_SMLAL_S(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMLAL%sS %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +//---------------SWP------------------------------ + +char * OP_SWP(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SWP%s %s, %s, [%s]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,0)], Registre[REG_POS(i,16)]); +return txt;} + +char * OP_SWPB(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SWPB%s %s, %s, [%s]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,0)], Registre[REG_POS(i,16)]); +return txt;} + +//------------LDRH----------------------------- + +char * OP_LDRH_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRH%s %s, [%s, #%X]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRH_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRH%s %s, [%s, -#%X]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRH_P_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRH%s %s, [%s, %s]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_LDRH_M_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRH%s %s, [%s, -%s]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_LDRH_PRE_INDE_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRH%s %s, [%s, #%X]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRH_PRE_INDE_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRH%s %s, [%s, -#%X]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRH_PRE_INDE_P_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRH%s %s, [%s, %s]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_LDRH_PRE_INDE_M_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRH%s %s, [%s, -%s]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_LDRH_POS_INDE_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRH%s %s, [%s], #%X", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRH_POS_INDE_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRH%s %s, [%s], -#%X", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRH_POS_INDE_P_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRH%s %s, [%s], %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_LDRH_POS_INDE_M_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRH%s %s, [%s], -%s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +//------------STRH----------------------------- + +char * OP_STRH_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRH%s %s, [%s, #%X]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_STRH_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRH%s %s, [%s, -#%X]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_STRH_P_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRH%s %s, [%s, %s]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_STRH_M_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRH%s %s, [%s, -%s]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_STRH_PRE_INDE_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRH%s %s, [%s, #%X]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_STRH_PRE_INDE_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRH%s %s, [%s, -#%X]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_STRH_PRE_INDE_P_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRH%s %s, [%s, %s]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_STRH_PRE_INDE_M_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRH%s %s, [%s, -%s]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_STRH_POS_INDE_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRH%s %s, [%s], #%X", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_STRH_POS_INDE_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRH%s %s, [%s], -#%X", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_STRH_POS_INDE_P_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRH%s %s, [%s], %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_STRH_POS_INDE_M_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRH%s %s, [%s], -%s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +//----------------LDRSH-------------------------- + +char * OP_LDRSH_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSH%s %s, [%s, #%X]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRSH_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSH%s %s, [%s, -#%X]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRSH_P_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSH%s %s, [%s, %s]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_LDRSH_M_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSH%s %s, [%s, -%s]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_LDRSH_PRE_INDE_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSH%s %s, [%s, #%X]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRSH_PRE_INDE_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSH%s %s, [%s, -#%X]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRSH_PRE_INDE_P_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSH%s %s, [%s, %s]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_LDRSH_PRE_INDE_M_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSH%s %s, [%s, -%s]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_LDRSH_POS_INDE_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSH%s %s, [%s], #%X", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRSH_POS_INDE_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSH%s %s, [%s], -#%X", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRSH_POS_INDE_P_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSH%s %s, [%s], %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_LDRSH_POS_INDE_M_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSH%s %s, [%s], -%s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +//----------------------LDRSB---------------------- + +char * OP_LDRSB_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSB%s %s, [%s, #%X]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRSB_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSB%s %s, [%s, -#%X]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRSB_P_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSB%s %s, [%s, %s]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_LDRSB_M_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSB%s %s, [%s, -%s]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_LDRSB_PRE_INDE_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSB%s %s, [%s, #%X]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRSB_PRE_INDE_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSB%s %s, [%s, -#%X]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRSB_PRE_INDE_P_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSB%s %s, [%s, %s]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_LDRSB_PRE_INDE_M_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSB%s %s, [%s, -%s]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_LDRSB_POS_INDE_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSB%s %s, [%s], #%X", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRSB_POS_INDE_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSB%s %s, [%s], -#%X", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(((i>>4)&0xF0)|(i&0xF))); +return txt;} + +char * OP_LDRSB_POS_INDE_P_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSB%s %s, [%s], %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_LDRSB_POS_INDE_M_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSB%s %s, [%s], -%s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +//--------------MRS-------------------------------- + +char * OP_MRS_CPSR(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "MRS%s %s, CPSR", Condition[CONDITION(i)], Registre[REG_POS(i,12)]); +return txt;} + +char * OP_MRS_SPSR(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "MRS%s %s, SPSR", Condition[CONDITION(i)], Registre[REG_POS(i,12)]); +return txt;} + +//--------------MSR-------------------------------- + +char * OP_MSR_CPSR(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "MSR%s CPSR_%s, %s", Condition[CONDITION(i)], MSR_FIELD[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_MSR_SPSR(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "MSR%s SPSR_%s, %s", Condition[CONDITION(i)], MSR_FIELD[REG_POS(i,16)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_MSR_CPSR_IMM_VAL(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "MSR%s CPSR_%s, #%X", Condition[CONDITION(i)], MSR_FIELD[REG_POS(i,16)], (int)ROR((i&0xFF), ((i>>7)&0x1E))); +return txt;} + +char * OP_MSR_SPSR_IMM_VAL(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "MSR%s SPSR_%s, #%X", Condition[CONDITION(i)], MSR_FIELD[REG_POS(i,16)], (int)ROR((i&0xFF), (i>>7)&0x1E)); +return txt;} + +//-----------------BRANCH-------------------------- + +char * OP_BX(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "BX%s %s", Condition[CONDITION(i)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_BLX_REG(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "BLX%s %s", Condition[CONDITION(i)], Registre[REG_POS(i,0)]); +return txt;} + +char * OP_B(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "BLX%s %08X", Condition[CONDITION(i)], (int)(adr+(SIGNEXTEND_24(i)<<2)+8)); + return txt;} + sprintf(txt, "B%s %08X", Condition[CONDITION(i)], (int)(adr+(SIGNEXTEND_24(i)<<2)+8)); +return txt;} + +char * OP_BL(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "BLX%s %08X", Condition[CONDITION(i)], (int)(adr+(SIGNEXTEND_24(i)<<2)+10)); + return txt;} + sprintf(txt, "BL%s %08X", Condition[CONDITION(i)], (int)(adr+(SIGNEXTEND_24(i)<<2)+8)); +return txt;} + +//----------------CLZ------------------------------- + +char * OP_CLZ(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "CLZ%s %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,0)]); +return txt;} + + +//--------------------QADD--QSUB------------------------------ + +char * OP_QADD(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "QADD%s %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,0)], Registre[REG_POS(i,16)]); +return txt;} + +char * OP_QSUB(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "QSUB%s %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,0)], Registre[REG_POS(i,16)]); +return txt;} + +char * OP_QDADD(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "QDADD%s %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,0)], Registre[REG_POS(i,16)]); +return txt;} + +char * OP_QDSUB(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "QDSUB%s %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,0)], Registre[REG_POS(i,16)]); +return txt;} + +//-----------------SMUL------------------------------- + +char * OP_SMUL_B_B(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMULBB%s %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +char * OP_SMUL_B_T(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMULBT%s %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +char * OP_SMUL_T_B(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMULTB%s %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +char * OP_SMUL_T_T(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMULTT%s %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +//-----------SMLA---------------------------- + +char * OP_SMLA_B_B(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMLABB%s %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)], Registre[REG_POS(i,12)]); +return txt;} + +char * OP_SMLA_B_T(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMLABT%s %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)], Registre[REG_POS(i,12)]); +return txt;} + +char * OP_SMLA_T_B(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMLATB%s %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)], Registre[REG_POS(i,12)]); +return txt;} + +char * OP_SMLA_T_T(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMLATT%s %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)], Registre[REG_POS(i,12)]); +return txt;} + +//--------------SMLAL--------------------------------------- + +char * OP_SMLAL_B_B(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMLABB%s %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +char * OP_SMLAL_B_T(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMLABT%s %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +char * OP_SMLAL_T_B(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMLATB%s %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +char * OP_SMLAL_T_T(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMLATT%s %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +//--------------SMULW-------------------- + +char * OP_SMULW_B(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMULWB%s %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +char * OP_SMULW_T(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMULWT%s %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)]); +return txt;} + +//--------------SMLAW------------------- +char * OP_SMLAW_B(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMLAWB%s %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)], Registre[REG_POS(i,12)]); +return txt;} + +char * OP_SMLAW_T(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SMLAWT%s %s, %s, %s, %s", Condition[CONDITION(i)], Registre[REG_POS(i,16)], Registre[REG_POS(i,0)], Registre[REG_POS(i,8)], Registre[REG_POS(i,12)]); +return txt;} + +//------------LDR--------------------------- + +char * OP_LDR_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDR%s %s, [%s, #%X]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_LDR_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDR%s %s, [%s, -#%X]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_LDR_P_LSL_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(LDR, "", "", "]"); +return txt;} + +char * OP_LDR_M_LSL_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(LDR, "-", "", "]"); +return txt;} + +char * OP_LDR_P_LSR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDR, LSR, "", "", "]"); +return txt;} + +char * OP_LDR_M_LSR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDR, LSR, "M", "", "]"); +return txt;} + +char * OP_LDR_P_ASR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDR, ASR, "", "", "]"); +return txt;} + +char * OP_LDR_M_ASR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDR, ASR, "-", "", "]"); +return txt;} + +char * OP_LDR_P_ROR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(LDR, "", "", "]"); +return txt;} + +char * OP_LDR_M_ROR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(LDR, "-", "", "]"); +return txt;} + +char * OP_LDR_P_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDR%s %s, [%s, #%X]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_LDR_M_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDR%s %s, [%s, -#%X]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_LDR_P_LSL_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(LDR, "", "", "]!"); +return txt;} + +char * OP_LDR_M_LSL_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(LDR, "-", "", "]!"); +return txt;} + +char * OP_LDR_P_LSR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDR, LSR, "", "", "]!"); +return txt;} + +char * OP_LDR_M_LSR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDR, LSR, "-", "", "]!"); +return txt;} + +char * OP_LDR_P_ASR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDR, ASR, "", "", "]!"); +return txt;} + +char * OP_LDR_M_ASR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDR, ASR, "-", "", "]!"); +return txt;} + +char * OP_LDR_P_ROR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(LDR, "", "", "]!"); +return txt;} + +char * OP_LDR_M_ROR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(LDR, "-", "", "]!"); +return txt;} + +char * OP_LDR_P_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDR%s %s, [%s], #%X!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_LDR_P_IMM_OFF_POSTIND2(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDR%s %s, [%s], #%X!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_LDR_M_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDR%s %s, [%s], -#%X!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_LDR_P_LSL_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(LDR, "", "]", ""); +return txt;} + +char * OP_LDR_M_LSL_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(LDR, "-", "]", ""); +return txt;} + +char * OP_LDR_P_LSR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDR, LSR, "", "]", ""); +return txt;} + +char * OP_LDR_M_LSR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDR, LSR, "-", "]", ""); +return txt;} + +char * OP_LDR_P_ASR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDR, ASR, "", "]", ""); +return txt;} + +char * OP_LDR_M_ASR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDR, ASR, "-", "]", ""); +return txt;} + +char * OP_LDR_P_ROR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(LDR, "", "]", ""); +return txt;} + +char * OP_LDR_M_ROR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(LDR, "-", "]", ""); +return txt;} + +//-----------------LDRB------------------------------------------- + +char * OP_LDRB_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRB%s %s, [%s, #%X]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_LDRB_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRB%s %s, [%s, -#%X]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_LDRB_P_LSL_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(LDRB, "", "", "]"); +return txt;} + +char * OP_LDRB_M_LSL_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(LDRB, "-", "", "]"); +return txt;} + +char * OP_LDRB_P_LSR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDRB, LSR, "", "", "]"); +return txt;} + +char * OP_LDRB_M_LSR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDRB, LSR, "M", "", "]"); +return txt;} + +char * OP_LDRB_P_ASR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDRB, ASR, "", "", "]"); +return txt;} + +char * OP_LDRB_M_ASR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDRB, ASR, "-", "", "]"); +return txt;} + +char * OP_LDRB_P_ROR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(LDRB, "", "", "]"); +return txt;} + +char * OP_LDRB_M_ROR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(LDRB, "-", "", "]"); +return txt;} + +char * OP_LDRB_P_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRB%s %s, [%s, #%X]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_LDRB_M_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRB%s %s, [%s, -#%X]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_LDRB_P_LSL_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(LDRB, "", "", "]!"); +return txt;} + +char * OP_LDRB_M_LSL_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(LDRB, "-", "", "]!"); +return txt;} + +char * OP_LDRB_P_LSR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDRB, LSR, "", "", "]!"); +return txt;} + +char * OP_LDRB_M_LSR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDRB, LSR, "-", "", "]!"); +return txt;} + +char * OP_LDRB_P_ASR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDRB, ASR, "", "", "]!"); +return txt;} + +char * OP_LDRB_M_ASR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDRB, ASR, "-", "", "]!"); +return txt;} + +char * OP_LDRB_P_ROR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(LDRB, "", "", "]!"); +return txt;} + +char * OP_LDRB_M_ROR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(LDRB, "-", "", "]!"); +return txt;} + +char * OP_LDRB_P_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRB%s %s, [%s], #%X!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_LDRB_M_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRB%s %s, [%s], -#%X!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_LDRB_P_LSL_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(LDRB, "", "]", ""); +return txt;} + +char * OP_LDRB_M_LSL_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(LDRB, "-", "]", ""); +return txt;} + +char * OP_LDRB_P_LSR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDRB, LSR, "", "]", ""); +return txt;} + +char * OP_LDRB_M_LSR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDRB, LSR, "-", "]", ""); +return txt;} + +char * OP_LDRB_P_ASR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDRB, ASR, "", "]", ""); +return txt;} + +char * OP_LDRB_M_ASR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDRB, ASR, "-", "]", ""); +return txt;} + +char * OP_LDRB_P_ROR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(LDRB, "", "]", ""); +return txt;} + +char * OP_LDRB_M_ROR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(LDRB, "-", "]", ""); +return txt;} + +//----------------------STR-------------------------------- + +char * OP_STR_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STR%s %s, [%s, #%X]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_STR_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STR%s %s, [%s, -#%X]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_STR_P_LSL_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(STR, "", "", "]"); +return txt;} + +char * OP_STR_M_LSL_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(STR, "-", "", "]"); +return txt;} + +char * OP_STR_P_LSR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STR, LSR, "", "", "]"); +return txt;} + +char * OP_STR_M_LSR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STR, LSR, "M", "", "]"); +return txt;} + +char * OP_STR_P_ASR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STR, ASR, "", "", "]"); +return txt;} + +char * OP_STR_M_ASR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STR, ASR, "-", "", "]"); +return txt;} + +char * OP_STR_P_ROR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(STR, "", "", "]"); +return txt;} + +char * OP_STR_M_ROR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(STR, "-", "", "]"); +return txt;} + +char * OP_STR_P_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STR%s %s, [%s, #%X]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_STR_M_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STR%s %s, [%s, -#%X]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_STR_P_LSL_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(STR, "", "", "]!"); +return txt;} + +char * OP_STR_M_LSL_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(STR, "-", "", "]!"); +return txt;} + +char * OP_STR_P_LSR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STR, LSR, "", "", "]!"); +return txt;} + +char * OP_STR_M_LSR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STR, LSR, "-", "", "]!"); +return txt;} + +char * OP_STR_P_ASR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STR, ASR, "", "", "]!"); +return txt;} + +char * OP_STR_M_ASR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STR, ASR, "-", "", "]!"); +return txt;} + +char * OP_STR_P_ROR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(STR, "", "", "]!"); +return txt;} + +char * OP_STR_M_ROR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(STR, "-", "", "]!"); +return txt;} + +char * OP_STR_P_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STR%s %s, [%s], #%X!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_STR_M_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STR%s %s, [%s], -#%X!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_STR_P_LSL_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(STR, "", "]", ""); +return txt;} + +char * OP_STR_M_LSL_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(STR, "-", "]", ""); +return txt;} + +char * OP_STR_P_LSR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STR, LSR, "", "]", ""); +return txt;} + +char * OP_STR_M_LSR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STR, LSR, "-", "]", ""); +return txt;} + +char * OP_STR_P_ASR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STR, ASR, "", "]", ""); +return txt;} + +char * OP_STR_M_ASR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STR, ASR, "-", "]", ""); +return txt;} + +char * OP_STR_P_ROR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(STR, "", "]", ""); +return txt;} + +char * OP_STR_M_ROR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(STR, "-", "]", ""); +return txt;} + +//-----------------------STRB------------------------------------- + +char * OP_STRB_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRB%s %s, [%s, #%X]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_STRB_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRB%s %s, [%s, -#%X]", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_STRB_P_LSL_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(STRB, "", "", "]"); +return txt;} + +char * OP_STRB_M_LSL_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(STRB, "-", "", "]"); +return txt;} + +char * OP_STRB_P_LSR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STRB, LSR, "", "", "]"); +return txt;} + +char * OP_STRB_M_LSR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STRB, LSR, "M", "", "]"); +return txt;} + +char * OP_STRB_P_ASR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STRB, ASR, "", "", "]"); +return txt;} + +char * OP_STRB_M_ASR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STRB, ASR, "-", "", "]"); +return txt;} + +char * OP_STRB_P_ROR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(STRB, "", "", "]"); +return txt;} + +char * OP_STRB_M_ROR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(STRB, "-", "", "]"); +return txt;} + +char * OP_STRB_P_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRB%s %s, [%s, #%X]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_STRB_M_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRB%s %s, [%s, -#%X]!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_STRB_P_LSL_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(STRB, "", "", "]!"); +return txt;} + +char * OP_STRB_M_LSL_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(STRB, "-", "", "]!"); +return txt;} + +char * OP_STRB_P_LSR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STRB, LSR, "", "", "]!"); +return txt;} + +char * OP_STRB_M_LSR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STRB, LSR, "-", "", "]!"); +return txt;} + +char * OP_STRB_P_ASR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STRB, ASR, "", "", "]!"); +return txt;} + +char * OP_STRB_M_ASR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STRB, ASR, "-", "", "]!"); +return txt;} + +char * OP_STRB_P_ROR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(STRB, "", "", "]!"); +return txt;} + +char * OP_STRB_M_ROR_IMM_OFF_PREIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(STRB, "-", "", "]!"); +return txt;} + +char * OP_STRB_P_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRB%s %s, [%s], #%X!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_STRB_M_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRB%s %s, [%s], -#%X!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_STRB_P_LSL_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(STRB, "", "]", ""); +return txt;} + +char * OP_STRB_M_LSL_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(STRB, "-", "]", ""); +return txt;} + +char * OP_STRB_P_LSR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STRB, LSR, "", "]", ""); +return txt;} + +char * OP_STRB_M_LSR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STRB, LSR, "-", "]", ""); +return txt;} + +char * OP_STRB_P_ASR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STRB, ASR, "", "]", ""); +return txt;} + +char * OP_STRB_M_ASR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STRB, ASR, "-", "]", ""); +return txt;} + +char * OP_STRB_P_ROR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(STRB, "", "]", ""); +return txt;} + +char * OP_STRB_M_ROR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(STRB, "-", "]", ""); +return txt;} + +//-----------------------LDRBT------------------------------------- + +char * OP_LDRBT_P_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRBT%s %s, [%s], #%X!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_LDRBT_M_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRBT%s %s, [%s], -#%X!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_LDRBT_P_LSL_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(LDRBT, "", "]", ""); +return txt;} + +char * OP_LDRBT_M_LSL_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(LDRBT, "-", "]", ""); +return txt;} + +char * OP_LDRBT_P_LSR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDRBT, LSR, "", "]", ""); +return txt;} + +char * OP_LDRBT_M_LSR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDRBT, LSR, "-", "]", ""); +return txt;} + +char * OP_LDRBT_P_ASR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDRBT, ASR, "", "]", ""); +return txt;} + +char * OP_LDRBT_M_ASR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(LDRBT, ASR, "-", "]", ""); +return txt;} + +char * OP_LDRBT_P_ROR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(LDRBT, "", "]", ""); +return txt;} + +char * OP_LDRBT_M_ROR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(LDRBT, "-", "]", ""); +return txt;} + +//----------------------STRBT---------------------------- + +char * OP_STRBT_P_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRBT%s %s, [%s], #%X!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_STRBT_M_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRBT%s %s, [%s], -#%X!", Condition[CONDITION(i)], Registre[REG_POS(i,12)], Registre[REG_POS(i,16)], (int)(i&0xFF)); +return txt;} + +char * OP_STRBT_P_LSL_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(STRBT, "", "]", ""); +return txt;} + +char * OP_STRBT_M_LSL_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_LSL_IMM(STRBT, "-", "]", ""); +return txt;} + +char * OP_STRBT_P_LSR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STRBT, LSR, "", "]", ""); +return txt;} + +char * OP_STRBT_M_LSR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STRBT, LSR, "-", "]", ""); +return txt;} + +char * OP_STRBT_P_ASR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STRBT, ASR, "", "]", ""); +return txt;} + +char * OP_STRBT_M_ASR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_IMM_SHIFT(STRBT, ASR, "-", "]", ""); +return txt;} + +char * OP_STRBT_P_ROR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(STRBT, "", "]", ""); +return txt;} + +char * OP_STRBT_M_ROR_IMM_OFF_POSTIND(u32 adr, u32 i, char * txt) +{ + LDRSTR_ROR_IMM(STRBT, "-", "]", ""); +return txt;} + +//---------------------LDM----------------------------- + +char * OP_LDMIA(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "LDMIA%s %s, {%s}", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_LDMIB(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "LDMIB%s %s, {%s}", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_LDMDA(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "LDMDA%s %s, {%s}", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_LDMDB(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "LDMDB%s %s, {%s}", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_LDMIA_W(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "LDMIA%s %s!, {%s}", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_LDMIB_W(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "LDMIB%s %s!, {%s}", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_LDMDA_W(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "LDMDA%s %s!, {%s}", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_LDMDB_W(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "LDMDB%s %s!, {%s}", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_LDMIA2(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "LDMIA%s %s, {%s}^", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_LDMIB2(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "LDMIB%s %s, {%s}^", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_LDMDA2(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "LDMDA%s %s, {%s}^", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_LDMDB2(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "LDMDB%s %s, {%s}^", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_LDMIA2_W(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "LDMIA%s %s!, {%s}^", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); + if(BIT15(i)==0) sprintf(txt, "%s ?????", txt); +return txt;} + +char * OP_LDMIB2_W(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "LDMIB%s %s!, {%s}^", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); + if(BIT15(i)==0) sprintf(txt, "%s ?????", txt); +return txt;} + +char * OP_LDMDA2_W(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "LDMDA%s %s!, {%s}^", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); + if(BIT15(i)==0) sprintf(txt, "%s ?????", txt); +return txt;} + +char * OP_LDMDB2_W(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "LDMDB%s %s!, {%s}^", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); + if(BIT15(i)==0) sprintf(txt, "%s ?????", txt); +return txt;} + +//------------------------------STM---------------------------------- + +char * OP_STMIA(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "STMIA%s %s, {%s}", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_STMIB(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "STMIB%s %s, {%s}", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_STMDA(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "STMDA%s %s, {%s}", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_STMDB(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "STMDB%s %s, {%s}", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_STMIA_W(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "STMIA%s %s!, {%s}", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_STMIB_W(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "STMIB%s %s!, {%s}", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_STMDA_W(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "STMDA%s %s!, {%s}", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_STMDB_W(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "STMDB%s %s!, {%s}", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_STMIA2(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "STMIA%s %s, {%s}^", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_STMIB2(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "STMIB%s %s, {%s}^", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_STMDA2(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "STMDA%s %s, {%s}^", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_STMDB2(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "STMDB%s %s, {%s}^", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_STMIA2_W(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "STMIA%s %s!, {%s}^ ?????", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_STMIB2_W(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "STMIB%s %s!, {%s}^ ?????", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); +return txt;} + +char * OP_STMDA2_W(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "STMDA%s %s!, {%s}^ ?????", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); + return txt; +} + +char * OP_STMDB2_W(u32 adr, u32 i, char * txt) +{ + RegList(16); + sprintf(txt, "STMDB%s %s!, {%s}^ ?????", Condition[CONDITION(i)], Registre[REG_POS(i,16)], lreg); + return txt; +} + +//---------------------STC---------------------------------- + +char * OP_STC_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "STC2 CP%X, CR%X, [%s, #%X]", (int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)],(int)((i&0xFF)<<2)); + return txt; + } + sprintf(txt, "STC%s %X, CP%X, [%s, #%X]",Condition[CONDITION(i)], (int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)],(int)((i&0xFF)<<2)); + return txt; +} + +char * OP_STC_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "STC2 CP%X, CR%X, [%s, #-%X]",(int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)],(int)((i&0xFF)<<2)); + return txt; + } + sprintf(txt, "STC%s CP%X, CR%X, [%s, #-%X]",Condition[CONDITION(i)], (int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; +} + +char * OP_STC_P_PREIND(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "STC2 CP%X, CR%X, [%s, #%X]!",(int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; + } + sprintf(txt, "STC%s CP%X, CR%X, [%s, #%X]!",Condition[CONDITION(i)], (int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; +} + +char * OP_STC_M_PREIND(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "STC2 CP%X, CR%X, [%s, #-%X]!",(int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; + } + sprintf(txt, "STC%s CP%X, CR%X, [%s, #-%X]!",Condition[CONDITION(i)], (int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; +} + +char * OP_STC_P_POSTIND(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "STC2 CP%X, CR%X, [%s], #%X",(int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; + } + sprintf(txt, "STC%s CP%X, CR%X, [%s], #%X",Condition[CONDITION(i)], (int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; +} + +char * OP_STC_M_POSTIND(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "STC2 CP%X, CR%X, [%s], #-%X",(int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; + } + sprintf(txt, "STC%s CP%X, CR%X, [%s], #-%X",Condition[CONDITION(i)], (int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; +} + +char * OP_STC_OPTION(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "STC2 CP%X, CR%X, [%s], {%X}",(int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)(i&0xFF)); + return txt; + } + sprintf(txt, "STC%s CP%X, CR%X, [%s], {%X}",Condition[CONDITION(i)], (int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)(i&0xFF)); + return txt; +} + +//---------------------LDC---------------------------------- + +char * OP_LDC_P_IMM_OFF(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "LDC2 CP%X, CR%X, [%s, #%X]",(int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; + } + sprintf(txt, "LDC%s CP%X, CR%X, [%s, #%X]",Condition[CONDITION(i)], (int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; +} + +char * OP_LDC_M_IMM_OFF(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "LDC2 CP%X, CR%X, [%s, #-%X]",(int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; + } + sprintf(txt, "LDC%s CP%X, CR%X, [%s, #-%X]",Condition[CONDITION(i)], (int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; +} + +char * OP_LDC_P_PREIND(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "LDC2 CP%X, CR%X, [%s, #%X]!",(int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; + } + sprintf(txt, "LDC%s CP%X, CR%X, [%s, #%X]!",Condition[CONDITION(i)], (int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; +} + +char * OP_LDC_M_PREIND(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "LDC2 CP%X, CR%X, [%s, #-%X]!",(int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; + } + sprintf(txt, "LDC%s CP%X, CR%X, [%s, #-%X]!",Condition[CONDITION(i)], (int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; +} + +char * OP_LDC_P_POSTIND(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "LDC2 CP%X, CR%X, [%s], #%X",(int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; + } + sprintf(txt, "LDC%s CP%X, CR%X, [%s], #%X",Condition[CONDITION(i)], (int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; +} + +char * OP_LDC_M_POSTIND(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "LDC2 CP%X, CR%X, [%s], #-%X", (int)REG_POS(i, 8), (int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; + } + sprintf(txt, "LDC%s CP%X, CR%X, [%s], #-%X",Condition[CONDITION(i)], (int)REG_POS(i, 8),(int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)((i&0xFF)<<2)); + return txt; +} + +char * OP_LDC_OPTION(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "LDC2 CP%X, CR%X, [%s], {%X}", (int)REG_POS(i, 8), (int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)(i&0xFF)); + return txt; + } + sprintf(txt, "LDC%s CP%X, CR%X, [%s], {%X}",Condition[CONDITION(i)], (int)REG_POS(i, 8), (int)REG_POS(i, 12), Registre[REG_POS(i, 16)], (int)(i&0xFF)); + return txt; +} + +//----------------MCR----------------------- + +char * OP_MCR(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "MCR2 CP%d, %X, %s, CR%d, CR%d, %X",(int)REG_POS(i, 8), (int)((i>>21)&7), Registre[REG_POS(i, 12)], (int)REG_POS(i, 16), (int)REG_POS(i, 0), (int)((i>>5)&0x7)); + return txt; + } + sprintf(txt, "MCR%s CP%d, %X, %s, CR%d, CR%d, %X",Condition[CONDITION(i)], (int)REG_POS(i, 8), (int)((i>>21)&7), Registre[REG_POS(i, 12)], (int)REG_POS(i, 16), (int)REG_POS(i, 0), (int)((i>>5)&0x7)); + return txt; +} + +//----------------MRC----------------------- + +char * OP_MRC(u32 adr, u32 i, char * txt) +{ + if(CONDITION(i)==0xF) + { + sprintf(txt, "MRC2 CP%d, %X, %s, CR%d, CR%d, %X",(int)REG_POS(i, 8), (int)((i>>21)&7), Registre[REG_POS(i, 12)], (int)REG_POS(i, 16), (int)REG_POS(i, 0), (int)((i>>5)&0x7)); + return txt; + } + sprintf(txt, "MRC%s CP%d, %X, %s, CR%d, CR%d, %X",Condition[CONDITION(i)], (int)REG_POS(i, 8), (int)((i>>21)&7), Registre[REG_POS(i, 12)], (int)REG_POS(i, 16), (int)REG_POS(i, 0), (int)((i>>5)&0x7)); + return txt; +} + +//--------------SWI-------------------------- + +char * OP_SWI(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SWI%s %X",Condition[CONDITION(i)], (int)((i&0xFFFFFF)>>16)); + return txt; +} + +//----------------BKPT------------------------- +char * OP_BKPT(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "BKPT #%X",(int)(((i>>4)&0xFFF)|(i&0xF))); + return txt; +} + +//----------------CDP----------------------- + +char * OP_CDP(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "CDP-------------------------------"); + return txt; +} + +//------------------------------------------------------------ +// THUMB +//------------------------------------------------------------ +#define REG_NUM(i, n) (((i)>>n)&0x7) + +char * OP_UND_THUMB(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "----"); + return txt; +} + +char * OP_LSL_0(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LSL %s, %s, #0", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_LSL(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LSL %s, %s, #%X", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], (int)((i>>6) & 0x1F)); + return txt; +} + +char * OP_LSR_0(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LSR %s, %s, #0", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_LSR(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LSR %s, %s, #%X", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], (int)((i>>6) & 0x1F)); + return txt; +} + +char * OP_ASR_0(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "ASR %s, %s, #0", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_ASR(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "ASR %s, %s, #%X", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], (int)((i>>6) & 0x1F)); + return txt; +} + +char * OP_ADD_REG(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "ADD %s, %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], Registre[REG_NUM(i, 6)]); + return txt; +} + +char * OP_SUB_REG(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SUB %s, %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], Registre[REG_NUM(i, 6)]); + return txt; +} + +char * OP_ADD_IMM3(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "ADD %s, %s, #%X", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], (int)REG_NUM(i, 6)); + return txt; +} + +char * OP_SUB_IMM3(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SUB %s, %s, #%X", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], (int)REG_NUM(i, 6)); + return txt; +} + +char * OP_MOV_IMM8(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "MOV %s, #%X", Registre[REG_NUM(i, 8)], (int)(i&0xFF)); + return txt; +} + +char * OP_CMP_IMM8(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "CMP %s, #%X", Registre[REG_NUM(i, 8)], (int)(i&0xFF)); + return txt; +} + +char * OP_ADD_IMM8(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "ADD %s, #%X", Registre[REG_NUM(i, 8)], (int)(i&0xFF)); + return txt; +} + +char * OP_SUB_IMM8(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SUB %s, #%X", Registre[REG_NUM(i, 8)], (int)(i&0xFF)); + return txt; +} + +char * OP_AND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "AND %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_EOR(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "EOR %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_LSL_REG(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LSL %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_LSR_REG(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LSR %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_ASR_REG(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "ASR %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_ADC_REG(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "ADC %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_SBC_REG(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SBC %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_ROR_REG(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "ROR %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_TST(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "TST %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_NEG(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "NEG %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_CMP(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "CMP %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_CMN(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "CMN %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_ORR(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "ORR %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_MUL_REG(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "MUL %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_BIC(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "BIC %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_MVN(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "MVN %s, %s", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)]); + return txt; +} + +char * OP_ADD_SPE(u32 adr, u32 i, char * txt) +{ + u8 Rd = (i&7) | ((i>>4)&8); + sprintf(txt, "ADD %s, %s", Registre[Rd], Registre[REG_POS(i, 3)]); + return txt; +} + +char * OP_CMP_SPE(u32 adr, u32 i, char * txt) +{ + u8 Rd = (i&7) | ((i>>4)&8); + sprintf(txt, "CMP %s, %s", Registre[Rd], Registre[REG_POS(i, 3)]); + return txt; +} + +char * OP_MOV_SPE(u32 adr, u32 i, char * txt) +{ + u8 Rd = (i&7) | ((i>>4)&8); + sprintf(txt, "MOV %s, %s", Registre[Rd], Registre[REG_POS(i, 3)]); + return txt; +} + +char * OP_BX_THUMB(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "BX %s", Registre[REG_POS(i, 3)]); + return txt; +} + +char * OP_BLX_THUMB(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "BLX %s", Registre[REG_POS(i, 3)]); + return txt; +} + +char * OP_LDR_PCREL(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDR %s, [PC, #%X]", Registre[REG_NUM(i, 8)], (int)((i&0xFF)<<2)); + return txt; +} + +char * OP_STR_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STR %s, [%s, %s]", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], Registre[REG_NUM(i, 6)]); + return txt; +} + +char * OP_STRH_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRH %s, [%s, %s]", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], Registre[REG_NUM(i, 6)]); + return txt; +} + +char * OP_STRB_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRB %s, [%s, %s]", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], Registre[REG_NUM(i, 6)]); + return txt; +} + +char * OP_LDRSB_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSB %s, [%s, %s]", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], Registre[REG_NUM(i, 6)]); + return txt; +} + +char * OP_LDR_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDR %s, [%s, %s]", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], Registre[REG_NUM(i, 6)]); + return txt; +} + +char * OP_LDRH_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRH %s, [%s, %s]", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], Registre[REG_NUM(i, 6)]); + return txt; +} + +char * OP_LDRB_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRB %s, [%s, %s]", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], Registre[REG_NUM(i, 6)]); + return txt; +} + +char * OP_LDRSH_REG_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRSH %s, [%s, %s]", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], Registre[REG_NUM(i, 6)]); + return txt; +} + +char * OP_STR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STR %s, [%s, #%X]", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], (int)((i>>4)&0x7C)); + return txt; +} + +char * OP_LDR_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDR %s, [%s, #%X]", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], (int)((i>>4)&0x7C)); + return txt; +} + +char * OP_STRB_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRB %s, [%s, #%X]", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], (int)((i>>6)&0x1F)); + return txt; +} + +char * OP_LDRB_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRB %s, [%s, #%X]", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], (int)((i>>6)&0x1F)); + return txt; +} + +char * OP_STRH_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STRH %s, [%s, #%X]", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], (int)((i>>5)&0x3E)); + return txt; +} + +char * OP_LDRH_IMM_OFF(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDRH %s, [%s, #%X]", Registre[REG_NUM(i, 0)], Registre[REG_NUM(i, 3)], (int)((i>>5)&0x3E)); + return txt; +} + +char * OP_STR_SPREL(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "STR %s, [SP, #%X]", Registre[REG_NUM(i, 8)], (int)((i&0xFF)<<2)); + return txt; +} + +char * OP_LDR_SPREL(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "LDR %s, [SP, #%X]", Registre[REG_NUM(i, 8)], (int)((i&0xFF)<<2)); + return txt; +} + +char * OP_ADD_2PC(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "ADD %s, PC, #%X", Registre[REG_NUM(i, 8)], (int)((i&0xFF)<<2)); + return txt; +} + +char * OP_ADD_2SP(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "ADD %s, SP, #%X", Registre[REG_NUM(i, 8)], (int)((i&0xFF)<<2)); + return txt; +} + +char * OP_ADJUST_P_SP(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "ADD SP, #%X", (int)((i&0x7F)<<2)); + return txt; +} + +char * OP_ADJUST_M_SP(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SUB SP, #%X", (int)((i&0x7F)<<2)); + return txt; +} + +char * OP_PUSH(u32 adr, u32 i, char * txt) +{ + RegList(8); + sprintf(txt, "PUSH {%s}", lreg); + return txt; +} + +char * OP_PUSH_LR(u32 adr, u32 i, char * txt) +{ + RegList(8); + sprintf(txt, "PUSH {%s, LR}", lreg); + return txt; +} + +char * OP_POP(u32 adr, u32 i, char * txt) +{ + RegList(8); + sprintf(txt, "POP {%s}", lreg); + return txt; +} + +char * OP_POP_PC(u32 adr, u32 i, char * txt) +{ + RegList(8); + sprintf(txt, "POP {%s, PC}", lreg); + return txt; +} + +char * OP_BKPT_THUMB(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "BKPT"); + return txt; +} + +char * OP_STMIA_THUMB(u32 adr, u32 i, char * txt) +{ + RegList(8); + sprintf(txt, "STMIA %s!, {%s}", Registre[REG_NUM(i, 8)], lreg); + return txt; +} + +char * OP_LDMIA_THUMB(u32 adr, u32 i, char * txt) +{ + RegList(8); + sprintf(txt, "LDMIA %s!, {%s}", Registre[REG_NUM(i, 8)], lreg); + return txt; +} + +char * OP_B_COND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "B%s #%X", Condition[(i>>8)&0xF], (int)(adr+(((signed long)((signed char)(i&0xFF)))<<1)+4)); + return txt; +} + +char * OP_SWI_THUMB(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "SWI #%X", (int)(i & 0xFF)); + return txt; +} + +#define SIGNEEXT_IMM11(i) (((i)&0x7FF) | (BIT10(i) * 0xFFFFF800)) + +char * OP_B_UNCOND(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "B #%X", (int)(adr+(SIGNEEXT_IMM11(i)<<1)+4)); + return txt; +} + +u32 part = 0; + +char * OP_BLX(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "BLX #%X", (int)(part + ((i&0x7FF)<<1))&0xFFFFFFFC); + return txt; +} + +char * OP_BL_10(u32 adr, u32 i, char * txt) +{ + part = adr+4 + (SIGNEEXT_IMM11(i)<<12); + sprintf(txt, "CALCUL LA PARTIE HAUTE DE L'ADRESSE"); + return txt; + +} + +char * OP_BL_THUMB(u32 adr, u32 i, char * txt) +{ + sprintf(txt, "BL #%X", (int)(part + ((i&0x7FF)<<1))&0xFFFFFFFC); + return txt; +} + +#define TYPE_RETOUR char * +#define PARAMETRES u32 adr, u32 i, char * txt +#define CALLTYPE +#define NOM_TAB des_arm_instructions_set +#define NOM_THUMB_TAB des_thumb_instructions_set + +#include "instruction_tabdef.inc" +#include "thumb_tabdef.inc" + diff --git a/desmume/src/Disassembler.h b/desmume/src/Disassembler.h new file mode 100644 index 000000000..367b070b3 --- /dev/null +++ b/desmume/src/Disassembler.h @@ -0,0 +1,40 @@ +/* Copyright (C) 2006 yopyop + yopyop156@ifrance.com + yopyop156.ifrance.com + + This file is part of DeSmuME + + DeSmuME 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. + + DeSmuME 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 DeSmuME; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#ifndef DISASSEMBLER_H +#define DISASSEMBLER_H + +#include "types.h" + +#ifdef __cplusplus +extern "C" { +#endif + +extern char * (* des_arm_instructions_set[4096])(u32 adr, u32 i, char * txt); +extern char * (* des_thumb_instructions_set[1024])(u32 adr, u32 i, char * txt); + +#ifdef __cplusplus +} +#endif + +#endif + + diff --git a/desmume/src/Makefile.am b/desmume/src/Makefile.am index 979f3ff4c..3f2c3292f 100644 --- a/desmume/src/Makefile.am +++ b/desmume/src/Makefile.am @@ -4,7 +4,7 @@ libdesmume_a_SOURCES = \ armcpu.cpp armcpu.hpp \ arm_instructions.cpp arm_instructions.hpp \ bios.cpp bios.hpp cp15.cpp cp15.hpp \ - Disassembler.cpp Disassembler.hpp \ + Disassembler.c Disassembler.h \ FIFO.c FIFO.h \ GPU.cpp GPU.hpp debug.c debug.h \ MMU.cpp MMU.hpp NDSSystem.cpp NDSSystem.hpp \ diff --git a/desmume/src/armcpu.h b/desmume/src/armcpu.h index 2bdef6589..66a43c429 100644 --- a/desmume/src/armcpu.h +++ b/desmume/src/armcpu.h @@ -22,52 +22,16 @@ #ifndef ARM_CPU #define ARM_CPU -#include "types.h" - #include "MMU.hpp" -#define BIT_N(i,n) (((i)>>(n))&1) -#define CONDITION(i) (i)>>28 +#include "bits.h" + #define CODE(i) (((i)>>25)&0X7) #define OPCODE(i) (((i)>>21)&0xF) #define SIGNEBIT(i) BIT_N(i,20) -#define BIT0(i) ((i)&1) -#define BIT1(i) BIT_N(i,1) -#define BIT2(i) BIT_N(i,2) -#define BIT3(i) BIT_N(i,3) -#define BIT4(i) BIT_N(i,4) -#define BIT5(i) BIT_N(i,5) -#define BIT6(i) BIT_N(i,6) -#define BIT7(i) BIT_N(i,7) -#define BIT8(i) BIT_N(i,8) -#define BIT9(i) BIT_N(i,9) -#define BIT10(i) BIT_N(i,10) -#define BIT11(i) BIT_N(i,11) -#define BIT12(i) BIT_N(i,12) -#define BIT13(i) BIT_N(i,13) -#define BIT14(i) BIT_N(i,14) -#define BIT15(i) BIT_N(i,15) -#define BIT16(i) BIT_N(i,16) -#define BIT17(i) BIT_N(i,17) -#define BIT18(i) BIT_N(i,18) -#define BIT19(i) BIT_N(i,19) -#define BIT20(i) BIT_N(i,20) -#define BIT21(i) BIT_N(i,21) -#define BIT22(i) BIT_N(i,22) -#define BIT23(i) BIT_N(i,23) -#define BIT24(i) BIT_N(i,24) -#define BIT25(i) BIT_N(i,25) -#define BIT26(i) BIT_N(i,26) -#define BIT27(i) BIT_N(i,27) -#define BIT28(i) BIT_N(i,28) -#define BIT29(i) BIT_N(i,29) -#define BIT30(i) BIT_N(i,30) -#define BIT31(i) ((i)>>31) #define INSTRUCTION_INDEX(i) ((((i)>>16)&0xFF0)|(((i)>>4)&0xF)) -#define REG_POS(i,n) (((i)>>n)&0xF) - #define ROR(i, j) ((((u32)(i))>>(j)) | (((u32)(i))<<(32-(j)))) #define UNSIGNED_OVERFLOW(a,b,c) ((BIT31(a)&BIT31(b)) | \ diff --git a/desmume/src/bits.h b/desmume/src/bits.h new file mode 100644 index 000000000..d3fc591b9 --- /dev/null +++ b/desmume/src/bits.h @@ -0,0 +1,42 @@ +#ifndef BITS_H +#define BITS_H + +#define BIT_N(i,n) (((i)>>(n))&1) +#define BIT0(i) ((i)&1) +#define BIT1(i) BIT_N(i,1) +#define BIT2(i) BIT_N(i,2) +#define BIT3(i) BIT_N(i,3) +#define BIT4(i) BIT_N(i,4) +#define BIT5(i) BIT_N(i,5) +#define BIT6(i) BIT_N(i,6) +#define BIT7(i) BIT_N(i,7) +#define BIT8(i) BIT_N(i,8) +#define BIT9(i) BIT_N(i,9) +#define BIT10(i) BIT_N(i,10) +#define BIT11(i) BIT_N(i,11) +#define BIT12(i) BIT_N(i,12) +#define BIT13(i) BIT_N(i,13) +#define BIT14(i) BIT_N(i,14) +#define BIT15(i) BIT_N(i,15) +#define BIT16(i) BIT_N(i,16) +#define BIT17(i) BIT_N(i,17) +#define BIT18(i) BIT_N(i,18) +#define BIT19(i) BIT_N(i,19) +#define BIT20(i) BIT_N(i,20) +#define BIT21(i) BIT_N(i,21) +#define BIT22(i) BIT_N(i,22) +#define BIT23(i) BIT_N(i,23) +#define BIT24(i) BIT_N(i,24) +#define BIT25(i) BIT_N(i,25) +#define BIT26(i) BIT_N(i,26) +#define BIT27(i) BIT_N(i,27) +#define BIT28(i) BIT_N(i,28) +#define BIT29(i) BIT_N(i,29) +#define BIT30(i) BIT_N(i,30) +#define BIT31(i) ((i)>>31) + +#define CONDITION(i) (i)>>28 + +#define REG_POS(i,n) (((i)>>n)&0xF) + +#endif diff --git a/desmume/src/cp15.h b/desmume/src/cp15.h index 5e3857c5f..6877096dc 100644 --- a/desmume/src/cp15.h +++ b/desmume/src/cp15.h @@ -22,8 +22,6 @@ #ifndef __CP15_H__ #define __CP15_H__ -#include "types.h" - #include "armcpu.h" typedef struct diff --git a/desmume/src/thumb_instructions.h b/desmume/src/thumb_instructions.h index be81af8f8..87a8c22b3 100644 --- a/desmume/src/thumb_instructions.h +++ b/desmume/src/thumb_instructions.h @@ -22,8 +22,6 @@ #ifndef THUMB_INSTRUCTIONS_H #define THUMB_INSTRUCTIONS_H -#include "types.h" - #include "armcpu.h" extern u32 (* FASTCALL thumb_instructions_set[1024])(armcpu_t * cpu);