Class BaseMemory

java.lang.Object
io.zucchini.circuitsimtester.api.BaseMemory
Direct Known Subclasses:
Ram, Rom

public abstract class BaseMemory extends Object
Base class inherited by Ram and Rom. Handles loading .dats exported from CircuitSim from an InputStream.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract int
    load(int address)
    Reads a word from this RAM/ROM.
    void
    load(InputStream stream)
    Loads a stream of a dat file into this component's memory.
    abstract void
    store(int address, int value)
    Writes a word to this RAM/ROM.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BaseMemory

      public BaseMemory()
  • Method Details

    • load

      public abstract int load(int address)
      Reads a word from this RAM/ROM.
      Parameters:
      address - The memory address to load from
      Returns:
      value at this address
    • store

      public abstract void store(int address, int value)
      Writes a word to this RAM/ROM.
      Parameters:
      address - The memory address to store to
      value - The value to store
    • load

      public void load(InputStream stream)
      Loads a stream of a dat file into this component's memory. Format is the same as the .dat files saved in the CircuitSim memory editor window.
      Parameters:
      stream - the stream of the .dat file to be loaded