Advertising
@Acid_Snake: you know Python right? So how can you say you don't know what it's a return value?- Code: Select all
def increment(x):
return x+1
The return value is x+1.
In MIPS architecture, $v0 register is the one used to hold the value returned by functions. So for example the above Python function when translated to MIPS (which is what the Python interpreter does) would be something like
- Code: Select all
move $a0, $v0 # Copy x parameter value to $v0 register (return value)
addui $v0, $v0, 1 # Add one to $v0
jr $ra # Return from function with return value $v0

