I tried andrew's suggestion: #define open(x) ((x) macro) but that does not work (in mpasm V01.50 from MPLAB). "open(a)" seems to be translated to "(a) macro" or "((a) macro)", which is not accepted by mpasm as the start of a macro definition. BTW, I can start a macro open (see below), but I can not end a macro with close! #define open(name)name macro #define close endm ... open(my_macro) ; macro body close Anyone understands why? To rephrase the second part of my question: can a #define macro translate to multiple lines? regards, Wouter. > ---------- > From: Andrew Warren[SMTP:fastfwd@IX.NETCOM.COM] > Reply To: pic microcontroller discussion list > Sent: Thursday 14 August 1997 10:17 > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: mpasm question > > Ooijen,Wouter van > wrote: > > > I want a #define-style macro to translate to mutiple lines, one of > > which would be the beginning (or end) of a label-MACRO-args style > > macro. > > > > something like: > > > > #define procedure(name) \ > > name macro > > > > #define endproc(name) \ > > endm > > Wouter: > > I'm not sure that I understand what you want... But if you just want > to type > > procedure (name) > > and have MPASM translate it to > > name macro > > then you can do it with the following #define: > > #define procedure(name) ((name) macro) > > The corresponding #define for "endproc" is simply: > > #define endproc(name) (endm) > > Depending upon the way you indent your "procedure" and "endproc" > invocations, you may need to add the following to the top of your > source file: > > LIST FIXED=0 > > I hope this helps... But, again, I really don't think I understood > your question. > > -Andy > > === Andrew Warren - fastfwd@ix.netcom.com > === Fast Forward Engineering - Vista, California > === http://www.geocities.com/SiliconValley/2499 > > === For PICLIST help (including "unsubscribe" instructions), > === put the single word "help" in the body of a message and > === send it to: listserv@mitvma.mit.edu >