Re: More than one #v(expression) in a single line of a macro

Bill Freeman <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.gnupic
Message-ID <[email protected]>
Ben Dugan writes:
...
 > 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.
...

	The following seems to work:

---------------------------------------------------------------
	list	p=16f877
	include "p16f877.inc"

inrtgt	macro	a, b
a#v(b)
	endm

target	macro	a, b
	inrtgt	label#v(a)_, b
	endm

inrbrn	macro	a, b
	goto	a#v(b)	
	endm

brnch	macro	a, b
	inrbrn	label#v(a)_, b
	endm

	org	0
	target	1,2
	movlw	0
	brnch	3, 4
	target	3, 4
	movlw	1
	brnch	1, 2

	end
---------------------------------------------------------------

							Bill
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.