ISA
Class MemoryCell
java.lang.Object
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.
Constructor Summary |
MemoryCell(Memory aMemory,
int anAddress,
BitString aValue,
java.lang.String aLabel,
java.lang.String aComment)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
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
MemoryCell
public MemoryCell(Memory aMemory,
int anAddress,
BitString aValue,
java.lang.String aLabel,
java.lang.String aComment)
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