Package mars.mips.instructions
Class SyscallManager
java.lang.Object
mars.mips.instructions.SyscallManager
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 Summary
Modifier and TypeMethodDescriptionstatic SyscallgetSyscall(int number) Find the syscall corresponding a given service number, if one exists.static Syscall[]Get the list of syscalls to use, loading them if necessary.
-
Method Details
-
getSyscalls
Get the list of syscalls to use, loading them if necessary. The loader searches for all classes in themars.mips.instructions.syscallspackage that implementSyscall. Service number overrides are processed as the syscalls are loaded.- Returns:
- An array of
Syscallinstances.
-
getSyscall
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.
-