|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectedu.cornell.cs.sam.core.instructions.SamInstruction
public abstract class SamInstruction
Base class for all SamInstructions Defines common features such as shortcut variables and methods, toString(), name, cpu/mem access, and an abstract exec().
| Field Summary | |
|---|---|
protected Processor |
cpu
|
protected static int |
FBR
|
protected static int |
HALT
|
protected Memory |
mem
|
protected java.lang.String |
name
|
protected static int |
PC
|
protected Program |
prog
|
protected static int |
SP
|
protected Sys |
sys
|
protected Video |
video
|
| Constructor Summary | |
|---|---|
SamInstruction()
|
|
| Method Summary | |
|---|---|
abstract void |
exec()
Executes the instruction |
java.lang.String |
getName()
Gets the name of this instruction |
Program |
getProgram()
Gets the program that this instruction is part of |
Sys |
getSystem()
Gets the System object of this instruction |
void |
setProgram(Program p)
Sets the program that this instruction is part of |
void |
setSystem(Sys sys)
Sets the System object for this instruction |
java.lang.String |
toString()
Prints out the text that represents this SaM instruction |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final java.lang.String name
protected transient Program prog
protected transient Processor cpu
protected transient Memory mem
protected transient Video video
protected transient Sys sys
protected static final int PC
protected static final int SP
protected static final int HALT
protected static final int FBR
| Constructor Detail |
|---|
public SamInstruction()
| Method Detail |
|---|
public java.lang.String toString()
Instruction
toString in interface InstructiontoString in class java.lang.Objectpublic java.lang.String getName()
Instruction
getName in interface Instructionpublic void setSystem(Sys sys)
Instruction
setSystem in interface Instructionsys - The system object for this instructionpublic Sys getSystem()
Instruction
getSystem in interface Instructionpublic void setProgram(Program p)
Instruction
setProgram in interface Instructionp - The program containing this instructionpublic Program getProgram()
Instruction
getProgram in interface Instruction
public abstract void exec()
throws SystemException
Instruction
exec in interface InstructionSystemException - if there is a runtime error
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||