gnupic: Trouble with macros conditionally generating code


Previous by date: 19 Nov 2004 10:01:38 +0000 Re: Trouble with macros conditionally generating code, Pete Elmore
Next by date: 19 Nov 2004 10:01:38 +0000 Re: Trouble with macros conditionally generating code, nisma.gmx.net
Previous in thread: 19 Nov 2004 10:01:38 +0000 Re: Trouble with macros conditionally generating code, Pete Elmore
Next in thread: 19 Nov 2004 10:01:38 +0000 Re: Trouble with macros conditionally generating code, nisma.gmx.net

Subject: Re: Trouble with macros conditionally generating code
From: Marco Pantaleoni ####@####.####
Date: 19 Nov 2004 10:01:38 +0000
Message-Id: <20041119100106.GH29386@lucifero>

On Fri, Nov 19, 2004 at 01:43:30AM -0800, Pete Elmore wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> | 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.
> The nops never get overwritten.  It generates either
> 	bxf 0xa, 3
> 	bxf 0xa, 4
> 	call label
> or
> 	nop
> 	nop
> 	call label

Yes, but if the assembler produces different code in the two passes
as I suspect, it *will* overwrite the nops (and I've tried, and I
effectively get the Error 118).
I'd like to know if you don't get the error and why, if you put the
nops.
Just trying to understand what happens here, and if my understanding
of gpasm and macros are correct.

> It's harmless to set the bits if you don't need it, although it adds
> unnecessary instructions.

This makes sense, I think I'll do the same (why use nop, if setting
page selection bits is equally expensive? :-). But the second pass
problem remains.

> I was going to do something like this, but the documentation for gpasm
> says that pagesel changes pages with movlw and movwf, and I wanted to
> avoid altering W (a few routines I wrote near the beginning of the

yikes! That explains a lot of things... :-)
I should have read more carefully that document....
Good to know, thanks :-)

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

Previous by date: 19 Nov 2004 10:01:38 +0000 Re: Trouble with macros conditionally generating code, Pete Elmore
Next by date: 19 Nov 2004 10:01:38 +0000 Re: Trouble with macros conditionally generating code, nisma.gmx.net
Previous in thread: 19 Nov 2004 10:01:38 +0000 Re: Trouble with macros conditionally generating code, Pete Elmore
Next in thread: 19 Nov 2004 10:01:38 +0000 Re: Trouble with macros conditionally generating code, nisma.gmx.net


Powered by ezmlm-browse 0.20.