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 > #DEFINE in ASM

#6618 - regularkid - Fri May 30, 2003 5:23 pm

Is there a way to use a "define-like" command in ASM in order to make my code easier to read? I am using all the registers (r0 - r15) and it is very difficult to keep track of which register is doing what. So I want to be able to do something like this:

Code:

#DEFINE        X_VAR        r0
#DEFINE        Y_VAR        r1


Can someone help me out? Thanks!
_________________
- RegularKid

#6619 - Jason Wilkins - Fri May 30, 2003 7:49 pm

Use a capitol S as the extension and/or supply the --Xcpp-with-assembler option to gcc when you assemble your file. gcc will then run the c pre-processor on the assembly file before passing it to the assembler.
_________________
http://devkitadv.sourceforge.net