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 > asm for beginner

#57115 - NighTiger - Thu Oct 13, 2005 9:30 pm

hi guys,
I would like to know what I can do to learn asm... tnx

#57120 - Joat - Thu Oct 13, 2005 9:57 pm

Google for the ARM ARM (DDI 0100), and arm7tdmive.pdf (DDI 0029 I think).

Grab some well commented asm code for a gba demo, and study it. The important thing to remember is that each opcode only does one thing, but it does exactly what it says, so you need to get used to looking at several opcodes for a coherent thought, so to speak. and when writing, thinking in terms of constructs and not individual opcodes (i.e. I want a loop here, not I want a label, then some opcodes, then a conditional branch). Dunno how to explain it, exactly.

How you'll learn best is really a personal matter, but no matter what, you should have those reference documents available, to look up exactly what any opcode does.

I think someone also made a tutorial for doing the GBA in asm, but I'm not certain.
_________________
Joat
http://www.bottledlight.com

#57155 - headspin - Thu Oct 13, 2005 11:42 pm

Check out archives of gbaguy's ASM tutorials
_________________
Warhawk DS | Manic Miner: The Lost Levels | The Detective Game

#57198 - Cearn - Fri Oct 14, 2005 8:01 am

Compile with -S and you can get the assembly GCC generates for C code. It's not always the 'best' possible, but at least you can learn the basics. Don't forget to explicitly mention an output name, though.
GBATek has a really concise reference guide for both instruction sets, which is great if you have to look up something fast. Also take a look at the AAPCS, which telly you how you're supposed to deal with function calls and their arguments.

#57661 - Miked0801 - Mon Oct 17, 2005 5:56 pm

In some ways, assembly is easier to code than a higher level function. The ARM instruction set is especially easy to work with. It's almost like going back to BASIC programing. You get a set number of variables and a set number of commands. Branching is done via "gotos" and the resulting code is fairly easy to trace with the right tools. Of course, I've coded as much assembler as C so I may be a bit biased :)