uk.ac.man.cs.rainbow.simulator
Class RASM.BinaryIntFunction
java.lang.Object
|
+--uk.ac.man.cs.rainbow.simulator.Instruction
|
+--uk.ac.man.cs.rainbow.simulator.RASM.BinaryIntFunction
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- Add, Div, Mod, Mult, Shl, Shr, Shrz, Sub
- Enclosing class:
- RASM
- public abstract static class RASM.BinaryIntFunction
- extends Instruction
Binary operations over integers. Factorises out the actual
stack manipulation code as that is common across all the variants.
All are of the form:
x y
op(x,y)
- See Also:
RASMThread.popInt()
,
RASMThread.push(int)
, Serialized Form
Method Summary |
protected abstract int |
execute(int x,
int y)
Perform an integer binary operation. |
protected boolean |
execute(RASMThread thread)
Make this instruction execute in the given context. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RASM.BinaryIntFunction
public RASM.BinaryIntFunction()
RASM.BinaryIntFunction
public RASM.BinaryIntFunction(RASMCode code)
execute
protected abstract int execute(int x,
int y)
throws RASMThread.Exception
- Perform an integer binary operation.
- Parameters:
x
- The first (lower on the stack) value argument.y
- The second (higher on the stack) value argument.- Returns:
- The result of the operation.
execute
protected final boolean execute(RASMThread thread)
throws RASMThread.Exception
- Description copied from class:
Instruction
- Make this instruction execute in the given context.
- Overrides:
execute
in class Instruction
- Following copied from class:
uk.ac.man.cs.rainbow.simulator.Instruction
- Throws:
RainbowException
- All sorts of things can go wrong during execution...