gnupic: More nocturnal programming problems


Previous by date: 16 Mar 2004 02:07:11 +0000 Re: gpsim and usart module, Mike Rothon
Next by date: 16 Mar 2004 02:07:11 +0000 Re: Named cblocks?, Craig Franklin
Previous in thread: 16 Mar 2004 02:07:11 +0000 More nocturnal programming problems, David Willmore
Next in thread: 16 Mar 2004 02:07:11 +0000 Re: More nocturnal programming problems, Paul B. Webster

Subject: Re: More nocturnal programming problems
From: Craig Franklin ####@####.####
Date: 16 Mar 2004 02:07:11 +0000
Message-Id: <1079402794.1454.11.camel@r2d2>

On Mon, 2004-03-15 at 04:13, David Willmore wrote:
> Hello, again.
> 
> Same situation as before, sorry.
> 
> Can anyone enlighten me as to why:
> 
> msg_len		EQU	(message_end - message_start)
> 
> message_start:
> 	retlw	b'00000000'
>  [... etc ...]
> 	retlw	b'11111111'
> message_end:
> 
> Gives me a:
> /usr/home/willmore/src/pic/test/10/test.asm:35:Error [116] Value of symbol "message_len" differs on second pass
>  pass 1=0,  pass 2=125
> Error code : 256
> 
> It seems that it's upset that when it first evaluates the
> expression, it has no values for message_end and message_start,
> so their difference is 0, but after having a longer look at
> things, it decides that it's now 125.  This causes a bit of
> confusion and an error.
> 
> Again, am I missing some common trick or am I expecting
> the wrong things out of my tools?  i.e. pilot error or
> pilot error. :)
> 

Symbols assigned a value using EQU can't be changed.  gpasm checks the
value on each pass to make sure they match.  On the first pass
message_end and message_start have a value of 0.  So msg_len has a value
of 0.  On second pass message_end is 125, so msg_len changes.

You can change to the SET directive or use a #define.  A few other
options exist. Pick the one that suits you best.  


> Cheers,
> David
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####
> 


Previous by date: 16 Mar 2004 02:07:11 +0000 Re: gpsim and usart module, Mike Rothon
Next by date: 16 Mar 2004 02:07:11 +0000 Re: Named cblocks?, Craig Franklin
Previous in thread: 16 Mar 2004 02:07:11 +0000 More nocturnal programming problems, David Willmore
Next in thread: 16 Mar 2004 02:07:11 +0000 Re: More nocturnal programming problems, Paul B. Webster


Powered by ezmlm-browse 0.20.