|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmars.mips.hardware.RegisterFile
public class RegisterFile
Represents the collection of MIPS registers.
Field Summary | |
---|---|
static int |
GLOBAL_POINTER_REGISTER
|
static int |
STACK_POINTER_REGISTER
|
Constructor Summary | |
---|---|
RegisterFile()
|
Method Summary | |
---|---|
static void |
addRegistersObserver(Observer observer)
Each individual register is a separate object and Observable. |
static void |
deleteRegistersObserver(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(String n)
For getting the number representation of the register. |
static int |
getProgramCounter()
For returning the program counters value. |
static Register |
getProgramCounterRegister()
Returns Register object for program counter. |
static Register[] |
getRegisters()
For returning the set of registers. |
static Register |
getUserRegister(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(boolean startAtMain)
Will initialize the Program Counter to either the default reset value, or the address associated with source program global label "main", if it exists as a text segment label and the global setting is set. |
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(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 |
Field Detail |
---|
public static final int GLOBAL_POINTER_REGISTER
public static final int STACK_POINTER_REGISTER
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(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(String n)
n
- The string formatted register name to look for.
public static Register[] getRegisters()
public static Register getUserRegister(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 void initializeProgramCounter(boolean startAtMain)
startAtMain
- If true, will set program counter to address of statement labeled
'main' (or other defined start label) if defined. If not defined, or if parameter false,
will set program counter to default reset value.public static int setProgramCounter(int value)
value
- The value to set the Program Counter to.
public static int getProgramCounter()
public static Register getProgramCounterRegister()
public static int getInitialProgramCounter()
public static void resetRegisters()
AbstractMarsToolAndApplication
.
public static void incrementPC()
public static void addRegistersObserver(Observer observer)
public static void deleteRegistersObserver(Observer observer)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |