Since the sdcc-users mailinglist seems to be not
working i post this bug again here.
Found a small but really annoying bug in the pic16 port
of the sdcc. sdcc is compiled from svn.
The Problem: All Register in the pic16 are 12Bits.
Writing to these registers must either be via the W
register and a "bank select" first or with the movff
When i write the following function (this function
doesn't make any sense, its just to demonstrate the
void func1 (char a, unsigned int b, char c, unsigned int d)
SPBRG = a;
SPBRG = (char) b;
INTCON = c;
INTCON = (char) d;
The values a, and c are written correct to the register
because sdcc generates code like:
movff r0x00, SPBRG
movff r0x02, INTCON
but for the two int values sdcc, generates:
movf r0x01, W
without any bankselect first. glink then generates the
following assembler code out of it:
movwf 0xaf, 0
The register SPBRG is *not* 0xaf but 0xfaf but since
movwf can only handle addresses up to 0xff there must
be either a bank select before or the movff command
must be used.
My problem is that i want to use a few external
functions which are defined like the one above.