Package mars.mips.instructions.syscalls
Class SyscallSbrk
java.lang.Object
mars.mips.instructions.syscalls.AbstractSyscall
mars.mips.instructions.syscalls.SyscallSbrk
- All Implemented Interfaces:
Syscall
Service to allocate amount of heap memory specified in $a0, putting address into $v0.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
simulate(ProgramStatement statement)
Performs syscall function to allocate amount of heap memory specified in $a0, putting address into $v0.Methods inherited from class mars.mips.instructions.syscalls.AbstractSyscall
getName, getNumber, setNumber
-
Constructor Details
-
SyscallSbrk
public SyscallSbrk()Build an instance of the Sbrk syscall. Default service number is 9 and name is "Sbrk".
-
-
Method Details
-
simulate
Performs syscall function to allocate amount of heap memory specified in $a0, putting address into $v0.- Specified by:
simulate
in interfaceSyscall
- Specified by:
simulate
in classAbstractSyscall
- Parameters:
statement
- ProgramStatement object for this syscall instruction.- Throws:
ProcessingException
-