From 32c6ed4e358652ac64972541740eb0e34bf58690 Mon Sep 17 00:00:00 2001 From: Gwilym Inzani Date: Tue, 4 Jun 2024 21:39:58 +0100 Subject: [PATCH] Ensure the frame pointer is always 0 --- agb/src/entrypoint.s | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/agb/src/entrypoint.s b/agb/src/entrypoint.s index 45ebe74d..9f2ea49a 100644 --- a/agb/src/entrypoint.s +++ b/agb/src/entrypoint.s @@ -80,8 +80,12 @@ CommonInit: ldr r0, =0 mov r1, r0 + @ ensure the frame pointer is zero so that stack traces are guaranteed to terminate + mov r7, r0 + @ load main and branch ldr r2, =main + mov lr, pc bx r2 @ loop if we end up here