Peer-review -- Sami Vuorijärvi
Lab 1a review
Your implementation of lab1a
looks good overall, good work! But, there’s a couple of things to address.
General
The code
fp
, sp
and ra
.
The compiled program
Comments:
When I compile your program and run it in SyncRim, the program doesn’t produce any output at all in
outtext
, except the terminating zero.I’m not quite sure why that is since the code has passed CI. But looking at your code I believe the issue might be that you have allocated space on the stack for the local variables
n
,dst
andsrc
but I can’t see that you actually write anything to these.For example:
53 lw $t0, 4($fp) 54 beq $t0, $zero, rev_ret
On row 53 you load the word from
4($fp)
to$t0
, and since you haven't written anything to4($fp)
before,$t0
is going to equal zero and on row 54 the program is going to branch torev_ret
causing the recursion to stop prematurely.Take a look at this and leave a comment below to let me know when it’s fixed and I'll close the issue.