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.

Beginners > CowBite Spec - explain me smt

#58257 - ghost Leinad - Sat Oct 22, 2005 12:02 am

what is a BL instruccion? i was googling but i can't understand :(

what does "A BX rn" stands for?

tanx in advance :D
_________________
All human wisdom is summed up in these two words, - 'Wait and hope"
****************************************
My site www.myth-world.net and www.bmrpg.com :)

#58265 - DekuTree64 - Sat Oct 22, 2005 1:31 am

BL is branch with link. It copies the program counter (r15) to the link register (r14), and then does a normal pc-relative branch. Handy for function calls, although you can do the same thing by manually copying pc to lr and branching.

BX is branch with exchange, which means it can switch between the ARM and THUMB instruction sets. It takes a register with the destination address in it, and treats bit0 of the address as the instruction set flag (0=ARM, 1=THUMB).
Since you can never execute from an odd address, bit0 would normally always be 0, so it's convenient to use as a flag.

EDIT: I forgot to mention, that A in "A BX rn" shouldn't be there, it's just "BX rn". BX is the instruction, and rn can be any register r0-r15.
_________________
___________
The best optimization is to do nothing at all.
Therefore a fully optimized program doesn't exist.
-Deku

#58300 - Cearn - Sat Oct 22, 2005 1:06 pm

When in doubt, check GBATek.