CPU Simulator
    Preparing search index...
    Index

    Constructors

    Properties

    capacity: number

    Accessors

    • get cells(): Map<string, Byte>

      A public accessable getter for the memory cells. This method will be used by the GUI in order to display the contents of the main memory.

      Returns Map<string, Byte>

      The current content of this RAM instance.

    Methods

    • This method clears all bits at the specified location and removes the entry with the given physical memory address from the cells map. Both is done only if there is an entry in cells map.

      Parameters

      • physicalAddress: PhysicalAddress

        A binary value representing a physical memory address to write the data to.

      Returns void

      AddressOutOfRangeError - If the physical memory address is out of range.

    • This method tries to read a byte from the specified memory address. Returns a binary zero for address not conatined in the map in order to simulate a full size memory.

      Parameters

      • physicalAddress: PhysicalAddress

        A binary value representing a physical memory address to write the data to.

      Returns Byte

      The byte-sized data found at the specified address.

      AddressOutOfRangeError - If the physical memory address is out of range.

    • This method writes a specified byte of data to the specified address in in the main memory. Throws an error, if the data exeeds a byte.

      Parameters

      • physicalAddress: PhysicalAddress

        A binary value representing a physical memory address to write the data to.

      • data: Byte

        Byte-sized data to write to the specified pyhsical memory address.

      Returns void

      AddressOutOfRangeError - If the physical memory address is out of range.

    • This methods writes a doubleword (32-bit- or 4-byte-) value to memory to the specified memory address.

      Parameters

      • physicalAddress: PhysicalAddress

        A physical memory address to write the doubleword-sized data to.

      • doubleword: DoubleWord

        Doubleword-sized data to write.

      Returns void

      AddressOutOfRangeError - If the physical memory address is out of range.