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 TypeMethodDescriptionintintgetOperand(int index) voidhandlePlacement(Assembler assembler, int address) voidsimulate()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:
handlePlacementin 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
-