|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmars.mips.hardware.Coprocessor0
public class Coprocessor0
Represents Coprocessor 0. We will use only its interrupt/exception registers.
Field Summary | |
---|---|
static int |
CAUSE
|
static int |
DEFAULT_STATUS_VALUE
|
static int |
EPC
|
static int |
EXCEPTION_LEVEL
|
static int |
STATUS
|
static int |
VADDR
Coprocessor register names |
Constructor Summary | |
---|---|
Coprocessor0()
|
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 |
getNumber(String n)
For getting the number representation of the register. |
static Register |
getRegister(String rname)
Get register object corresponding to given name. |
static int |
getRegisterPosition(Register r)
Coprocessor0 implements only selected registers, so the register number (8, 12, 13, 14) does not correspond to its position in the list of registers (0, 1, 2, 3). |
static Register[] |
getRegisters()
For returning the set of registers. |
static int |
getValue(int num)
Returns the value of the register who's number is num. |
static void |
resetRegisters()
Method to reinitialize the values of the registers. |
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 int |
updateRegister(String n,
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 VADDR
public static final int STATUS
public static final int CAUSE
public static final int EPC
public static final int EXCEPTION_LEVEL
public static final int DEFAULT_STATUS_VALUE
Constructor Detail |
---|
public Coprocessor0()
Method Detail |
---|
public static void showRegisters()
public static int updateRegister(String n, int val)
n
- name of register to set the value of ($n, where n is reg number).val
- The desired value for the register.
public static int updateRegister(int num, int val)
num
- Number 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 int getRegisterPosition(Register r)
r
- A coprocessor0 Register
public static Register getRegister(String rname)
rname
- The register name, in $0 format.
public static void resetRegisters()
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 |