Re: [Sdcc-user] pic16f877a function call destroys pointer

2009-11-05 Thread Klampiar
On Friday 06 November 2009 00:23:53 Raphael Neider wrote: > You can prevent it by (a) updating to sdcc 2.9.4, >= r5568 (either using > a snapshot or the svn head) or (b) by avoiding generic pointers, > replacing them with __data pointers: > > unsigned char text[10]; > > void LCD_String(__data unsig

Re: [Sdcc-user] help! very small change in code causes output to not load at all.

2009-11-05 Thread Anthony Asterisk
the file that contains main() was not linked first. Changing the order did not fix the issue. Any other suggestions? a* Anthony Asterisk wrote: I'll check that out. Any idea why accessing this one variable would change the order? It seems totally random. Maarten Brock wrote: Anthony, A

Re: [Sdcc-user] pic16f877a function call destroys pointer

2009-11-05 Thread Raphael Neider
Hi, > Program displays just T[glyph/rand char][glyph/rand char][glyph/rand > char] [glyph/rand char]. > > Why is this happening and how can I prevent it? Thanks. You perform pointer arithmetics on generic pointers (*(s+1)), and thus triggered a compiler bug which assigned only the lower 2 byte

[Sdcc-user] pic16f877a function call destroys pointer

2009-11-05 Thread Klampiar
Hi, Im trying to display string to lcd using following code: void LCD_String(unsigned char *s) { LCD_Char(*s); LCD_Char(*(s+1)); LCD_Char(*(st+2)); LCD_Char(*(s+3)); return; } called with LCD_String(text); in main(), text is unsigned char text[10]; declared outside main() and initialized with "