com.monkeycoder.monkeynes.hardware
Class CpuRegister16

java.lang.Object
  |
  +--com.monkeycoder.monkeynes.hardware.CpuRegister
        |
        +--com.monkeycoder.monkeynes.hardware.CpuRegister16

public class CpuRegister16
extends CpuRegister

This class represents a 16-bit CPU register. This class was created to better support the program counter (PC) register which is 16-bits instead of the common 8-bits.

Originally part of the MonkeyNES project.

Author:
David Stephens

Field Summary
 
Fields inherited from class com.monkeycoder.monkeynes.hardware.CpuRegister
PS_BREAK_COMMAND, PS_CARRY_FLAG, PS_DECIMAL_MODE, PS_INTERRUPT_DISABLE, PS_NEGATIVE_FLAG, PS_OVERFLOW_FLAG, PS_UNUSED, PS_ZERO_FLAG
 
Constructor Summary
CpuRegister16()
          Creates a new CpuRegister16 set to 0.
CpuRegister16(int inData)
          Creates a new CpuRegister16 set to a specific value.
 
Method Summary
 void cage()
          This function sets all bits that are not supposed to be in use by a register of this size to 0.
 
Methods inherited from class com.monkeycoder.monkeynes.hardware.CpuRegister
andEquals, decrement, getBitValue, getBooleanBitValue, getValue, increment, minusEquals, orEquals, plusEquals, setBitOff, setBitOn, setBitValue, setBitValue, setValue, toString, xorEquals
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CpuRegister16

public CpuRegister16()
Creates a new CpuRegister16 set to 0.


CpuRegister16

public CpuRegister16(int inData)
Creates a new CpuRegister16 set to a specific value.

Parameters:
inData - The value to which the register will be set.
Method Detail

cage

public void cage()
This function sets all bits that are not supposed to be in use by a register of this size to 0.

Overrides:
cage in class CpuRegister