Simple Machine

ISA
Class MemoryCell

java.lang.Object
  extended by ISA.MemoryCell
Direct Known Subclasses:
Datum, Instruction

public abstract class MemoryCell
extends java.lang.Object

A cell of ISA-abstracted memory: an instruction or a data element. A MemoryCell serves two roles. First it is an immutable snapshot of an instruction or data element in real memory. A cell is created from a values in memory or from an opcode and set of operands. The memory region to which the cell belongs is responsible for tracking changes to the real memory that underlies the cell. When memory changes, the memory region creates new cell objects for those new memory values. When an instruction is created from an opcode and operand list, the region writes the cell's value into memory. Second is is a repository for auxiliary information about the cell that is not stored in MainMemory such as labels and comments. This information is not immutable. It can be changed without requiring a new MemoryCell.


Field Summary
protected  int address
           
protected  BitString checkpointValue
           
protected  java.lang.String comment
           
protected  java.lang.String label
           
protected  Memory memory
           
protected  BitString value
           
 
Constructor Summary
MemoryCell(Memory aMemory, int anAddress, BitString aValue, java.lang.String aLabel, java.lang.String aComment)
           
 
Method Summary
 void checkpointValue()
           
 void copyFrom(MemoryCell aCell)
           
 boolean equals(java.lang.Object o)
           
 int getAddress()
           
 int hashCode()
           
 int length()
           
 void restoreValueFromCheckpoint()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

memory

protected Memory memory

address

protected int address

value

protected BitString value

label

protected java.lang.String label

comment

protected java.lang.String comment

checkpointValue

protected BitString checkpointValue
Constructor Detail

MemoryCell

public MemoryCell(Memory aMemory,
                  int anAddress,
                  BitString aValue,
                  java.lang.String aLabel,
                  java.lang.String aComment)
Method Detail

copyFrom

public void copyFrom(MemoryCell aCell)

checkpointValue

public void checkpointValue()

restoreValueFromCheckpoint

public void restoreValueFromCheckpoint()

getAddress

public int getAddress()

length

public int length()

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

Simple Machine