Properly initialize registers, the stack, .data, and .bss
The mode-switch binary failed to run in the emulator because it wasn't initializing the stack pointer. It probably worked when running on real hardware only because the stack pointer was already initialized there, and this code simply reused it. While we're initializing the stack pointer, we might as well initialize everything else, too, so this change also initializes the general-purpose registers, the link register, and the .data and .bss sections of the binary (even though this code doesn't use them).
Loading
Please register or sign in to comment