Sure. As long as there are enough S
registers available.
Here is an example program, written in a C-like language.
When main first gets control
the stack pointer $sp
has been initialized to point to the top of stack.
main() then follows the rules under "Rules for Main".
The prolog for main sets up its local variables
using the frame pointer $fp
For qtSPIM, return to the system is done using
trap handler service 10 and the
syscall instruction.
main()
{
int a;
a = mysub( 6 );
print( a );
}
int mysub( int arg )
{
int b,c;
b = arg*2;
c = b + 7;
return c;
}
How many bytes on the stack are needed for the
variables in main?