From 118b6e9a8572a9d10cbad9a547ce1df10365bab1 Mon Sep 17 00:00:00 2001 From: Corwin Kuiper Date: Sat, 29 May 2021 12:18:34 +0100 Subject: [PATCH] load zeros to correspond to argc and argv --- agb/crt0.s | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/agb/crt0.s b/agb/crt0.s index 8e043a69..f904d2cd 100644 --- a/agb/crt0.s +++ b/agb/crt0.s @@ -30,9 +30,15 @@ __start: ldr r2, =__ewram_rom_length_halfwords swi 0x000B0000 + + @ put zero in both r0 and r1 + @ This corresponds to zero for argc and argv (which would technically be required for a c runtime) + ldr r0, =0 + mov r1, r0 + @ load main and branch - ldr r0, =main - bx r0 + ldr r2, =main + bx r2 .pool .include "interrupt_simple.s"