Package CPU
Class DisassembledInstruction
java.lang.Object
CPU.DisassembledInstruction
A disassembled instruction (as a string).
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal int
final String
final int
final DisassembledOperand
final DisassembledOperand
final int
-
Constructor Summary
ConstructorsConstructorDescriptionDisassembledInstruction
(int address, int opcode, String instruction) A disassembled instruction with no operands.DisassembledInstruction
(int address, int opcode, String instruction, DisassembledOperand dop) A disassembled instruction with one operand.DisassembledInstruction
(int address, int opcode, String instruction, DisassembledOperand dop1, DisassembledOperand dop2) A disassembled instruction with 2 operands. -
Method Summary
Modifier and TypeMethodDescriptionvoid
formatInstruction
(StringBuilder buffer) Formats the instruction in the provided StringBuffer.void
shortFormat
(StringBuilder buffer) Formats the instruction in the provided StringBuffer, in short format.int
size()
Get the size of the instruction.toString()
-
Field Details
-
address
public final int address -
opcode
public final int opcode -
num_operands
public final int num_operands -
instruction
-
op1
-
op2
-
-
Constructor Details
-
DisassembledInstruction
A disassembled instruction with no operands.- Parameters:
address
- where to start disassembling.opcode
- the opcode to disassemble.instruction
- the instruction string corresponding to the opcode.
-
DisassembledInstruction
public DisassembledInstruction(int address, int opcode, String instruction, DisassembledOperand dop) A disassembled instruction with one operand.- Parameters:
address
- where to start disassembling.opcode
- the opcode to disassemble.instruction
- the instruction string corresponding to the opcode.dop
- the operand.
-
DisassembledInstruction
public DisassembledInstruction(int address, int opcode, String instruction, DisassembledOperand dop1, DisassembledOperand dop2) A disassembled instruction with 2 operands.- Parameters:
address
- where to start disassembling.opcode
- the opcode to disassemble.instruction
- the instruction string corresponding to the opcode.dop1
- the 1st operand.dop2
- the 2nd operand.
-
-
Method Details
-
size
public int size()Get the size of the instruction.- Returns:
- the size of the instruction, in bytes.
-
shortFormat
Formats the instruction in the provided StringBuffer, in short format.- Parameters:
buffer
- wherein to format the instrcution.
-
formatInstruction
Formats the instruction in the provided StringBuffer.- Parameters:
buffer
- wherein to format the instruction.
-
toString
-