uk.ac.man.cs.rainbow.simulator.rasm
Class And
java.lang.Object
|
+--uk.ac.man.cs.rainbow.simulator.Instruction
|
+--uk.ac.man.cs.rainbow.simulator.RASM.BinaryLogicFunction
|
+--uk.ac.man.cs.rainbow.simulator.rasm.And
- All Implemented Interfaces:
- Serializable
- public class And
- extends RASM.BinaryLogicFunction
Bitwise/logical and. Can take any enumerable value as input, and
generates integer output, unless both inputs were
boolean values, in which case it generates boolean output.
x y
x&y
- See Also:
- Serialized Form
Method Summary |
protected boolean |
execute(boolean x,
boolean y)
Perform a logical binary operation over booleans. |
protected int |
execute(int x,
int y)
Perform a logical binary operation over integers (bit-wise). |
String |
toString()
|
And
public And()
And
public And(RASMCode code)
toString
public String toString()
- Overrides:
toString
in class Object
execute
protected int execute(int x,
int y)
- Description copied from class:
RASM.BinaryLogicFunction
- Perform a logical binary operation over integers (bit-wise).
- Overrides:
execute
in class RASM.BinaryLogicFunction
- Following copied from class:
uk.ac.man.cs.rainbow.simulator.RASM.BinaryLogicFunction
- 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 boolean execute(boolean x,
boolean y)
- Description copied from class:
RASM.BinaryLogicFunction
- Perform a logical binary operation over booleans.
- Overrides:
execute
in class RASM.BinaryLogicFunction
- Following copied from class:
uk.ac.man.cs.rainbow.simulator.RASM.BinaryLogicFunction
- 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.