gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

ASM > How to write an Asm program that works?

#173642 - bollkalle - Tue Apr 20, 2010 4:24 pm

I use the assembler arm-agb-elf-as. In devkitadv. But all my programs give the error in vba: Unsupported ARM mode: 00

What do I need to have in the code to get the code legal for the assembler and the gba? All other programs that other people have done run correctly.

#173645 - kusma - Tue Apr 20, 2010 6:34 pm

slightly off-topic, but worth mentioning: Devkit Advance is horribly outdated, use devkitARM instead, available from devkitPro.

#173655 - Ruben - Wed Apr 21, 2010 10:27 am

Wellllllll, for one, you'd need to make sure that, if you're using a custom cart file, you start up correctly. Secondly, as mentioned before, use devKitARM - compilers change a lot over 5+ years ;D. Lastly, if the problem isn't that, upload the code to pastebin or something and we'll [at least I will =P] take a look at it

#173658 - bollkalle - Wed Apr 21, 2010 5:50 pm

The problem is not the compilers, because other programs written by experienced gba programmers do work in devkitadv.

"Wellllllll, for one, you'd need to make sure that, if you're using a custom cart file, you start up correctly."

What do you mean?

#173659 - Dwedit - Wed Apr 21, 2010 8:33 pm

Maybe start with one of the example programs from devkitpro's examples directory. Remove all the .c files, make a .s file which exports 'main'. Then you can use devkitpro's crt0 code to get you all nice and booted, and jump to the main function.

The ctr0 code basically copies the areas of memory to where they're supposed to be, then jumps to main.

Obviously you can't directly execute .o files, those aren't plain old binary files, and they're not relocated to the correct start address.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."