hades.models.mips.core
Class Registers

java.lang.Object
  extended byhades.models.mips.memory.BreakPointMemory
      extended byhades.models.mips.core.Registers
All Implemented Interfaces:
Memory, Resetable

public class Registers
extends BreakPointMemory
implements Resetable

35 Registers with 32 bits, accessable with the Memory interface. Regster 0 always contains 0, 31 registers are for general purpose use and pc, lo and hi are the program counter, lo and hi registers for multiplication/division.


Field Summary
static int HI
           
static int LO
           
protected  PartHandler partHandler
           
static int PC
           
 
Fields inherited from class hades.models.mips.memory.BreakPointMemory
BP_IDLE, BP_READALL, BP_READVAL, BP_WRITEALL, BP_WRITEVAL, bpHandler, bpHandlerInstalled, debug, mem, readBP, readVal, writeBP, writeVal
 
Constructor Summary
Registers(PartHandler newPartHandler)
           
 
Method Summary
 int incAndReadPC()
           
 void por()
          Power on reset or hardware reset
 int readHI()
           
 int readLO()
           
 int readMemory(int address)
          Read a word from the memory
 int readPC()
           
 int readRegister(int register)
           
 void reset()
          software reset
 void writeHI(int newValue)
           
 void writeLO(int newValue)
           
 void writeMemory(int address, int word)
          Write a word into the memory
 void writePC(int newValue)
           
 void writeRegister(int register, int value)
           
 
Methods inherited from class hades.models.mips.memory.BreakPointMemory
getLog, getMemory, getMemorySize, getReadBPMemory, getReadValMemory, getWordWidth, getWriteBPMemory, getWriteValMemory, installBreakPointHandler, installEntryHandler, setEntry, setLog, setReadBP, setWriteBP
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PC

public static final int PC
See Also:
Constant Field Values

LO

public static final int LO
See Also:
Constant Field Values

HI

public static final int HI
See Also:
Constant Field Values

partHandler

protected PartHandler partHandler
Constructor Detail

Registers

public Registers(PartHandler newPartHandler)
Method Detail

por

public void por()
Power on reset or hardware reset

Specified by:
por in interface Resetable

reset

public void reset()
software reset

Specified by:
reset in interface Resetable

readMemory

public int readMemory(int address)
Read a word from the memory

Specified by:
readMemory in interface Memory
Overrides:
readMemory in class BreakPointMemory

writeMemory

public void writeMemory(int address,
                        int word)
Write a word into the memory

Specified by:
writeMemory in interface Memory
Overrides:
writeMemory in class BreakPointMemory

readRegister

public int readRegister(int register)

writeRegister

public void writeRegister(int register,
                          int value)

readPC

public int readPC()

incAndReadPC

public int incAndReadPC()

writePC

public void writePC(int newValue)

readLO

public int readLO()

writeLO

public void writeLO(int newValue)

readHI

public int readHI()

writeHI

public void writeHI(int newValue)