Package mars.tools

Class DigitalLabSimulator

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, RootPaneContainer, WindowConstants, Memory.Listener, MarsTool

public class DigitalLabSimulator extends AbstractMarsTool
Didier Teifreto LIFC Université de franche-Comté www.lifc.univ-fcomte.fr/~teifreto didier.teifreto@univ-fcomte.fr
See Also:
  • Field Details

    • EXTERNAL_INTERRUPT_TIMER

      public static final int EXTERNAL_INTERRUPT_TIMER
      See Also:
    • EXTERNAL_INTERRUPT_HEXADECIMAL_KEYBOARD

      public static final int EXTERNAL_INTERRUPT_HEXADECIMAL_KEYBOARD
      See Also:
  • Constructor Details

    • DigitalLabSimulator

      public DigitalLabSimulator()
      Construct an instance of this tool. This will be used by the ToolManager.
  • Method Details

    • getName

      public String getName()
      Description copied from class: AbstractMarsTool
      Required MarsTool method to return Tool name. Must be defined by subclass.
      Specified by:
      getName in interface MarsTool
      Specified by:
      getName in class AbstractMarsTool
      Returns:
      Tool name. MARS will display this in menu item.
    • startObserving

      protected void startObserving()
      Description copied from class: AbstractMarsTool
      Register this tool as a listener of memory and/or registers, if applicable. This method is called when the tool is opened by the user. Does nothing by default.
      Overrides:
      startObserving in class AbstractMarsTool
      See Also:
    • stopObserving

      protected void stopObserving()
      Description copied from class: AbstractMarsTool
      Unregister this tool as a listener of memory and/or registers, if applicable. This method is called when the tool is closed by the user. Does nothing by default.
      Overrides:
      stopObserving in class AbstractMarsTool
      See Also:
    • memoryWritten

      public void memoryWritten(int address, int length, int value, int wordAddress, int wordValue)
      Description copied from interface: Memory.Listener
      Invoked upon any write operation which is relevant to this listener's active range. Does nothing by default.
      Parameters:
      address - The address which was written to.
      length - The number of bytes written. Will always be 1 (single byte), Memory.BYTES_PER_HALFWORD, or Memory.BYTES_PER_WORD.
      value - The value which was written.
      wordAddress - The address of the word affected by the operation.
      wordValue - The resulting value of the word.
    • reset

      protected void reset()
      Description copied from class: AbstractMarsTool
      Method that will be called each time the default Reset button is clicked. Use it to reset any data structures and/or GUI components. Does nothing by default.
      Overrides:
      reset in class AbstractMarsTool
    • buildMainDisplayArea

      protected JComponent buildMainDisplayArea()
      Description copied from class: AbstractMarsTool
      Abstract method that must be instantiated by subclass to build the main display area of the GUI. It will be placed in the CENTER area of a BorderLayout. The title is in the NORTH area, and the controls are in the SOUTH area.
      Specified by:
      buildMainDisplayArea in class AbstractMarsTool
    • getHelpComponent

      protected JComponent getHelpComponent()
      Description copied from class: AbstractMarsTool
      Override this method to provide a JComponent (probably a JButton) of your choice to be placed just left of the Close/Exit button. Its anticipated use is for a "help" button that launches a help message or dialog. But it can be any valid JComponent that doesn't mind co-existing among a bunch of JButtons.
      Overrides:
      getHelpComponent in class AbstractMarsTool
    • updateHexadecimalKeyboard

      public void updateHexadecimalKeyboard(int row)
    • updateOneSecondCounter

      public void updateOneSecondCounter(int value)