For the 16-17 exam, in part 4, question 2:
LD R2, [FP] ! Retrieves the return value
// Part missing (*)
ST R2, [FP-12] ! Store the returned value in z
I think there is a missing update to the previous FP, which is the one located in the definition environment of p1. In this case we will calculate the address of x with the FP of G2.
Additionally, I didn't found any code for the procedure rule, in which we should give the case when a procedure return or not a value and updates the previous FP.
I'm almost 100% sure about this, but please correct me if I'm wrong on this matter.