How do I redefine register symbols with the XA assembler?
Q: I want to define symbols as register names when writing XA assembler code, but once I’ve used equ to define a new register name, I can’t later use set to redefine that name to something else. A: What happens is this; once you have defined a symbol as a register, it then becomes identical with that register, i.e. this code: areg equ r0 areg set 0 is equivalent to areg equ r0 r0 set 0 which is syntactically incorrect. The way I would do it is to use the C preprocessor, and do #define areg r0 … #undef areg #define areg 0 You can get the XAC driver to automatically run the assembler file through CPP by using the -P option, e.g. xac -p -c yourfile.as will preprocess then assemble yourfile.as, leaving yourfile.obj.