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