|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Observable | +--mars.mips.hardware.Register
Abstraction to represent a register of a MIPS Assembler.
Constructor Summary | |
Register(java.lang.String n,
int num,
int val)
Creates a new register with specified name, number, and value. |
Method Summary | |
java.lang.String |
getName()
Returns the name of the Register. |
int |
getNumber()
Returns the number of the Register. |
int |
getResetValue()
Returns the reset value of the Register. |
int |
getValue()
Returns the value of the Register. |
void |
resetValue()
Resets the value of the register to the value it was constructed with. |
int |
setValue(int val)
Sets the value of the register to the val passed to it. |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Register(java.lang.String n, int num, int val)
n
- The name of the register.num
- The number of the register.val
- The inital (and reset) value of the register.Method Detail |
public java.lang.String getName()
public int getValue()
public int getResetValue()
public int getNumber()
public int setValue(int val)
val
- Value to set the Register to.
public void resetValue()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |