ps5: function epilogue

This commit is contained in:
2026-03-29 17:36:19 +02:00
parent 80e0fb43e3
commit 9c0a21f929

View File

@@ -148,6 +148,10 @@ static void generate_function(symbol_t* function)
// TODO (Task 4): the function body can be sent to generate_statement()
// TODO (Task 3.2): Emit the epilogue, including a label and a default return value (0)
LABEL(".%s.epilogue", function->name);
MOVQ(RBP, RSP);
POPQ(RBP);
RET;
}
// Generates code for a function call, which can either be a statement or an expression