Re: More than one #v(expression) in a single line of a macro
Ben Dugan <[email protected]>
| Newsgroups | gmane.comp.hardware.microcontrollers.gnupic |
|---|---|
| Message-ID | <[email protected]> |
** Actually, I tried to send the file but it was bounced because it was over 30,000 bytes. The file can be retrieved at the url below; its name is ENGR2210.inc. Bill, This is clever; thanks! I have to think if it'll do what I'm really looking for, though. It might, but I'm not sure. I am looking for a way that the labels are generated automatically, and branches to them can be calculated automatically, through macros. So I don't want to "set" the adresses of the labels as you've done. This may be a minor issue, but I can't tell yet. I'm attaching ** the file that started all this for me: its Brad Minch's file of "structured macros" that are used in the pic18f2455 for usb purposes. The total code for that is available at: http://pe.ece.olin.edu/ece/projects.html (I am working with the Lab 2 for 18f2455 one) But the reason I'm attaching the macro file is that I think it'll clarify why I'm not sure this will work. I'm actively looking into this now, so I may be able to report more later. I appreciate your suggestions, but don't jeopardize your "day job" to keep providing me with excellent help! Ben PS I am attaching the DOS version of this file, but can send a slightly hacked-up linux version if you prefer. Bill Freeman wrote: > Ben, > > I find the (f)lex stuff especially scary. > > But for your specific problem, would something like the > following work? > > --------------------------------------------------------------- > list p=16f877 > include "p16f877.inc" > > inner macro a, b > a#v(b) set 0x45 > endm > > outer macro a, b > inner label#v(a)_, b > endm > > inner2 macro a > a#v(j) set D'69' > endm > > outer2 macro > inner2 label#v(i)_ > endm > > outer 5, 6 > > i set 3 > j set 4 > > outer2 > > end > --------------------------------------------------------------- > > This assembles for me, and if I look near the end of the .lst > file I see that both label3_5 and label5_6 have been defined properly. > > Bill > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > >