X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.machine%2Fsrc%2Fnet%2Fmograsim%2Fmachine%2FMemoryDefinition.java;h=39d12c44a3b5d1ddb6b9e274529c72301557149f;hb=8bed58cd47f4e53a0a83e066d38864aa6875502f;hp=78e1e4e20032c607c082e13b2d6933d86026e61b;hpb=e6565c6da050c719d4cb69185f420aafed449f67;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 78e1e4e2..39d12c44 100644 --- a/net.mograsim.machine/src/net/mograsim/machine/MemoryDefinition.java +++ b/net.mograsim.machine/src/net/mograsim/machine/MemoryDefinition.java @@ -1,10 +1,11 @@ package net.mograsim.machine; -public interface MemoryDefinition { +public interface MemoryDefinition +{ /** - * The number of bits that the main memory uses to address cells. Note that this - * does not need to equal {@link MachineDefinition#getAddressBits()}. + * The number of bits that the main memory uses to address cells. Note that this does not need to equal + * {@link MachineDefinition#getAddressBits()}. * * @return the number of bits used to address a memory cell * @author Christian Femers @@ -26,7 +27,7 @@ public interface MemoryDefinition { * @author Christian Femers */ long getMaximalAddress(); - + /** * The size of the MainMemory as the amount of addressable memory cells. * @@ -36,7 +37,7 @@ public interface MemoryDefinition { { return getMaximalAddress() - getMinimalAddress() + 1; } - + public static MemoryDefinition create(int memoryAddressBits, long minimalAddress, long maximalAddress) { return new StandardMemoryDefinition(memoryAddressBits, minimalAddress, maximalAddress);