jmce - 1_02

jmce.sim.cpu
Class PairRegister

java.lang.Object
  extended by jmce.sim.AbstractHardware
      extended by jmce.sim.cpu.PairRegister
All Implemented Interfaces:
Hardware, Register

public class PairRegister
extends AbstractHardware
implements Register

Implementation of register base over a pair of register for example in the Z80 implementation the HL register can be implemented with a pair of register H and L

Version:
1.00
Author:
Mario Viara

Field Summary
 
Fields inherited from interface jmce.sim.Register
FAMILY_ACC, FAMILY_CONTROL, FAMILY_GENERAL, FAMILY_INDEX, FAMILY_PC, FAMILY_PSW, FAMILY_SP
 
Constructor Summary
PairRegister(java.lang.String name, Register l, Register h)
           
 
Method Summary
 void addRegisterReadListener(RegisterReadListener l)
           
 void addRegisterWriteListener(RegisterWriteListener l)
           
 java.lang.String descValue()
           
 int getFamily()
          Return the family of this register.
 int getRegister()
          Return the value of the register.
 int getWidth()
          Return the size of the register in bit.
 java.lang.String hexValue()
           
 java.lang.String hexValue(int value)
           
 void reset()
          Reset the the device to the initial state.
 void setRegister(int value)
          Set the value of the register.
 void setResetValue(int value)
          Set the value used at reset.
 
Methods inherited from class jmce.sim.AbstractHardware
addHardware, createFrame, destroy, getHardware, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareForName, getHardwareInstances, getHardwareTree, getName, getParent, init, initSwing, removeHardware, removeHardware, setHardware, setHardware, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jmce.sim.Hardware
addHardware, destroy, getHardware, getHardware, getHardware, getHardware, getHardwareCount, getHardwareInstances, getHardwareTree, getName, getParent, init, initSwing, removeHardware, removeHardware, setHardware, setHardware, setName
 

Constructor Detail

PairRegister

public PairRegister(java.lang.String name,
                    Register l,
                    Register h)
Method Detail

setRegister

public void setRegister(int value)
                 throws SIMException
Description copied from interface: Register
Set the value of the register.

Specified by:
setRegister in interface Register
Throws:
SIMException

setResetValue

public void setResetValue(int value)
Description copied from interface: Register
Set the value used at reset.

Specified by:
setResetValue in interface Register

getRegister

public int getRegister()
                throws SIMException
Description copied from interface: Register
Return the value of the register.

Specified by:
getRegister in interface Register
Throws:
SIMException

getWidth

public int getWidth()
Description copied from interface: Register
Return the size of the register in bit.

Specified by:
getWidth in interface Register

getFamily

public int getFamily()
Description copied from interface: Register
Return the family of this register.

Specified by:
getFamily in interface Register

hexValue

public java.lang.String hexValue(int value)
Specified by:
hexValue in interface Register

descValue

public java.lang.String descValue()
                           throws SIMException
Specified by:
descValue in interface Register
Throws:
SIMException

hexValue

public java.lang.String hexValue()
                          throws SIMException
Specified by:
hexValue in interface Register
Throws:
SIMException

addRegisterWriteListener

public void addRegisterWriteListener(RegisterWriteListener l)
Specified by:
addRegisterWriteListener in interface Register

addRegisterReadListener

public void addRegisterReadListener(RegisterReadListener l)
Specified by:
addRegisterReadListener in interface Register

reset

public void reset()
           throws SIMException
Description copied from interface: Hardware
Reset the the device to the initial state. This method will be called after init.

Specified by:
reset in interface Hardware
Overrides:
reset in class AbstractHardware
Throws:
SIMException

jmce - 1_02