Note
The names of the arguments are not meant to match the names given in the Dalvik instruction format specification, specification which just names fields (somewhat) arbitrarily alphabetically from A. In this class, non-register fields are given descriptive names and register fields are consistently named alphabetically.
| Modifier and Type | Field and Description |
|---|---|
| private final InstructionCodec | format
non-null; instruction format / codec |
| private final int | index
constant index argument |
| private final IndexType | indexType
null-ok; index type |
| private final long | literal
literal value argument; also used for special verification error constants (formats 20bc and 40sc) as well as should-be-zero values (formats 10x, 20t, 30t, and 32x) |
| private final int | opcode
opcode number |
| private final int | target
target address argument. |
| Access | Constructor and Description |
|---|---|
| public | DecodedInstruction(InstructionCodec format, int opcode, int index, IndexType indexType, int target, long literal)
Constructs an instance. |
| Modifier and Type | Method and Description |
|---|---|
| public static DecodedInstruction | |
| public static DecodedInstruction[] | |
| public final void | |
| public int | |
| public final short | |
| public final short | |
| public final short | |
| public int | |
| public final short | |
| public final short | |
| public final short | |
| public int | |
| public final short | |
| public final short | |
| public final short | |
| public int | |
| public final short | |
| public final short | |
| public final short | |
| public int | |
| public final short | |
| public final InstructionCodec | |
| public final int | |
| public final IndexType | |
| public final short | |
| public final long | |
| public final int | |
| public final int | |
| public final int | |
| public final short | |
| public final int | |
| public final short | |
| public abstract int | |
| public final short | |
| public final int | |
| public final int | |
| public final int | getTargetByte(int baseAddress)
Gets the target as a relative offset from the given base address, masked to be a byte in size. |
| public final short | getTargetUnit(int baseAddress)
Gets the target as a relative offset from the given base address, as a code unit. |
| public abstract DecodedInstruction | withIndex(int newIndex)
Returns an instance just like this one, except with the index replaced with the given one. |
| format | back to summary |
|---|---|
| private final InstructionCodec format non-null; instruction format / codec | |
| index | back to summary |
|---|---|
| private final int index constant index argument | |
| indexType | back to summary |
|---|---|
| private final IndexType indexType null-ok; index type | |
| literal | back to summary |
|---|---|
| private final long literal literal value argument; also used for special verification error constants (formats 20bc and 40sc) as well as should-be-zero values (formats 10x, 20t, 30t, and 32x) | |
| opcode | back to summary |
|---|---|
| private final int opcode opcode number | |
| target | back to summary |
|---|---|
| private final int target target address argument. This is an absolute address, not just a signed offset Note The address is unsigned, even
though it is stored in an | |
| DecodedInstruction | back to summary |
|---|---|
| public DecodedInstruction(InstructionCodec format, int opcode, int index, IndexType indexType, int target, long literal) Constructs an instance. | |
| decode | back to summary |
|---|---|
| public static DecodedInstruction decode(CodeInput in) throws EOFException Decodes an instruction from the given input source. | |
| decodeAll | back to summary |
|---|---|
| public static DecodedInstruction[] decodeAll(short[] encodedInstructions) Decodes an array of instructions. The result has non-null elements at each offset that represents the start of an instruction. | |
| encode | back to summary |
|---|---|
| public final void encode(CodeOutput out) Encodes this instance to the given output. | |
| getA | back to summary |
|---|---|
| public int getA() | |
| getAByte | back to summary |
|---|---|
| public final short getAByte() Gets the A register number, as a byte. This will throw if the value is out of the range of an unsigned byte. | |
| getANibble | back to summary |
|---|---|
| public final short getANibble() Gets the A register number, as a nibble. This will throw if the value is out of the range of an unsigned nibble. | |
| getAUnit | back to summary |
|---|---|
| public final short getAUnit() Gets the A register number, as a code unit. This will throw if the value is out of the range of an unsigned code unit. | |
| getB | back to summary |
|---|---|
| public int getB() | |
| getBByte | back to summary |
|---|---|
| public final short getBByte() Gets the B register number, as a byte. This will throw if the value is out of the range of an unsigned byte. | |
| getBNibble | back to summary |
|---|---|
| public final short getBNibble() Gets the B register number, as a nibble. This will throw if the value is out of the range of an unsigned nibble. | |
| getBUnit | back to summary |
|---|---|
| public final short getBUnit() 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. | |
| getC | back to summary |
|---|---|
| public int getC() | |
| getCByte | back to summary |
|---|---|
| public final short getCByte() Gets the C register number, as a byte. This will throw if the value is out of the range of an unsigned byte. | |
| getCNibble | back to summary |
|---|---|
| public final short getCNibble() Gets the C register number, as a nibble. This will throw if the value is out of the range of an unsigned nibble. | |
| getCUnit | back to summary |
|---|---|
| public final short getCUnit() Gets the C register number, as a code unit. This will throw if the value is out of the range of an unsigned code unit. | |
| getD | back to summary |
|---|---|
| public int getD() | |
| getDByte | back to summary |
|---|---|
| public final short getDByte() Gets the D register number, as a byte. This will throw if the value is out of the range of an unsigned byte. | |
| getDNibble | back to summary |
|---|---|
| public final short getDNibble() Gets the D register number, as a nibble. This will throw if the value is out of the range of an unsigned nibble. | |
| getDUnit | back to summary |
|---|---|
| public final short getDUnit() Gets the D register number, as a code unit. This will throw if the value is out of the range of an unsigned code unit. | |
| getE | back to summary |
|---|---|
| public int getE() | |
| getENibble | back to summary |
|---|---|
| public final short getENibble() Gets the E register number, as a nibble. This will throw if the value is out of the range of an unsigned nibble. | |
| getFormat | back to summary |
|---|---|
| public final InstructionCodec getFormat() | |
| getIndex | back to summary |
|---|---|
| public final int getIndex() | |
| getIndexType | back to summary |
|---|---|
| public final IndexType getIndexType() | |
| getIndexUnit | back to summary |
|---|---|
| public final short getIndexUnit() Gets the index, as a code unit. | |
| getLiteral | back to summary |
|---|---|
| public final long getLiteral() | |
| getLiteralByte | back to summary |
|---|---|
| public final int getLiteralByte() Gets the literal value, masked to be a byte in size. This will throw if the value is out of the range of a signed byte. | |
| getLiteralInt | back to summary |
|---|---|
| public final int getLiteralInt() Gets the literal value, masked to be an int in size. This will throw if the value is out of the range of a signed int. | |
| getLiteralNibble | back to summary |
|---|---|
| public final int getLiteralNibble() Gets the literal value, masked to be a nibble in size. This will throw if the value is out of the range of a signed nibble. | |
| getLiteralUnit | back to summary |
|---|---|
| public final short getLiteralUnit() Gets the literal value, as a code unit. This will throw if the value is out of the range of a signed code unit. | |
| getOpcode | back to summary |
|---|---|
| public final int getOpcode() | |
| getOpcodeUnit | back to summary |
|---|---|
| public final short getOpcodeUnit() Gets the opcode, as a code unit. | |
| getRegisterCount | back to summary |
|---|---|
| public abstract int getRegisterCount() | |
| getRegisterCountUnit | back to summary |
|---|---|
| public final short getRegisterCountUnit() Gets the register count, as a code unit. This will throw if the value is out of the range of an unsigned code unit. | |
| getTarget | back to summary |
|---|---|
| public final int getTarget() Gets the raw target. | |
| getTarget | back to summary |
|---|---|
| public final int getTarget(int baseAddress) Gets the target as a relative offset from the given address. | |
| getTargetByte | back to summary |
|---|---|
| public final int getTargetByte(int baseAddress) Gets the target as a relative offset from the given base address, masked to be a byte in size. This will throw if the value is out of the range of a signed byte. | |
| getTargetUnit | back to summary |
|---|---|
| public final short getTargetUnit(int baseAddress) Gets the target as a relative offset from the given base address, as a code unit. This will throw if the value is out of the range of a signed code unit. | |
| withIndex | back to summary |
|---|---|
| public abstract DecodedInstruction withIndex(int newIndex) Returns an instance just like this one, except with the index replaced with the given one. | |