piclist 2003\02\20\145315a >
Thread: How to do token pasting in MPASM?
www.piclist.com/techref/microchip/languages.htm?key=asm
flavicon
face BY : Ned Konz email (remove spam text)



Say I want to make a MPASM macro that will be invoked as:

       MyMacro abc,xyz

and will generate the following code:

abcxyz    equ 123

That is, it pastes its two arguments together to make a label. Is this
possible in MPASM? How about:

abcxyz    equ "abcxyz"

Which also pastes the arguments together and makes a string out of
them.

I know how to do it in C using the ## token pasting operator and the #
stringizing operators (and the fact that two adjacent strings are
merged).

But I only see the #v(<expr>) form that would allow tokens to be
pasted together (with an intervening number).

After reading the MPASM manual I can't figure out how to do these. I
hope this isn't an oversight.

Thanks,
--
Ned Konz
http://bike-nomad.com
GPG key ID: BEEA7EFE

--
http://www.piclist.com hint: To leave the PICList
TakeThisOuTpiclist-unsubscribe-request.....spamspam_OUTmitvma.mit.edu>
<200302201151.39256@ned.bike-nomad.com> 7bit

See also: www.piclist.com/techref/microchip/languages.htm?key=asm
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) How to do token pasting in MPASM?

month overview.

new search...