#1824 PIC16: incorrect code pointer generation

open
nobody
PIC16
5
2013-07-16
2011-08-17
M.Hoehle
No

SDCC version: 3.0.4 #6622

Command line: sdcc -c -mpic16 -p18f2685 --denable-peeps test.c

source:
{
__code const unsigned char * hexfa;
hexfa=(__code unsigned char *)0x12000L;
}
will result in:
CLRF r0x01
MOVLW 0x20
MOVWF r0x02
CLRF r0x03

wehre the upper byte is lost!

NO error Message is generated!!!

Discussion

  • Maarten Brock
    Maarten Brock
    2011-09-18

    • summary: incorrect code pointer generation --> PIC16: incorrect code pointer generation
     
  • Maarten Brock
    Maarten Brock
    2011-09-18

    Does SDCC support pointers larger than 16 bits for PIC16? I doubt it.

     
  • M.Hoehle
    M.Hoehle
    2011-09-20

    Shure, The PIC16 is able to adress 20Bit of code.
    The hole handling of code pointers in the SDCC is designed for 20Bits!
    After loading a long ponter it works well.
    The only problem is the initaialisation from an constant

     
    • Category: --> PIC16