Searching \ for '[PIC]: Bug in gpasm's expression evaluator?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/languages.htm?key=asm
Search entire site for: 'Bug in gpasm's expression evaluator?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: Bug in gpasm's expression evaluator?'
2003\10\20@111101 by Philip Pemberton

face picon face
[CC'd to the GPUtils project admins]

Hi,
 I think I may have found a bug in GPAsm that relates to its decoding of
hexadecimal expressions. Specifically, if I have a constant like this:
 DELTA  EQU 0x9E3779B9
.. GPasm seems to clip it at 0x7FFFFFFF. So i do this with the constant:
 MOVLW (((DELTA & 0xFF000000)>>8)>>8)>>8
.. I end up getting the value 0x7F loaded into W. MPASM, on the other hand,
evaluates the expression correctly and loads the value 0x9E into W. This
particular bug is wreaking absolute havoc with my 32-bit math macros -
especially with the "Load 32-bit constant into variable" (M_COPYLIT) macro.
 Does a workaround for this bug exist - besides, of course, "Rip out the
macros and do the calculations manually"? I suppose I could use MPASM under
Dosemu or WINE, but IME Dosemu takes ages to load.
 I can provide a full, compilable example to demonstrate this bug. Also, if
I try to do a full shift-right-by-24-bits (i.e. "DELTA >> 24"), GPAsm rejects
the line of code with an error - something about the 24 being too large?

Thanks.
--
Phil.                              | Acorn Risc PC600 Mk3, SA202, 64MB, 6GB,
spam_OUTphilpemTakeThisOuTspamdsl.pipex.com              | ViewFinder, Ethernet (Acorn AEH62),
http://www.philpem.dsl.pipex.com/  | 8xCD, framegrabber, Teletext
Nothing can go wroff001010    bus error: core dumped

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\10\20@113634 by Sergio Masci

picon face
----- Original Message -----
From: Philip Pemberton <.....philpemKILLspamspam@spam@DSL.PIPEX.COM>
To: <PICLISTspamKILLspamMITVMA.MIT.EDU>
Sent: Monday, October 20, 2003 4:10 PM
Subject: [PIC]: Bug in gpasm's expression evaluator?


{Quote hidden}

Hi Phil,

I've seen this problem before (not in GPASM BTW). It is to do with using strtol
to convert a string to a long. Hunt down strtol in the GPASM source code and
replace them with strtoul (string to unsigned long) this should fix your
problem.

Regards
Sergio Masci

http://www.xcprod.com/titan/XCSB - optimising structured PIC BASIC compiler

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\10\20@120534 by Scott Dattalo

face
flavicon
face
On Mon, 20 Oct 2003, Philip Pemberton wrote:

> [CC'd to the GPUtils project admins]
>
> Hi,
>   I think I may have found a bug in GPAsm that relates to its decoding of
> hexadecimal expressions.

Is this in the version 0.11.7 that Craig released yesterday?

Scott

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\10\20@121742 by Philip Pemberton

face picon face
In message <EraseMEPine.LNX.4.44.0310200903320.12579-100000spam_OUTspamTakeThisOuTruckus.brouhaha.com>>          Scott Dattalo <scottspamspam_OUTDATTALO.COM> wrote:

> Is this in the version 0.11.7 that Craig released yesterday?
It was when I last checked. It also seems to be in the current CVS version.

Thanks.
--
Phil.                              | Acorn Risc PC600 Mk3, SA202, 64MB, 6GB,
@spam@philpemKILLspamspamdsl.pipex.com              | ViewFinder, Ethernet (Acorn AEH62),
http://www.philpem.dsl.pipex.com/  | 8xCD, framegrabber, Teletext
Ever noticed how DOS never says "GOOD command or filename"?

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\10\21@024001 by Philip Pemberton
face picon face
In message <1066696096.1419.9.camel@R2D2>
         Craig Franklin <KILLspamcraigfranklinKILLspamspamcomcast.net> wrote:

> I believe this bug is covered by:
>
> https://sourceforge.net/tracker/index.php?func=detail&aid=716633&group_id=41924&atid=431665
>
> I will take care of if.  Give me a little time.
It looks like the glitch can be fixed by replacing the strtol in
"gpasm/util.c" with a strtoul. At least, that's what killed the bug in my
copy of GPASM. Thank Sergio Masci, not me :)
Anyway, thanks to Scott Dattalo and Craig Franklin (and anyone else who
contributed code to GPUtils) - GPUtils is great! :)

Later.
--
Phil.                              | Acorn Risc PC600 Mk3, SA202, 64MB, 6GB,
RemoveMEphilpemTakeThisOuTspamdsl.pipex.com              | ViewFinder, Ethernet (Acorn AEH62),
http://www.philpem.dsl.pipex.com/  | 8xCD, framegrabber, Teletext
For sale: One Russian space station. Needs minor repairs.

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\10\21@054845 by Nigel Orr

flavicon
face
pic microcontroller discussion list wrote:

>> I will take care of if.  Give me a little time.
> It looks like the glitch can be fixed by replacing the strtol in
> "gpasm/util.c" with a strtoul. At least, that's what killed the bug
> in my copy of GPASM. Thank Sergio Masci, not me :)

And I hope someone ran a stopwatch on that bug report, debug, repair cycle-
viva Open Source :-)

:-)

Nigel

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2003\10\21@214917 by Craig Franklin

picon face
On Tue, 2003-10-21 at 01:38, Philip Pemberton wrote:
> In message <1066696096.1419.9.camel@R2D2>
>           Craig Franklin <spamBeGonecraigfranklinspamBeGonespamcomcast.net> wrote:
>
> > I believe this bug is covered by:
> >
> > sourceforge.net/tracker/index.php?func=detail&aid=716633&group_id=41924&atid=431665
> >
> > I will take care of if.  Give me a little time.
> It looks like the glitch can be fixed by replacing the strtol in
> "gpasm/util.c" with a strtoul. At least, that's what killed the bug in my
> copy of GPASM. Thank Sergio Masci, not me :)
> Anyway, thanks to Scott Dattalo and Craig Franklin (and anyone else who
> contributed code to GPUtils) - GPUtils is great! :)
>

A patch has been committed to CVS.  It will be in the next gputils
release.  That release is a couple weeks away.  If you can't wait, the
change will be part of the CVS snapshot tomorrow.  A link to the
snapshot is located at http://gputils.sourceforge.net.

You also had a problem with ">> 24".  I think it is caused by using a
default radix of hex.  gpasm is reading this as ">> 0x24" or ">> 36".
Change your radix to dec or use d'24'.

{Quote hidden}

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...