| Constructor and Description |
|---|
SimpleCPUCore() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getDescription()
Textual description of the hardware
|
<T> T |
getRegister(int i)
Obtain the value of a given register
|
java.lang.Object[] |
getRegisters()
Obtain the core's register array
|
void |
handleInterrupt(Interrupt interrupt)
Handle an interrupt
|
void |
load(Context context)
Load context to the core
|
void |
setRegisters(int register,
java.lang.Object... values)
Set the value of a sequence of registers
|
void |
tick()
The fetch-decode-execute loop
|
java.lang.String |
toString() |
getContextpublic void load(Context context)
CPUCorepublic void tick()
public java.lang.String getDescription()
Clockablepublic void handleInterrupt(Interrupt interrupt) throws java.lang.Exception
CPUCorehandleInterrupt in class CPUCoreinterrupt - The interrupt to handlejava.lang.Exceptionpublic void setRegisters(int register,
java.lang.Object... values)
throws InvalidRegisterException
CPUCoresetRegisters in class CPUCoreregister - The initial register to affectvalues - The values to storeInvalidRegisterException - Thrown if the sequence of registers to affect goes beyond the number of registers supported by the CPU corepublic <T> T getRegister(int i)
throws InvalidRegisterException
CPUCoregetRegister in class CPUCorei - The number of the register to readInvalidRegisterException - Thrown if number is not a valid registerpublic java.lang.Object[] getRegisters()
CPUCoregetRegisters in class CPUCorepublic java.lang.String toString()
toString in class java.lang.Object