I'm new to MIPS and while I sort of understand how to do basic tasks with it, I'm struggling heavily with procedures/functions.
I was hoping someone could explain how to solve a simple CPP program such as
void swap( int & a, int & b )
{
register int t;
t = a; a = b; b = t;
}
Into MIPS. In class we talked about frame pointers and stack pointers, offsets, and I'm just lost. How do you pass int a, and int b to the function? How do you return a value and use it in MIPS? I've seen similar problems with arrays but was hoping if someone could help me with one with just two ints to be swapped. Thanks.