Package mars.tools

Class KeyboardAndDisplaySimulator

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Observer, Accessible, RootPaneContainer, WindowConstants, MarsTool

public class KeyboardAndDisplaySimulator extends AbstractMarsToolAndApplication
Keyboard and Display Simulator. It can be run either as a stand-alone Java application having access to the mars package, or through MARS as an item in its Tools menu. It makes maximum use of methods inherited from its abstract superclass AbstractMarsToolAndApplication. Pete Sanderson
Version 1.0, 24 July 2008.
Version 1.1, 24 November 2008 corrects two omissions: (1) the tool failed to register as an observer of kernel text memory when counting instruction executions for transmitter ready bit reset delay, and (2) the tool failed to test the Status register's Exception Level bit before raising the exception that results in the interrupt (if the Exception Level bit is 1, that means an interrupt is being processed, so disable further interrupts). Version 1.2, August 2009, soft-codes the MMIO register locations for new memory configuration feature of MARS 3.7. Previously memory segment addresses were fixed and final. Now they can be modified dynamically so the tool has to get its values dynamically as well. Version 1.3, August 2011, corrects bug to enable Display window to scroll when needed. Version 1.4, August 2014, adds two features: (1) ASCII control character 12 (form feed) when transmitted will clear the Display window. (2) ASCII control character 7 (bell) when transmitted with properly coded (X,Y) values will reposition the cursor to the specified position of a virtual text-based terminal. X represents column, Y represents row.
See Also:
Serialized Form
  • Field Details

    • preferredTextAreaDimension

      public static Dimension preferredTextAreaDimension
    • RECEIVER_CONTROL

      public static int RECEIVER_CONTROL
    • RECEIVER_DATA

      public static int RECEIVER_DATA
    • TRANSMITTER_CONTROL

      public static int TRANSMITTER_CONTROL
    • TRANSMITTER_DATA

      public static int TRANSMITTER_DATA
  • Constructor Details

    • KeyboardAndDisplaySimulator

      public KeyboardAndDisplaySimulator(String title, String heading)
      Simple constructor, likely used to run a stand-alone keyboard/display simulator.
      Parameters:
      title - String containing title for title bar
      heading - String containing text for heading shown in upper part of window.
    • KeyboardAndDisplaySimulator

      public KeyboardAndDisplaySimulator()
      Simple constructor, likely used by the MARS Tools menu mechanism
  • Method Details

    • main

      public static void main(String[] args)
      Main provided for pure stand-alone use. Recommended stand-alone use is to write a driver program that instantiates a KeyboardAndDisplaySimulator object then invokes its go() method. "stand-alone" means it is not invoked from the MARS Tools menu. "Pure" means there is no driver program to invoke the application.
    • getName

      public String getName()
      Required MarsTool method to return Tool name.
      Specified by:
      getName in interface MarsTool
      Specified by:
      getName in class AbstractMarsToolAndApplication
      Returns:
      Tool name. MARS will display this in menu item.