This is the mail archive of the
binutils@sourceware.cygnus.com
mailing list for the binutils project.
Added GAS functionality
- To: binutils at sourceware dot cygnus dot com
- Subject: Added GAS functionality
- From: Timothy Wall <twall at alum dot mit dot edu>
- Date: Tue, 08 Feb 2000 09:33:55 -0500
Hi all,
I've got a few features that are really general features but are
currently tied to a specific port. Please speak up if you think any of
these would be generally useful. These are features that were added to
the target for compatibility purposes. Personally, I don't like #2,
because people can put nasty things in the strings that would normally
get eaten by the preprocessor, but now have to be handled by the
assembler (I couldn't find a good way of scrubbing the strings as input
before doing the substitution). Of course, #1 is closely related to #2,
since it essentially involves the same substitution operations.
1) Expanding macro arguments without them having to be explicitly
escaped.
OP .macro ARG1, ARG2
add ARG1, ARG2 // normally, GAS requires \ARG if you want it
substituted.
.endm
OP a, b
expands to:
add a, b
2) Arbitrary strings assigned to symbols:
.asg MYREG, "reg10"
add MYREG, 10 // evaluates to "add reg10, 10"
2a) Forced substitution with "2" above:
.asg INDEX, "10"
label:INDEX:
add INDEX, reg
Evaluetes to
label10
add 10, reg