miSim

misim
Class Register

java.lang.Object
  |
  +--misim.Register
Direct Known Subclasses:
PIC84_EECon1, PIC84_EECon2, PIC84_Fsr, PIC84_Intcon, PIC84_Option, PIC84_Pcl, PIC84_Status, PIC84_Tmr0, PIC84_Tris, Port

public class Register
extends java.lang.Object

A Register is an object that represents a memory location in the microcontroller. In its simplest form, it has only a value, that can be read and written by Instructions. However, it can be subclassed to provide specific behaviour - for instance, when a register controls a particular port.


Field Summary
protected  MachineState machineState
          The machineState that this register belongs to
 boolean simple
          If this is set to false, handleUpdate is called by the emulator whenever the register value may have changed
 int val
          The value of this register
 
Constructor Summary
Register(MachineState machineState)
          Basic constructor initialises the machineState and sets this to be a simple register - ie.
 
Method Summary
 void handleUpdate()
          Subclasses should implement this to respond to changes made to the value of the register.
 java.lang.String toString()
          Return the value of this register as a hex string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

machineState

protected MachineState machineState
The machineState that this register belongs to

simple

public boolean simple
If this is set to false, handleUpdate is called by the emulator whenever the register value may have changed

val

public int val
The value of this register
Constructor Detail

Register

public Register(MachineState machineState)
Basic constructor initialises the machineState and sets this to be a simple register - ie. no special behaviour on writes.
Method Detail

handleUpdate

public void handleUpdate()
Subclasses should implement this to respond to changes made to the value of the register. This is only called when the member variable 'simple' is set to false.

toString

public java.lang.String toString()
Return the value of this register as a hex string
Overrides:
toString in class java.lang.Object
Returns:
A two character hexadecimal string

miSim