|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--CPU
CPU simulates the central processing unit of SimpComp, which hosts and maintains registers, pc and ir. The primary functionality of CPU resides in its sequencer() in which each call to sequencer results in an execution of an instruction.
Constructor Summary | |
CPU()
|
Method Summary | |
int |
getFlag()
Returns the current flag status (includes ZNOC) as an integer. |
short[] |
getIR()
Retrieves the instruction register (IR). |
java.lang.String |
getParams()
Retrieves the parameters of the current instruction. |
int |
getPC()
Retrieves the program counter (PC). |
int[] |
getRegister()
Retrieves the register array. |
java.lang.String |
getStdOut()
Returns the standard ouput. |
void |
reset()
Resets all registers and flags to 0, program counter to 0x1000, stdI/O to empty. |
boolean |
sequencer(SCMainMem mm)
Executes one instruction per call. |
java.lang.String |
toString()
Overwrites the toString() inherited from Object Class. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CPU()
Method Detail |
public boolean sequencer(SCMainMem mm) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public java.lang.String toString()
toString
in class java.lang.Object
public int[] getRegister()
public int getPC()
public short[] getIR()
public void reset()
public java.lang.String getParams()
public java.lang.String getStdOut()
public int getFlag()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |