* src/port.h (PORT structure): added hook initPaths, now each
[fw/sdcc] / src / pic16 / NOTES
1 NOTES file for SDCC pic16 port
2 $Id$
3
4 Current pic16 port status is: Development
5
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.
9
10 For any questions please ask the current port
11 developers.
12
13 Current developer:
14 Vangelis Rokas  <vrokas AT otenet.gr>
15
16 Other people to contact:
17 Scott Dattalo   <scott AT dattalo.com>
18
19 ======================================================================
20 ======================================================================
21 2004-May-23 Vangelis Rokas
22
23 1. The improvement of the port has been stalled a bit. But, struct/union
24 SFR headers are ready for the PIC18F[45][45][28] chips along with their
25 respective sources.
26
27 2. The genCmp function should be rewritten from scratch.
28
29 3. The internal helper functions for char/int/long/float arithmetic
30 now compile and will be placed in the appropriate directory under device/
31
32
33
34 2004-Feb-20 Vangelis Rokas
35 Major update with many bugfixes.
36
37 1. The most of the pic16 regression tests (former pic regression tests) pass
38 successfully. Many thanks to Hans Dorn who did a great job with the
39 arithmetic, shift and pointer functions.
40
41 2. Bit fields now work properly.
42
43 3. Stack is permanently enabled. Command argument -pstack-enable is deleted
44 and no more recognized by the port.
45
46
47 2004-Feb-07 Vangelis Rokas
48
49 1. Fixed a bug so that compiler allocated internal registered, will
50 be shared along multiple sources via '.registers' section placed
51 in absolute data memory address 0x0000. Registers 0x00 to 0x7f are
52 considered as internal since they can be used for fast access.
53
54
55
56 2004-Jan-11 Vangelis Rokas
57
58 1. Compiling
59 The current release of the port can produce object code which is not
60 completely bug free. To use the new features the user should enable them via
61 command line arguments. A sane set of command arguments that I use to test
62 programs is:
63
64 - debug options
65         --debug         enable sdcc debug information
66         --debug-xtra    enable pic16 port debug information (most useful)
67         --debug-ralloc  enable register allocator debug messages
68         --pcode-verbose enable verbose pcode generator messages
69
70 - port options
71         --pgen-banksel  enable banksel directives for the assembler
72                         This will be turned on by default later, but left as
73                         is for now
74         --pomit-config-words    does not emit configuration instruction in
75                         the translation This is useful when copmiling
76                         multiple sources, when you do not want multiple
77                         config instructions in the end file
78         --pomit-ivt     disables the dumping of the interrupt vector tables
79                         in the translation for the same reasons as above
80         --penable-stack enables stack support. This option uses stack to
81                         pass function arguments, and reuses registers between
82                         functions by saving the registers used in the function
83                         on the stack
84
85 - compiler options
86         --all-callee-saves      you may omit this options as the port
87                         enables it by default, all functions are currently
88                         compiled as reentrant and they are marked as
89                         callee-saves
90         --no-peep       peephole optimizer is better to be switched off,
91                         because it behaves strangely in some cases
92         --fommit-frame-pointer  this omits frame pointer in functions that
93                         don't use registers (maybe changed later, not
94                         important)
95
96
97 2. Functions
98 The current implementation puts every function in its own code section in
99 PIC's program memory. This may not be the standard, but I think its more
100 flexible.
101
102 3. Pragmas
103 Since SDCC is goind for a release, its better to document pragmas available.
104
105 3.1. code
106 The 'code' pragma emits a function's code at a specific address in program
107 memory. Currently it is only used for functions.
108 Syntax:
109 #pragma code [function_name] [address]
110
111 3.2. stack
112 The 'stack' pragma initializes the stack/frame pointer at an address of the
113 data ram other than the default (which is the end of the available data ram)
114 Synatx:
115 #pragma stack [address]
116
117 3.3. maxram
118 The 'maxram' pragma sets maximum data ram of the device. Currently is not
119 used at all, but it may be useful in the future when devices with external
120 memory will be supported.
121 Syntax:
122 #pragma maxram [max_address]
123
124
125 4. Internal compiler functions
126 Internal SDCC functions like, __fsmul, etc... are currently supported by the
127 port, but the libraries for the pic16 port are not yet ready. So one cannot
128 use long and float variables.
129
130
131 5. Special Function Registers (SFRs)
132 The processor SFRs are not anymore declared in any header file. The user can
133 define by himself all the needed SFR's. The code to that is:
134
135 sfr at [sfr_address] [sfr_name];
136
137 Where sfr_address is the SFR address in the data ram, and sfr_name is the
138 name of the SFR. i.e.:
139
140 sfr at 0xf80 PORTA;