Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How do I redefine register symbols with the XA assembler?

0
Posted

How do I redefine register symbols with the XA assembler?

0

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.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123