projects
/
Mograsim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
A MicroInstructionDefinition now has a default
[Mograsim.git]
/
net.mograsim.machine
/
src
/
net
/
mograsim
/
machine
/
Memory.java
diff --git
a/net.mograsim.machine/src/net/mograsim/machine/Memory.java
b/net.mograsim.machine/src/net/mograsim/machine/Memory.java
index
58798c3
..
0ff9bb4
100644
(file)
--- a/
net.mograsim.machine/src/net/mograsim/machine/Memory.java
+++ b/
net.mograsim.machine/src/net/mograsim/machine/Memory.java
@@
-9,27
+9,28
@@
public interface Memory<T>
* @throws IndexOutOfBoundsException
*/
public T getCell(long address);
* @throws IndexOutOfBoundsException
*/
public T getCell(long address);
-
+
/**
* Sets the data at the supplied address
/**
* Sets the data at the supplied address
+ *
* @throws IndexOutOfBoundsException
*/
public void setCell(long address, T data);
* @throws IndexOutOfBoundsException
*/
public void setCell(long address, T data);
-
+
public default long size()
{
MemoryDefinition def = getDefinition();
public default long size()
{
MemoryDefinition def = getDefinition();
- return Long.max(0, def.getMaximalAddress() - def.getMinimalAddress());
+ return Long.max(0, def.getMaximalAddress() - def.getMinimalAddress()
+ 1
);
}
}
-
+
/**
* Registers an observer to be notified when a memory cell is modified
*/
public void registerObserver(MemoryObserver ob);
/**
* Registers an observer to be notified when a memory cell is modified
*/
public void registerObserver(MemoryObserver ob);
-
+
public void deregisterObserver(MemoryObserver ob);
public void deregisterObserver(MemoryObserver ob);
-
+
public void notifyObservers(long address);
public void notifyObservers(long address);
-
+
public MemoryDefinition getDefinition();
}
public MemoryDefinition getDefinition();
}