Package mars.assembler
Class BasicStatement
java.lang.Object
mars.assembler.BasicStatement
- All Implemented Interfaces:
Statement
-
Constructor Summary
ConstructorsConstructorDescriptionBasicStatement
(StatementSyntax syntax, BasicInstruction instruction, List<Operand> operands) BasicStatement
(StatementSyntax syntax, BasicInstruction instruction, List<Operand> operands, int binaryEncoding) -
Method Summary
Modifier and TypeMethodDescriptionint
int
getOperand
(int index) void
handlePlacement
(Assembler assembler, int address) void
simulate()
Simulate the execution of a specific MIPS basic instruction.toString()
-
Constructor Details
-
BasicStatement
-
BasicStatement
public BasicStatement(StatementSyntax syntax, BasicInstruction instruction, List<Operand> operands, int binaryEncoding)
-
-
Method Details
-
getSyntax
-
getInstruction
-
getOperands
-
getOperand
public int getOperand(int index) -
getBinaryEncoding
public int getBinaryEncoding() -
handlePlacement
- Specified by:
handlePlacement
in interfaceStatement
-
simulate
Simulate the execution of a specific MIPS basic instruction.- Throws:
SimulatorException
- Thrown if a runtime exception was generated during execution.InterruptedException
- Thrown if the simulator was stopped during execution.
-
toString
-