gnupic: More nocturnal programming problems
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: ####@####.####
>