Arch.SM213.Machine
Class AbstractSM213CPU
java.lang.Object
java.util.Observable
Machine.AbstractCPU
Arch.SM213.Machine.AbstractSM213CPU
- Direct Known Subclasses:
- CPU
public abstract class AbstractSM213CPU
- extends AbstractCPU
Method Summary |
protected void |
cycle()
Computes one cycle of the SM213 CPU |
protected abstract void |
execute()
Impemented by STUDENTS to execute instruction currently loaded in processorState registers. |
protected abstract void |
fetch()
Implemented by STUDENTS to fetch next instruction from memory into CPU processorState registers. |
void |
setPC(int aPC)
Set PC to value |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ps
protected RegisterSet ps
pc
protected Register pc
instruction
protected Register instruction
insOpCode
protected Register insOpCode
insOp0
protected Register insOp0
insOp1
protected Register insOp1
insOp2
protected Register insOp2
insOpImm
protected Register insOpImm
insOpExt
protected Register insOpExt
curInst
protected Register curInst
AbstractSM213CPU
public AbstractSM213CPU(AbstractMainMemory aMem)
cycle
protected void cycle()
throws AbstractCPU.InvalidInstructionException,
AbstractCPU.MachineHaltException,
AbstractMainMemory.InvalidAddressException
- Computes one cycle of the SM213 CPU
- Specified by:
cycle
in class AbstractCPU
- Throws:
AbstractCPU.InvalidInstructionException
AbstractCPU.MachineHaltException
AbstractMainMemory.InvalidAddressException
setPC
public void setPC(int aPC)
- Description copied from class:
AbstractCPU
- Set PC to value
- Overrides:
setPC
in class AbstractCPU
fetch
protected abstract void fetch()
throws AbstractMainMemory.InvalidAddressException
- Implemented by STUDENTS to fetch next instruction from memory into CPU processorState registers.
- Throws:
AbstractMainMemory.InvalidAddressException
execute
protected abstract void execute()
throws AbstractCPU.InvalidInstructionException,
AbstractCPU.MachineHaltException,
RegisterSet.InvalidRegisterNumberException,
AbstractMainMemory.InvalidAddressException
- Impemented by STUDENTS to execute instruction currently loaded in processorState registers.
- Throws:
AbstractCPU.InvalidInstructionException
AbstractCPU.MachineHaltException
RegisterSet.InvalidRegisterNumberException
AbstractMainMemory.InvalidAddressException