Discussion:
[Fall 05 final Q-M3] return value for function in mips
(too old to reply)
Jeremy Cowles
2008-08-14 03:31:37 UTC
Permalink
Raw Message
The 7th line implicitly sets the return value - that is, the return value is
the same value that gets returned from malloc().
The solution for this exam has the type for foo as char*, and part c
implies
that this should be the case; however, I thought that values returned from
a
function call should be passed in the $v[0|1] registers (per register
conventions).
Where is the return value (char*) coming from?
Also note, first line of foo_end should be $t0 (dest) rather than $t1
(src).
Jeremy Cowles
2008-08-14 03:54:01 UTC
Permalink
Raw Message
Also note, first line of foo_end should be $t0 (dest) rather than $t1
(src).
I think you're right - I can't see how that would work.

Loading...