Package mars

Class Globals

java.lang.Object
mars.Globals

public class Globals extends Object
Collection of globally-available data structures.
Version:
August 2003
Author:
Pete Sanderson
  • Field Details

    • instructionSet

      public static InstructionSet instructionSet
      The set of implemented MIPS instructions.
    • program

      public static MIPSprogram program
      the program currently being worked with. Used by GUI only, not command line.
    • symbolTable

      public static SymbolTable symbolTable
      Symbol table for file currently being assembled.
    • memory

      public static Memory memory
      Simulated MIPS memory component.
    • memoryAndRegistersLock

      public static Object memoryAndRegistersLock
      Lock variable used at head of synchronized block to guard MIPS memory and registers
    • debug

      public static boolean debug
      Flag to determine whether or not to produce internal debugging information.
    • userInputAlert

      public static String userInputAlert
      String to GUI's RunI/O text area when echoing user input from pop-up dialog.
    • imagesPath

      public static final String imagesPath
      Path to folder that contains images
      See Also:
      Constant Field Values
    • helpPath

      public static final String helpPath
      Path to folder that contains help text
      See Also:
      Constant Field Values
    • version

      public static final String version
      The current MARS version number. Can't wait for "initialize()" call to get it.
      See Also:
      Constant Field Values
    • fileExtensions

      public static final ArrayList<String> fileExtensions
      List of accepted file extensions for MIPS assembly source files.
    • maximumMessageCharacters

      public static final int maximumMessageCharacters
      Maximum length of scrolled message window (MARS Messages and Run I/O)
    • maximumErrorMessages

      public static final int maximumErrorMessages
      Maximum number of assembler errors produced by one assemble operation
    • maximumBacksteps

      public static final int maximumBacksteps
      Maximum number of back-step operations to buffer
    • copyrightYears

      public static final String copyrightYears
      MARS copyright years
    • copyrightHolders

      public static final String copyrightHolders
      MARS copyright holders
    • ASCII_NON_PRINT

      public static final String ASCII_NON_PRINT
      Placeholder for non-printable ASCII codes
    • ASCII_TABLE

      public static final String[] ASCII_TABLE
      Array of strings to display for ASCII codes in ASCII display of data segment. ASCII code 0-255 is array index.
    • exitCode

      public static int exitCode
      MARS exit code -- useful with SYSCALL 17 when running from command line (not GUI)
    • runSpeedPanelExists

      public static boolean runSpeedPanelExists
  • Constructor Details

    • Globals

      public Globals()
  • Method Details

    • setGui

      public static void setGui(VenusUI g)
    • getGui

      public static VenusUI getGui()
    • getSettings

      public static Settings getSettings()
    • initialize

      public static void initialize(boolean gui)
      Method called once upon system initialization to create the global data structures.
    • getAsciiNonPrint

      public static String getAsciiNonPrint()
    • getAsciiStrings

      public static String[] getAsciiStrings()
    • getExternalTools

      public static ArrayList<String> getExternalTools()
      Get list of MarsTools that reside outside the MARS distribution. Currently this is done by adding the tool's path name to the list of values for the external_tools property. Use ";" as delimiter!
      Returns:
      ArrayList. Each item is file path to .class file of a class that implements MarsTool. If none, returns empty list.
    • getPropertyEntry

      public static String getPropertyEntry(String propertiesFile, String propertyName)
      Read and return property file value (if any) for requested property.
      Parameters:
      propertiesFile - name of properties file (do NOT include filename extension, which is assumed to be ".properties")
      propertyName - String containing desired property name
      Returns:
      String containing associated value; null if property not found
    • getSyscallOverrides

      public ArrayList<SyscallNumberOverride> getSyscallOverrides()
      Read any syscall number assignment overrides from config file.
      Returns:
      ArrayList of SyscallNumberOverride objects