uk.ac.man.cs.rainbow.simulator.rasm
Class Xor

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.Xor
All Implemented Interfaces:
Serializable

public class Xor
extends RASM.BinaryLogicFunction

Bitwise/logical exclusive or. 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

Inner classes inherited from class uk.ac.man.cs.rainbow.simulator.Instruction
Instruction.MACRO
 
Constructor Summary
Xor()
           
Xor(RASMCode code)
           
 
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()
           
 
Methods inherited from class uk.ac.man.cs.rainbow.simulator.RASM.BinaryLogicFunction
execute
 
Methods inherited from class uk.ac.man.cs.rainbow.simulator.Instruction
addClass, getInstruction, getInstruction, getInstruction
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Xor

public Xor()

Xor

public Xor(RASMCode code)
Method Detail

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.