Passing relational operators to macros

Ben Dugan <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.gnupic
Message-ID <[email protected]>
I'm looking at Brad Minch's assembler code for the 18f2455, which is 
mpasm-ready, but maybe not quite gpasm-ready.  I'm trying to see if I 
can get it to work with gpasm.

He wrote some interesting macros, which is the reason I'm posting this 
question:

Can a macro in gpasm be passed a relational operator (==, !=, <=, >=, 
etc.) as a argument, and then use it in a conditional statement?  For 
instance, can I write:

blah macro relop
	if (1 relop 1)
		; an equal sign was passed
	else if (1 relop 0)
		; one of these was passed: !=, >, or >=
	endif
	endm

Apparently mpasm can handle this, but I'm getting syntax errors from 
gpasm on the (1 relop 1) and (1 relop 0) lines.

Let me know if this is not an appropriate place to ask this question!

If it would be helpful I can send a short asm file.

Thanks.

Ben
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.