Hi, > __code unsigned short __at(_CONFIG1) config1Reg = (_FCMEN_OFF & _IESO_OFF & > _BOREN_ON & _CPD_ON & _CP_ON & _MCLRE_OFF & _PWRTE_ON & _WDTE_OFF & _FOSC_HS); > __code unsigned short __at(_CONFIG2) config2Reg = (_LVP_ON & _BORV_25 & > _STVREN_ON & _PLLEN_ON & _WRT_ALL); > > And it generated this output in asm file: > ID_test_0 code 0x8007 > _config1Reg > retlw 0x02 ;My comment: this instruction placed at 0x8007 > retlw 0xce ;My comment: this instruction placed at 0x8008 > ID_test_1 code 0x8008 > _config2Reg > retlw 0xfc ;My comment: this instruction placed at 0x8008 > retlw 0xfb ;My comment: this instruction placed at 0x8009
I looked it up in the sdcc source: for the pic14 port, the location of the config words is hard-coded in src/pic14/device.c to reside at 0x2007 (and optionally at 0x2008). While the existence of the second config word is indicated in pic14devices.txt, their location is not. What happens now is that the "TYPE __at(ADDR)" statements are specially checked by the compiler as to whether the __at(ADDR) refers to a config word location (0x2007 or 0x2008) and turns it magically into the __config directive for the assembler. Unfortunately, your device has its configuration words in a different location :-( I will patch sdcc to read the location of the config word(s) from pic14devices.txt at runtime so that you can add you device properly. I will report back once the necessary changes are present in the SVN. Raphael ------------------------------------------------------------------------------ The demand for IT networking professionals continues to grow, and the demand for specialized networking skills is growing even more rapidly. Take a complimentary Learning@Cisco Self-Assessment and learn about Cisco certifications, training, and career opportunities. http://p.sf.net/sfu/cisco-dev2dev _______________________________________________ Sdcc-user mailing list Sdcc-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sdcc-user