1 package net.mograsim.machine;
4 * This interface provides a means to get information about the machines memory
5 * architecture. It is not bound to any actual memory.
7 * @author Christian Femers
10 public interface MainMemoryDefinition {
13 * The number of bits that the main memory uses to address cells. Note that this
14 * does not need to equal {@link MachineDefinition#getAddressBits()}.
16 * @return the number of bits used to address a memory cell
17 * @author Christian Femers
19 int getMemoryAddressBits();
22 * The width in bits of an addressable memory cell/unit. This is often 8 (= one
23 * byte). The actual cells/lines of the memory may be a lot larger.
25 * @return the addressable unit width in bits
26 * @author Christian Femers
31 * The minimal address possible to address/use. This is usually 0.
33 * @return the minimal possible address.
34 * @author Christian Femers
36 long getMinimalAddress();
39 * The maximal address possible to address/use.
41 * @return the maximal possible address as <b>unsigned long</b>
42 * @author Christian Femers
44 long getMaximalAddress();
47 * The size of the MainMemory as the amount of addressable memory cells.
49 * @return the amount of addressable memory cells
53 return getMaximalAddress() - getMinimalAddress();