CPU Simulator
    Preparing search index...

    This class encapsulates the logic needed to initialize and sync the GUI with the backend process.

    Erik Burmester erik.burmester@nextbeam.net

    Index

    Constructors

    • Constructs an instance with the given HTML document associated.

      Parameters

      • document: Document

        A reference to an HTML document.

      • window: Window & typeof globalThis

        A reference to the browser "window".

      Returns Renderer

    Properties

    HIGH_ADDRESS_PHYSICAL_MEMORY_DEC: number = 4_294_967_295

    This class member stores the highest available physical memory address.

    NUMBER_BITS_PAGE_FRAME_ADDRESS: number = 20

    This class member stores the number of bits representing the page frame number. The page frame number can be extracted from a physical memory address by removing the offset bits from the right.

    autoScrollForPageTableEnabled: boolean

    This field represents a flag, which enables automatic scroll for the GUIs Page Table widget.

    autoScrollForPhysicalRAMEnabled: boolean

    This field represents a flag, which enables automatic scroll for the GUIs physical RAM widget.

    autoScrollForVirtualRAMEnabled: boolean

    This field represents a flag, which enables automatic scroll for the GUIs virtual RAM widget.

    dataRepresentationEAX: NumberSystem

    This field stores the currently selected representation of the data for the EAX register.

    dataRepresentationEBX: NumberSystem

    This field stores the currently selected representation of the data for the EBX register.

    dataRepresentationECX: NumberSystem

    This field stores the currently selected representation of the data for the ECX register.

    dataRepresentationEIP: NumberSystem

    This field stores the currently selected representation of the data for the EIP register.

    dataRepresentationEIR: NumberSystem

    TODO: Implement mechanism for retrieving textual instruction from main process of the Simulator! This field is currently unused, as there is no such mechanism. The only available representation for the EIR register is binary.

    This field stores the currently selected representation of the data for the EIR register.

    dataRepresentationESP: NumberSystem

    This field stores the currently selected representation of the data for the ESP register.

    dataRepresentationGPTP: NumberSystem

    This field stores the currently selected representation of the data for the GPTP register.

    dataRepresentationITP: NumberSystem

    This field stores the currently selected representation of the data for the ITP register.

    dataRepresentationNPTP: NumberSystem

    This field stores the currently selected representation of the data for the NPTP register.

    dataRepresentationPTP: NumberSystem

    This field stores the currently selected representation of the data for the PTP register.

    dataRepresentationVMPTR: NumberSystem

    This field stores the currently selected representation of the data for the VMPTR register.

    programLoaded: boolean

    This field indicates, whether an assembly program is currently loaded.

    Methods

    • This method creates a GUI element, which represents an entry of the Page Table.

      Parameters

      • pageNumberDecString: string

        The virtual page address, which is often refered to as the pages number.

      • presentFlag: boolean

        This flag indicates whether the page is currently mounted to a page frame.

      • writableFlag: boolean

        This flag indicates whether the page is writable or read-only.

      • executableFlag: boolean

        This flag indicates whether the page is executable or not.

      • accessableOnlyInKernelModeFlag: boolean

        This flag indicates whether the page can only be accessed in kernel mode.

      • pinnedFlag: boolean

        This flag indicates whether the page is protected against attempts to write it to a background memory.

      • changedFlag: boolean

        This flag indicates whether the page was changed since it was mounted to a page frame.

      • pageFrameNumberDecString: string

        The physical page frame address, which is often refered to as the page frames number.

      Returns HTMLElement

      An GUI element representing a single Page Table entry.

    • This method initializes the view of the Page Table reading the first thirty entries of the Page Table and creats GUI elements, which represents the individual entries.

      Parameters

      • OptionalfirstPageNumberToReadDec: number = 0

        The first page number to read from Page Table.

      • OptionallastPageNumberToReadDec: number = 30

        The last page number to read from Page Table.

      Returns Promise<void>

    • This method creates an HTMLElement representing a physical RAM cell. This element consist out of a label with the pyhsical memory address and the binary content of the main memory at this address.

      Parameters

      • physicalAddressHexString: string

        The physical memory address of the RAM cell.

      • binaryStringContent: string

        The binary content of this RAM cell.

      Returns HTMLElement

      A HTMLElement representing a RAM cell.

    • This method initializes the view of the physical RAM by reading the first twenty entries of the main memory and creating HTMLElements, which represents the individual RAM cells.

      Parameters

      • OptionalfirstPhysicalAddressToReadHex: string = "0x0"

        The first physical memory address to read from main memory in hexadecimal representation.

      • OptionallastPhysicalAddressToReadHex: string = "0x1e"

        The last physical memory address to read from main memory in hexadecimal representation.

      Returns Promise<void>

    • This method creates an HTMLElement representing a virtual RAM cell. This element consist out of a label with the pyhsical memory address and the binary content of the main memory at this address.

      Parameters

      • virtualAddressHexString: string

        The virtual memory address of the RAM cell.

      • binaryStringContent: string

        The binary content of this RAM cell.

      Returns HTMLElement

      A HTMLElement representing a RAM cell.

    • This method initializes the view of the virtual RAM by reading the first twenty entries of the main memory and creating HTMLElements, which represents the individual RAM cells.

      Parameters

      • OptionalfirstVirtualAddressToReadHex: string = "0x0"

        The first virtual memory address to read from main memory in hexadecimal representation.

      • OptionallastVirtualAddressToReadHex: string = "0x1e"

        The last virtual memory address to read from main memory in hexadecimal representation.

      Returns Promise<void>

    • This method reads the content of the EAX register.

      Parameters

      • radix: NumberSystem

      Returns Promise<void>

    • This method reads the content of the EBX register.

      Parameters

      • radix: NumberSystem

      Returns Promise<void>

    • This method reads the content of the ECX register.

      Parameters

      • radix: NumberSystem

      Returns Promise<void>

    • This method reads the content of the EIP register.

      Parameters

      • radix: NumberSystem

      Returns Promise<void>

    • This method reads the content of the EIR register.

      Parameters

      • asInstruction: boolean = false

        Indicates, wethert to display the instruction in its textual representation or not.

      Returns Promise<void>

    • This method reads the content of the ESP register.

      Parameters

      • radix: NumberSystem

      Returns Promise<void>

    • This method reads the content of the GPTP register.

      Parameters

      • radix: NumberSystem

      Returns Promise<void>

    • This method reads the content of the ITP register.

      Parameters

      • radix: NumberSystem

      Returns Promise<void>

    • This method reads the content of the NPTP register.

      Parameters

      • radix: NumberSystem

      Returns Promise<void>

    • This method reads the content of the PTP register.

      Parameters

      • radix: NumberSystem

      Returns Promise<void>

    • This method reads the content of the VMPTR register.

      Parameters

      • radix: NumberSystem

      Returns Promise<void>

    • This method registers the change listeners for all Protected

    On This Page

    Constructors
    constructor
    Properties
    HIGH_ADDRESS_PHYSICAL_MEMORY_DECNUMBER_BITS_PAGE_FRAME_ADDRESSautoScrollForPageTableEnabledautoScrollForPhysicalRAMEnabledautoScrollForVirtualRAMEnableddataRepresentationEAXdataRepresentationEBXdataRepresentationECXdataRepresentationEIPdataRepresentationEIRdataRepresentationESPdataRepresentationGPTPdataRepresentationITPdataRepresentationNPTPdataRepresentationPTPdataRepresentationVMPTRprogramLoaded
    Methods
    createPageTableEntryElementcreatePageTableViewcreatePhysicalRAMGuiElementcreatePhysicalRAMViewcreateVirtualRAMGuiElementcreateVirtualRAMViewcyclereadEAXreadEBXreadECXreadEFLAGSreadEIPreadEIRreadESPreadGPTPreadITPreadNPTPreadPTPreadVMPTRregisterChangeListenerreloadPageTableViewreloadPhysicalRAMViewreloadVirtualRAMView