r/EmuDev • u/tinymoat • 9d ago
GBA Can't call subroutine from a linked in object file in GBA assembly
/r/Assembly_language/comments/1y299i6/cant_call_subroutine_from_a_linked_in_object_file/
3
Upvotes
1
u/CAPTAINCAPSLOCK111 2d ago
One thing I’d check is the ARM/Thumb state at
main. With.include, assembler directives from the header affect the code that follows. Once you assemble the files separately, that state doesn’t carry over. Make the intended mode explicit in each file and mark Thumb function entries appropriately. Then step through the call in mGBA and check both the destination and CPU mode. The address being right doesn’t prove the instructions are being decoded in the right mode.