Class SyscallManager

java.lang.Object
mars.mips.instructions.SyscallManager

public class SyscallManager extends Object
This class provides functionality to bring external Syscall definitions into MARS. This permits anyone with knowledge of the MARS public interfaces, in particular of the Memory and Register classes, to write custom MIPS syscall functions. This is adapted from the ToolManager class, which is in turn adapted from Bret Barker's GameServer class from the book "Developing Games In Java".
  • Method Details

    • getSyscalls

      public static Syscall[] getSyscalls()
      Get the list of syscalls to use, loading them if necessary. The loader searches for all classes in the mars.mips.instructions.syscalls package that implement Syscall. Service number overrides are processed as the syscalls are loaded.
      Returns:
      An array of Syscall instances.
    • getSyscall

      public static Syscall getSyscall(int number)
      Find the syscall corresponding a given service number, if one exists.
      Parameters:
      number - The service number of the desired syscall.
      Returns:
      The syscall object, or null if no syscall was found.