edu.cornell.cs.sam.core.instructions
Class SamIntInstruction

java.lang.Object
  extended by edu.cornell.cs.sam.core.instructions.SamInstruction
      extended by edu.cornell.cs.sam.core.instructions.SamIntInstruction
All Implemented Interfaces:
Instruction, java.io.Serializable
Direct Known Subclasses:
SAM_ADDSP, SAM_LSHIFT, SAM_PUSHABS, SAM_PUSHIMM, SAM_PUSHIMMMA, SAM_PUSHOFF, SAM_RSHIFT, SAM_STOREABS, SAM_STOREOFF, SamAddressInstruction

public abstract class SamIntInstruction
extends SamInstruction

All instructions with an integer operand are derived from this class.

See Also:
Serialized Form

Field Summary
protected  int op
           
 
Fields inherited from class edu.cornell.cs.sam.core.instructions.SamInstruction
cpu, FBR, HALT, mem, name, PC, prog, SP, sys, video
 
Constructor Summary
SamIntInstruction()
           
 
Method Summary
 int getOperand()
          Returns the integer operand of this instruction
 void setOperand(int operand)
          Sets the integer operand of this instruction
 java.lang.String toString()
          Prints out the text that represents this SaM instruction
 
Methods inherited from class edu.cornell.cs.sam.core.instructions.SamInstruction
exec, getName, getProgram, getSystem, setProgram, setSystem
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

op

protected int op
Constructor Detail

SamIntInstruction

public SamIntInstruction()
Method Detail

toString

public java.lang.String toString()
Description copied from interface: Instruction
Prints out the text that represents this SaM instruction

Specified by:
toString in interface Instruction
Overrides:
toString in class SamInstruction
Returns:
The string representation of this instruction

getOperand

public int getOperand()
Returns the integer operand of this instruction

Returns:
The integer operand

setOperand

public void setOperand(int operand)
Sets the integer operand of this instruction

Parameters:
operand - The integer operand