X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.machine%2Fsrc%2Fnet%2Fmograsim%2Fmachine%2FMemoryDefinition.java;h=78e1e4e20032c607c082e13b2d6933d86026e61b;hb=3813eb83f6c17041dcb67d7d2744c66a8bfdb18d;hp=5f42d10c74c40df908e0b934e8fd9703b4783304;hpb=a89919ed17e728953766d9d617e7db86fcf315ee;p=Mograsim.git diff --git a/net.mograsim.machine/src/net/mograsim/machine/MemoryDefinition.java b/net.mograsim.machine/src/net/mograsim/machine/MemoryDefinition.java index 5f42d10c..78e1e4e2 100644 --- a/net.mograsim.machine/src/net/mograsim/machine/MemoryDefinition.java +++ b/net.mograsim.machine/src/net/mograsim/machine/MemoryDefinition.java @@ -34,7 +34,7 @@ public interface MemoryDefinition { */ default long size() { - return getMaximalAddress() - getMinimalAddress(); + return getMaximalAddress() - getMinimalAddress() + 1; } public static MemoryDefinition create(int memoryAddressBits, long minimalAddress, long maximalAddress)