On Sunday 29 October 2006 23:54, Raphael Neider wrote:
> > Weird, it gets stuck in gpsim about [****] here:
> > BCF STATUS,5
> > BCF STATUS,6
> > **** MOVWF _var_u_char_8_b
> > ; .line 14; "bDIV.c" return var_u_char_8_b;
> > MOVF _var_u_char_8_b,W
> > RETURN
> > ; exit point of _div1
> Any message from gpsim?
Not that I recall, and I do remember looking.
> Did you recompile the pic14 library after upgrading?
> I use gpsim r1748 (roughly 0.21.12-pre) and SDCC r4440, when last I
> looked gpsim releases were rather outdated, maybe you should use the svn
> version as well?
I think I did, I believed I had deleted them to be sure. I've just downloaded
the latest version of gputils via cvs and am installing them now on a fresh
Slackware 11.0 installation (wanted to upgrade slack at some point anyhow,
might as well do it now and see if my pic problems go away).
> Checked your code with a main() that calls the given function with
> arguments of -1000, -500, 0, 500, and 1000, and set a breakpoint once
> the result of __divsint has been stored into the registers (address
> taken from .lst file). I then used 'trace 20' to obtain the past
> assignments of both result bytes and found they were totally reasonable
> 0x0000, 0x003e, 0x007d, 0x00bb, and 0x00fa respectively. Target PIC was
> a 16f877 (which one do you use?).
Good to see my routine was working somewhere as intended!
PIC16F877-20I/P - that is on my development board. Once something works I may
well change to another PIC, but it is rather handy to develop the software on
the board I have here.
> ((Two side notes: If you put position + 1000 in an unsigned variable, SDCC
> should optimize the division to right shifts---and possibly hide your
> problem... Using 8u instead of 8 might also be required...))
Usefull to know.
> You may want to inspect your .map files to see if you are out of memory;
> or if gputils have allocated some variables where they should not have
> been, possibly instructed by SDCC; or ...
I don't think I've been out of memory, but a bit or practice with the map
files would not go amiss.
I will report back shortly on how I get on with the new installation.
Of course slightly disturbed that reinstallation is usually the cop out when
you don't know how to fix the problem...