How to do token pasting in MPASM?
Ned Konz email (remove spam text)
On Thursday 20 February 2003 08:32 pm, Dwayne Reid wrote:
> At 07:23 PM 2/20/03 -0800, Ned Konz wrote:
> >On Thursday 20 February 2003 07:12 pm, Dwayne Reid wrote:
> >No, I couldn't find a way to make #define work.
> Can you give a concrete example of what you want to accomplish? In
> other words, show the specific input and output you want (as
> opposed to the generic xyz examples you posted earlier). I'm
> thinking that once we see what you are trying to accomplish,
> someone might have an idea.
What I want to do is to make a set of macros for programming
state-machine based programs.
Each type of state machine (there can be multiple instances of the
same kind of state machine, of course) has several tables associated
with it, as well as one subroutine per state.
I want to make it so you can have two different kinds of state
machines that have states with the same name (to make it easier to
re-use state machine code).
So I want to decorate the enames of the state subroutines with the
name of the kind of state machine they're used in. This way, I can
have two "idle" states in different kinds of state machines, but
their labels will still be unique.
I should be able to do this using the #v() operator to paste tokens,
though they'll have a useless number in between. At least they'll be
GPG key ID: BEEA7EFE
http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads
In reply to: <firstname.lastname@example.org>
See also: www.piclist.com/techref/microchip/languages.htm?key=asm
You must be a member of the
piclist mailing list
(not only a www.piclist.com member) to post to the