|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mars.mips.hardware.RegisterFile
Represents the collection of MIPS registers.
Constructor Summary | |
RegisterFile()
|
Method Summary | |
static void |
addRegistersObserver(java.util.Observer observer)
Each individual register is a separate object and Observable. |
static int |
getInitialProgramCounter()
For returning the program counter's initial (reset) value. |
static int |
getNumber(java.lang.String n)
For getting the number representation of the register. |
static int |
getProgramCounter()
For returning the program counters value. |
static Register[] |
getRegisters()
For returning the set of registers. |
static Register |
getUserRegister(java.lang.String Rname)
Get register object corresponding to given name. |
static int |
getValue(int num)
Returns the value of the register who's number is num. |
static void |
incrementPC()
Method to increment the Program counter in the general case (not a jump or branch). |
static void |
initializeProgramCounter(int value)
For initializing the Program Counter. |
static void |
resetRegisters()
Method to reinitialize the values of the registers. |
static int |
setProgramCounter(int value)
For setting the Program Counter. |
static void |
showRegisters()
Method for displaying the register values for debugging. |
static int |
updateRegister(int num,
int val)
This method updates the register value who's number is num. |
static void |
updateRegister(java.lang.String reg,
int val)
Sets the value of the register given to the value given. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public RegisterFile()
Method Detail |
public static void showRegisters()
public static int updateRegister(int num, int val)
num
- Register to set the value of.val
- The desired value for the register.public static void updateRegister(java.lang.String reg, int val)
reg
- Name of register to set the value of.val
- The desired value for the register.public static int getValue(int num)
num
- The register number.
public static int getNumber(java.lang.String n)
n
- The string formatted register name to look for.
public static Register[] getRegisters()
public static Register getUserRegister(java.lang.String Rname)
Rname
- The register name, either in $0 or $zero format.
public static void initializeProgramCounter(int value)
value
- The value to set the Program Counter to.public static int setProgramCounter(int value)
value
- The value to set the Program Counter to.
public static int getProgramCounter()
public static int getInitialProgramCounter()
public static void resetRegisters()
public static void incrementPC()
public static void addRegistersObserver(java.util.Observer observer)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |