|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mars.mips.hardware.Coprocessor1
Represents Coprocessor 1, the Floating Point Unit (FPU)
Constructor Summary | |
Coprocessor1()
|
Method Summary | |
static void |
addRegistersObserver(java.util.Observer observer)
Each individual register is a separate object and Observable. |
static int |
clearConditionFlag(int flag)
Set condition flag to 0 (false). |
static void |
clearConditionFlags()
Clear all condition flags (0-7). |
static int |
getConditionFlag(int flag)
Get value of specified condition flag (0-7). |
static int |
getConditionFlagCount()
Get count of condition flags. |
static int |
getConditionFlags()
Get array of condition flags (0-7). |
static double |
getDoubleFromRegister(int reg)
Gets the double value stored in the given FPU register. |
static double |
getDoubleFromRegister(java.lang.String reg)
Gets the double value stored in the given FPU register. |
static float |
getFloatFromRegister(int reg)
Gets the float value stored in the given FPU register. |
static float |
getFloatFromRegister(java.lang.String reg)
Gets the float value stored in the given FPU register. |
static Register |
getRegister(java.lang.String rName)
Get register object corresponding to given name. |
static int |
getRegisterNumber(java.lang.String n)
For getting the number representation of the FPU register. |
static Register[] |
getRegisters()
For returning the set of registers. |
static int |
getValue(int num)
Returns the value of the FPU register who's number is num. |
static void |
resetRegisters()
Method to reinitialize the values of the registers. |
static int |
setConditionFlag(int flag)
Set condition flag to 1 (true). |
static void |
setConditionFlags()
Set all condition flags (0-7). |
static void |
setRegisterToDouble(int reg,
double val)
Sets the value of the FPU register given to the double value given. |
static void |
setRegisterToDouble(java.lang.String reg,
double val)
Sets the value of the FPU register given to the double value given. |
static void |
setRegisterToFloat(int reg,
float val)
Sets the value of the FPU register given to the value given. |
static void |
setRegisterToFloat(java.lang.String reg,
float val)
Sets the value of the FPU register given to the value given. |
static void |
showRegisters()
Method for displaying the register values for debugging. |
static int |
updateRegister(int num,
int val)
This method updates the FPU register value who's number is num. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Coprocessor1()
Method Detail |
public static void showRegisters()
public static void setRegisterToFloat(java.lang.String reg, float val)
reg
- Register to set the value of.val
- The desired float value for the register.public static void setRegisterToFloat(int reg, float val)
reg
- Register to set the value of.val
- The desired float value for the register.public static void setRegisterToDouble(int reg, double val) throws InvalidRegisterAccessException
reg
- Register to set the value of.val
- The desired double value for the register.
InvalidRegisterAccessException
- if register ID is invalid or odd-numbered.public static void setRegisterToDouble(java.lang.String reg, double val) throws InvalidRegisterAccessException
reg
- Register to set the value of.val
- The desired double value for the register.
InvalidRegisterAccessException
- if register ID is invalid or odd-numbered.public static float getFloatFromRegister(int reg)
reg
- Register to get the value of.
public static float getFloatFromRegister(java.lang.String reg)
reg
- Register to get the value of.
public static double getDoubleFromRegister(int reg) throws InvalidRegisterAccessException
reg
- Register to get the value of.
InvalidRegisterAccessException
- if register ID is invalid or odd-numbered.public static double getDoubleFromRegister(java.lang.String reg) throws InvalidRegisterAccessException
reg
- Register to get the value of.
InvalidRegisterAccessException
- if register ID is invalid or odd-numbered.public static int updateRegister(int num, int val)
num
- FPU register to set the value of.val
- The desired int value for the register.public static int getValue(int num)
num
- The FPU register number.
public static int getRegisterNumber(java.lang.String n)
n
- The string formatted register name to look for.
public static Register[] getRegisters()
public static Register getRegister(java.lang.String rName)
rName
- The FPU register name, must be "$f0" through "$f31".
public static void resetRegisters()
public static void addRegistersObserver(java.util.Observer observer)
public static int setConditionFlag(int flag)
flag
- condition flag number (0-7)
public static int clearConditionFlag(int flag)
flag
- condition flag number (0-7)
public static int getConditionFlag(int flag)
flag
- condition flag number (0-7)
public static int getConditionFlags()
public static void clearConditionFlags()
public static void setConditionFlags()
public static int getConditionFlagCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |