|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.monkeycoder.monkeynes.hardware.CpuRegister
This class represents an 8-bit CPU register.
Originally part of the MonkeyNES project.
| Field Summary | |
static int |
PS_BREAK_COMMAND
|
static int |
PS_CARRY_FLAG
|
static int |
PS_DECIMAL_MODE
|
static int |
PS_INTERRUPT_DISABLE
|
static int |
PS_NEGATIVE_FLAG
|
static int |
PS_OVERFLOW_FLAG
|
static int |
PS_UNUSED
|
static int |
PS_ZERO_FLAG
|
| Constructor Summary | |
CpuRegister()
Creates a new CpuRegister set to 0. |
|
CpuRegister(int inData)
Creates a new CpuRegister set to a specific value. |
|
| Method Summary | |
void |
andEquals(int inVal)
Performs a bitwise AND with a value and this register's existing value. |
void |
cage()
This function sets all bits that are not supposed to be in use by a register of this size to 0. |
void |
decrement()
Decrements the value of this register. |
int |
getBitValue(int inMask)
Gets the value of a specific bit as a 0 or 1. |
boolean |
getBooleanBitValue(int inMask)
Gets the value of a specific bit as a boolean. |
int |
getValue()
Gets the entire data value of this register. |
void |
increment()
Increments the value of this register. |
void |
minusEquals(int inVal)
Subtracts a value from this register's existing value. |
void |
orEquals(int inVal)
Performs a bitwise OR with a value and this register's existing value. |
void |
plusEquals(int inVal)
Adds a value to this register's existing value. |
void |
setBitOff(int inMask)
Turns off specific bits based on a mask. |
void |
setBitOn(int inMask)
Turns on specific bits based on a mask. |
void |
setBitValue(int inMask,
boolean inVal)
Sets the value of any number of specific bits based on a mask. |
void |
setBitValue(int inMask,
int inVal)
Sets the value of any number of specific bits based on a mask. |
void |
setValue(int inVal)
Sets the entire data value of this register. |
String |
toString()
This function returns the current data value of this register as a String. |
void |
xorEquals(int inVal)
Performs a bitwise XOR with a value and this register's existing value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int PS_CARRY_FLAG
public static final int PS_ZERO_FLAG
public static final int PS_INTERRUPT_DISABLE
public static final int PS_DECIMAL_MODE
public static final int PS_BREAK_COMMAND
public static final int PS_UNUSED
public static final int PS_OVERFLOW_FLAG
public static final int PS_NEGATIVE_FLAG
| Constructor Detail |
public CpuRegister()
public CpuRegister(int inData)
inData - The value to which the register will be set.| Method Detail |
public int getValue()
public boolean getBooleanBitValue(int inMask)
inMask - A mask of the bits to check.
public int getBitValue(int inMask)
inMask - A mask of the bits to check.
public void setValue(int inVal)
inVal - The value to which this register will be set.
public void setBitValue(int inMask,
int inVal)
inMask - A mask of the bits to set.inVal - 0 to turn off the requested bits, any other value to turn them on.
public void setBitValue(int inMask,
boolean inVal)
inMask - A mask of the bits to set.inVal - false to turn off the requested bits, true to turn them on.public void setBitOn(int inMask)
inMask - A mask of the bits to set.public void setBitOff(int inMask)
inMask - A mask of the bits to set.public void increment()
public void decrement()
public void plusEquals(int inVal)
inVal - The value to add to this register.public void minusEquals(int inVal)
inVal - The value to subtract from this register.public void andEquals(int inVal)
inVal - The value to AND with this register.public void orEquals(int inVal)
inVal - The value to OR with this register.public void xorEquals(int inVal)
inVal - The value to XOR with this register.public void cage()
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||