|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmars.mips.instructions.syscalls.AbstractSyscall
public abstract class AbstractSyscall
Abstract class that a MIPS syscall system service may extend. A qualifying service must be a class in the mars.mips.instructions.syscalls package that implements the Syscall interface, must be compiled into a .class file, and its .class file must be in the same folder as Syscall.class. Mars will detect a qualifying syscall upon startup, create an instance using its no-argument constructor and add it to its syscall list. When its service is invoked at runtime ("syscall" instruction with its service number stored in register $v0), its simulate() method will be invoked.
Constructor Summary | |
---|---|
AbstractSyscall(int number,
String name)
Constructor is provided so subclass may initialize instance variables. |
Method Summary | |
---|---|
String |
getName()
Return the name you have chosen for this syscall. |
int |
getNumber()
Return the assigned service number. |
void |
setNumber(int num)
Set the service number. |
abstract void |
simulate(ProgramStatement statement)
Performs syscall function. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractSyscall(int number, String name)
number
- default assigned service numbername
- service name which may be used for reference independent of numberMethod Detail |
---|
public String getName()
getName
in interface Syscall
public void setNumber(int num)
setNumber
in interface Syscall
num
- specified service number to override the default.public int getNumber()
getNumber
in interface Syscall
public abstract void simulate(ProgramStatement statement) throws ProcessingException
simulate
in interface Syscall
statement
- ProgramStatement object for this syscall instruction.
ProcessingException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |