3 A random set of notes about sdcc and how it works.
7 Adding memory maps for AVR, setup default map for
8 local & global variables in port.h will be initialised
9 by the _<port>_finaliseOptions() [good functions]..some
10 kludges remain because of the "overlay" segment for 8051.
12 The memory segment stuff will have to be made more flexible.
13 Currently there does not seem to be a 1-to-1 correspondence
14 between storage class & memory map. (should there be??).
16 Also Added check for memory map in SDCCmem.c allocLocal
17 and allocglobal for "eeprom" memory space (AVR).
23 Tracing parmBytes and function calls.
26 void printf(const char *format);
28 void puts(const char *s)
33 Generates the pseudo-code:
37 pop l (not hl - so parmBytes is too small)
39 parmBytes for a function call seems to be setup in geniCodeCall in
43 * Takes care of calls with side effects (?)
44 * Generates the icode to push the parameters (this also computes the
46 * Generates a CALL or PCALL depending on if its a function or pointer to.
48 * Adds the code for the call to the chain.
50 My bug is probably in geniCodeParms - it's probably computing the
51 size of pointers wrong.
54 * A 'parm' node causes this to be run on the tree branches.
55 * It switches on the stack mode and sendto mode, and adds the
56 instructions required to push or put.
57 * A push adds the result of 'getSize' to the stack size.
59 So the bug is probably in getSize. 's' is not an aggregate, so the
62 It seems that IS_SPEC() is being set, deferencing *s so that it's size
63 is sizeof(char) == 1. It's either a SPECIFIER or a DECLARATOR - seems that
64 were the wrong way around. This is set in SDCCsymt.c, SDCCval.c, and the
65 yacc file. SDCCsymt.c and SDCCval.c havnt really changed in 5 days - must
66 be SDCC.y. Nope, no changes. diff against 5 days ago shows only intersting
67 changes are in SDCCicode. Same with -14 days.
71 Next bug is global function parameters not being pushed correctly. i.e
77 printf("Counter is %u\n", counter);
89 printf("Counter is %u\n", &counter);
91 First looking in SDCCicode.c for the stuff that generates function calls:
92 Probably a bug in geniCodeParams.
93 Nope, a bug in my stuff :)