public static int getArg(DecodedInstruction insn, int arg) { switch (arg) { case 0: return insn.getA(); case 1: return insn.getB(); case 2: return insn.getC(); case 3: return insn.getD(); case 4: return insn.getE(); default: throw new JadxRuntimeException("Wrong argument number: " + arg); } }
/** * Gets the B register number, as a byte. This will throw if the * value is out of the range of an unsigned byte. */ public final short getBByte() { int b = getB(); if ((b & ~0xff) != 0) { throw new DexException("Register B out of range: " + Hex.u8(b)); } return (short) b; }
/** * Gets the B register number, as a nibble. This will throw if the * value is out of the range of an unsigned nibble. */ public final short getBNibble() { int b = getB(); if ((b & ~0xf) != 0) { throw new DexException("Register B out of range: " + Hex.u8(b)); } return (short) b; }
/** * Gets the B register number, as a byte. This will throw if the * value is out of the range of an unsigned byte. */ public final short getBByte() { int b = getB(); if ((b & ~0xff) != 0) { throw new DexException("Register B out of range: " + Hex.u8(b)); } return (short) b; }
/** * Gets the B register number, as a code unit. This will throw if the * value is out of the range of an unsigned code unit. */ public final short getBUnit() { int b = getB(); if ((b & ~0xffff) != 0) { throw new DexException("Register B out of range: " + Hex.u8(b)); } return (short) b; }
@Override public void encode(DecodedInstruction insn, CodeOutput out) { out.write( codeUnit(insn.getOpcodeUnit(), makeByte(insn.getA(), insn.getB()))); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { out.write( codeUnit(insn.getOpcodeUnit(), makeByte(insn.getA(), insn.getB()))); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { out.write( codeUnit(insn.getOpcodeUnit(), makeByte(insn.getA(), insn.getB()))); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { out.write( codeUnit(insn.getOpcode(), insn.getA()), codeUnit(insn.getB(), insn.getC())); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { out.write( codeUnit(insn.getOpcode(), makeByte(insn.getA(), insn.getB())), insn.getLiteralUnit()); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { out.write( codeUnit(insn.getOpcode(), makeByte(insn.getA(), insn.getB())), insn.getIndexUnit()); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { out.write( codeUnit(insn.getOpcode(), insn.getA()), codeUnit(insn.getB(), insn.getC())); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { out.write( codeUnit(insn.getOpcode(), insn.getA()), codeUnit(insn.getB(), insn.getLiteralByte())); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { out.write( codeUnit(insn.getOpcode(), makeByte(insn.getA(), insn.getB())), insn.getIndexUnit()); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { out.write( codeUnit(insn.getOpcode(), makeByte(insn.getA(), insn.getB())), insn.getLiteralUnit()); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { short relativeTarget = insn.getTargetUnit(out.cursor()); out.write( codeUnit(insn.getOpcode(), makeByte(insn.getA(), insn.getB())), relativeTarget); } },
@Override public void encode(DecodedInstruction insn, CodeOutput out) { short relativeTarget = insn.getTargetUnit(out.cursor()); out.write( codeUnit(insn.getOpcode(), makeByte(insn.getA(), insn.getB())), relativeTarget); } },
/** * Helper method that encodes any of the register-list formats. */ private static void encodeRegisterList(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), makeByte(insn.getE(), insn.getRegisterCount())), insn.getIndexUnit(), codeUnit(insn.getA(), insn.getB(), insn.getC(), insn.getD())); }
/** * Helper method that encodes any of the register-list formats. */ private static void encodeRegisterList(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), makeByte(insn.getE(), insn.getRegisterCount())), insn.getIndexUnit(), codeUnit(insn.getA(), insn.getB(), insn.getC(), insn.getD())); }
/** * Helper method that encodes any of the register-list formats. */ private static void encodeRegisterList(DecodedInstruction insn, CodeOutput out) { out.write(codeUnit(insn.getOpcode(), makeByte(insn.getE(), insn.getRegisterCount())), insn.getIndexUnit(), codeUnit(insn.getA(), insn.getB(), insn.getC(), insn.getD())); }