public override AArch32Instruction Decode(uint wInstr, T32Disassembler dasm) { // A hack -- we patch up the output of the regular decoder. var instr = base.Decode(wInstr, dasm); ImmediateOperand opLsb; ImmediateOperand opMsb; if (instr.Operands.Length > 3) { opMsb = (ImmediateOperand)instr.Operands[3]; opLsb = (ImmediateOperand)instr.Operands[2]; } else { opMsb = (ImmediateOperand)instr.Operands[2]; opLsb = (ImmediateOperand)instr.Operands[1]; } int width = opMsb.Value.ToInt32() - opLsb.Value.ToInt32() + 1; if (width <= 0) { return(dasm.CreateInvalidInstruction()); } var opWidth = ImmediateOperand.Word32(width); if (instr.Operands.Length > 3) { instr.Operands[3] = opWidth; } else { instr.Operands[2] = opWidth; } return(instr); }
public override AArch32Instruction Decode(uint wInstr, T32Disassembler dasm) { DumpMaskedInstruction(wInstr, 0, this.mnemonic); dasm.state.mnemonic = this.mnemonic; dasm.state.iclass = this.iclass; dasm.state.vectorData = this.vec; for (int i = 0; i < mutators.Length; ++i) { if (!mutators[i](wInstr, dasm)) { return(dasm.CreateInvalidInstruction()); } } var instr = dasm.state.MakeInstruction(); return(instr); }