gnupic: Trouble with macros conditionally generating code


Previous by date: 19 Nov 2004 09:07:45 +0000 Re: Trouble with macros conditionally generating code, Marco Pantaleoni
Next by date: 19 Nov 2004 09:07:45 +0000 Re: Trouble with macros conditionally generating code, Marco Pantaleoni
Previous in thread: 19 Nov 2004 09:07:45 +0000 Re: Trouble with macros conditionally generating code, Marco Pantaleoni
Next in thread: 19 Nov 2004 09:07:45 +0000 Re: Trouble with macros conditionally generating code, Marco Pantaleoni

Subject: Re: Trouble with macros conditionally generating code
From: Marco Pantaleoni ####@####.####
Date: 19 Nov 2004 09:07:45 +0000
Message-Id: <20041119090718.GE29386@lucifero>

On Fri, Nov 19, 2004 at 12:18:28AM -0800, Pete Elmore wrote:
> 
> fcall macro label
> 	if ((high(label) & 0x18) != (high($) & 0x18))
> 		if((high(label) & 8) == 8)
> 			bsf 0xa, 3
> 		else
> 			bcf 0xa, 3
> 		endif
> 		if((high(label) & 0x10) == 0x10)
> 			bsf 0xa, 4
> 		else
> 			bcf 0xa, 4
> 		endif
> 	else
> 		nop
> 		nop
> 	endif
> 	call label
> 	endm
> 
> Note the additional nops.  They ensure that the macro always generates
> three instructions, rather than sometimes generating three and sometimes
> generating one.  Although I acknowledge the possibility that my code is
> broken in some way, I am fairly certain that this is a bug in the
> assembler.

But, doesn't this version produce error 118 ("Error [118] Overwriting
previous address contents.")?
On the second pass, when the assembler overwrite the "nop"s, it should
shout, if I am not wrong.

-- 
========================================================================
Marco Pantaleoni                                  ####@####.####
Padova, Italy
elastiC language developer                   http://www.elasticworld.org

Previous by date: 19 Nov 2004 09:07:45 +0000 Re: Trouble with macros conditionally generating code, Marco Pantaleoni
Next by date: 19 Nov 2004 09:07:45 +0000 Re: Trouble with macros conditionally generating code, Marco Pantaleoni
Previous in thread: 19 Nov 2004 09:07:45 +0000 Re: Trouble with macros conditionally generating code, Marco Pantaleoni
Next in thread: 19 Nov 2004 09:07:45 +0000 Re: Trouble with macros conditionally generating code, Marco Pantaleoni


Powered by ezmlm-browse 0.20.