1 NOTES file for SDCC pic16 port
4 Current pic16 port status is: Development
6 Some things may change without notification between port updates. The latest
7 CVS snapshot is guarenteed to compile without problems, but does not
8 guarantee backwards compatibility.
10 For any questions please ask the current port
14 Vangelis Rokas <vrokas AT otenet.gr>
16 Other people to contact:
17 Scott Dattalo <scott AT dattalo.com>
19 ======================================================================
20 ======================================================================
21 2004-Aug-30 Vangelis Rokas
22 1. A few months ago Hans Dorn had the idea to support general pointer
23 for accessing all code, eeprom data and data ram memory. These pointers
24 would have 3 bytes of size (24-bits), of which only the 21 lower bits
25 would be useful. The rest of them could be used to indicate the pointer
27 0x4xxxxxxx would mean code pointer
28 0x8xxxxxxx would mean eeprom pointer
29 0xcxxxxxxx would mean data ram pointer
31 The implementatio of such pointers needs a lot of work and general
32 reform of pointer access, data initializing functions and the writing
33 of support functions for decoding their type.
35 The implementation of such pointers along with the implementation of
36 a more SDCC like stack access system will allow the writing of variable
37 arguments functions like printf etc... Also one set of functions will be
38 able to handle all data types without having to worry about where they
42 2004-May-23 Vangelis Rokas
44 1. The improvement of the port has been stalled a bit. But, struct/union
45 SFR headers are ready for the PIC18F[45][45][28] chips along with their
48 2. The genCmp function should be rewritten from scratch.
50 3. The internal helper functions for char/int/long/float arithmetic
51 now compile and will be placed in the appropriate directory under device/
55 2004-Feb-20 Vangelis Rokas
56 Major update with many bugfixes.
58 1. The most of the pic16 regression tests (former pic regression tests) pass
59 successfully. Many thanks to Hans Dorn who did a great job with the
60 arithmetic, shift and pointer functions.
62 2. Bit fields now work properly.
64 3. Stack is permanently enabled. Command argument -pstack-enable is deleted
65 and no more recognized by the port.
68 2004-Feb-07 Vangelis Rokas
70 1. Fixed a bug so that compiler allocated internal registered, will
71 be shared along multiple sources via '.registers' section placed
72 in absolute data memory address 0x0000. Registers 0x00 to 0x7f are
73 considered as internal since they can be used for fast access.
77 2004-Jan-11 Vangelis Rokas
80 The current release of the port can produce object code which is not
81 completely bug free. To use the new features the user should enable them via
82 command line arguments. A sane set of command arguments that I use to test
86 --debug enable sdcc debug information
87 --debug-xtra enable pic16 port debug information (most useful)
88 --debug-ralloc enable register allocator debug messages
89 --pcode-verbose enable verbose pcode generator messages
92 --pno-banksel disable banksel directives for the assembler
93 --pomit-config-words does not emit configuration instruction in
94 the translation This is useful when copmiling
95 multiple sources, when you do not want multiple
96 config instructions in the end file
97 --pomit-ivt disables the dumping of the interrupt vector tables
98 in the translation for the same reasons as above
99 --penable-stack enables stack support. This option uses stack to
100 pass function arguments, and reuses registers between
101 functions by saving the registers used in the function
105 --all-callee-saves you may omit this options as the port
106 enables it by default, all functions are currently
107 compiled as reentrant and they are marked as
109 --no-peep peephole optimizer is better to be switched off,
110 because it behaves strangely in some cases
111 --fommit-frame-pointer this omits frame pointer in functions that
112 don't use registers (maybe changed later, not
117 The current implementation puts every function in its own code section in
118 PIC's program memory. This may not be the standard, but I think its more
122 Since SDCC is goind for a release, its better to document pragmas available.
125 The 'code' pragma emits a function's code at a specific address in program
126 memory. Currently it is only used for functions.
128 #pragma code [function_name] [address]
131 The 'stack' pragma initializes the stack/frame pointer at an address of the
132 data ram other than the default (which is the end of the available data ram)
134 #pragma stack [address]
137 The 'maxram' pragma sets maximum data ram of the device. Currently is not
138 used at all, but it may be useful in the future when devices with external
139 memory will be supported.
141 #pragma maxram [max_address]
144 4. Internal compiler functions
145 Internal SDCC functions like, __fsmul, etc... are currently supported by the
146 port, but the libraries for the pic16 port are not yet ready. So one cannot
147 use long and float variables.
150 5. Special Function Registers (SFRs)
151 The processor SFRs are not anymore declared in any header file. The user can
152 define by himself all the needed SFR's. The code to that is:
154 sfr at [sfr_address] [sfr_name];
156 Where sfr_address is the SFR address in the data ram, and sfr_name is the
157 name of the SFR. i.e.: