我试图将C代码转换为MIPS代码。 int main() {
int a;
int b;
int result = 0;
if (a != b)
result = test(a, b);
else
result = a + b;
return result;
}
int test(int a, int b) {
我们正在研究MIPS汇编(我想这个问题可以适用于装配虽然在一般),老师向我们介绍了帧指针。 如果我有一个函数序言,我用来直接做堆栈指针: addiu $sp, $sp, -8 ; alloc 2 words in the stack
sw $s0, 4($sp) ; save caller function $s0 value in the stack
sw $ra, ($sp) ; sa