From: frief Date: Sun, 8 Oct 2006 21:38:17 +0000 (+0000) Subject: * doc/sdccman.lyx: added to the manual X-Git-Url: https://git.gag.com/?p=fw%2Fsdcc;a=commitdiff_plain;h=28321c04c7b87986fb0bd9f971e9af68591b71c2 * doc/sdccman.lyx: added to the manual * doc/figures/ddd_example.png: added (neither pdflatex nor most browsers seem to like the .eps file) git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4404 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- diff --git a/ChangeLog b/ChangeLog index 56a0ceaa..ee1638e9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-10-08 Frieder Ferlemann + + * doc/sdccman.lyx: added to the manual + * doc/figures/ddd_example.png: added (neither pdflatex nor + most browsers seem to like the .eps file) + 2006-10-06 Bernhard Held * src/SDCCglue.c (tempfileandname): changed un*x tmp search paths diff --git a/doc/figures/ddd_example.png b/doc/figures/ddd_example.png new file mode 100644 index 00000000..bd14e6d8 Binary files /dev/null and b/doc/figures/ddd_example.png differ diff --git a/doc/sdccman.lyx b/doc/sdccman.lyx index a6d2c352..d1eb77e5 100644 --- a/doc/sdccman.lyx +++ b/doc/sdccman.lyx @@ -7,7 +7,7 @@ pdftitle={SDCC Compiler User Guide}, pdfauthor={SDCC development team}, pdfsubject={installation, user manual}, - pdfkeywords={68hc08 8032 8051 ansi c compiler CPU DS390 embedded free Freescale GPL HC08 Intel manual Maxim mcs51 Microchip microcontroller open source PIC Z80 Zilog}, + pdfkeywords={68hc08 8032 8051 ansi c compiler assembler CPU DS390 embedded development free Floating Point Arithmetic Freescale GPL HC08 inline Intel ISO/IEC 9899:1990 Linux MAC OS X manual Maxim mcs51 Microchip microcontroller open source PIC Unix Windows Z80 Zilog}, pdfpagemode=UseOutlines, colorlinks=true, linkcolor=blue] {hyperref} @@ -578,8 +578,7 @@ status Collapsed \newline SDCC also comes with a companion source level debugger SDCDB, the debugger - currently uses ucSim a freeware simulator for 8051 and other micro-controllers. - + currently uses ucSim a freeware simulator for 8051 and other micro-controllers.< \newline \newline @@ -722,8 +721,24 @@ the default directory for gcc-builds where include, library and documentation files are stored is now in /usr/local/share. \layout Itemize -char type parameters to vararg functions are casted to int unless explicitly - casted, e.g.: +char type parameters to vararg +\begin_inset LatexCommand \index{vararg, va\_arg} + +\end_inset + + functions are casted to int unless explicitly casted +\begin_inset Marginal +collapsed true + +\layout Standard + + +\series bold +\SpecialChar ~ +! +\end_inset + +, e.g.: \newline \family typewriter @@ -824,9 +839,14 @@ bit b; \newline \SpecialChar ~ \SpecialChar ~ -b = ~b; /* equivalent to b=1 instead of toggling b */ +b = ~ +\begin_inset LatexCommand \index{\~\/ Operator} + +\end_inset + +b; /* equivalent to b=1 instead of toggling b */ \begin_inset Marginal -collapsed false +collapsed true \layout Standard @@ -953,12 +973,12 @@ For most users it is sufficient to skip to either section \end_inset - or section + (Unix) or section \begin_inset LatexCommand \ref{sub:Windows-Install} \end_inset -. + (Windows). More detailed instructions follow below. \layout Section @@ -4047,6 +4067,11 @@ x). \layout Section Reading the Documentation +\begin_inset LatexCommand \index{Documentation} + +\end_inset + + \layout Standard Currently reading the document in pdf format is recommended, as for unknown @@ -4897,7 +4922,7 @@ sourcefile.adb - An intermediate file containing debug information needed to create the .cdb file (with - \begin_inset ERT -status Open +status Collapsed \layout Standard @@ -5021,6 +5046,87 @@ Anatomy of the compiler ). \layout Subsection +Postprocessing the Intel Hex +\begin_inset LatexCommand \index{Intel hex format} + +\end_inset + + file +\layout Standard + +The Intel Hex file +\begin_inset LatexCommand \index{.ihx} + +\end_inset + + which is generated by SDCC might include lines of varying length and the + addresses within the file are not guaranteed to be strictly ascending. + If your toolchain or a bootloader does not like this you can use the tool + +\family typewriter +packihx +\family default + +\begin_inset LatexCommand \index{packihx (tool)} + +\end_inset + + which is part of the SDCC distribution: +\newline + +\newline + +\family sans +\series bold + packihx sourcefile.ihx >sourcefile.hex +\family default +\series default + +\newline + +\newline +The separately available +\emph on + srecord +\emph default + +\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)} + +\end_inset + + package additionally allows to set undefined locations to a predefined + value, to insert checksums of various flavours (crc, add, xor) and to perform + other manipulations (convert, split, crop, offset, ...). + +\newline + +\newline + +\family sans +\series bold +srec_cat\SpecialChar ~ +\SpecialChar ~ +sourcefile.ihx -intel\SpecialChar ~ +\SpecialChar ~ +\SpecialChar ~ +-fill 0xff 0x0000 0x8000\SpecialChar ~ +\SpecialChar ~ +\SpecialChar ~ +-o sourcefile.hex -intel +\newline + +\newline + +\family default +\series default +The srecord package is available at +\begin_inset LatexCommand \url{http://sf.net/projects/srecord} + +\end_inset + + . +\layout Subsection + Projects with Multiple Source Files \layout Standard @@ -5469,10 +5575,10 @@ __mulint \newline \layout Standard - +\added_space_bottom bigskip If the source files are compiled using - \begin_inset ERT -status Open +status Collapsed \layout Standard @@ -5716,7 +5822,7 @@ p16f627 p16f628 p16f84 p16f873 p16f877? processor (Not maintained, not complete). \layout List -\labelwidthstring 00.00.0000 +\added_space_bottom bigskip \labelwidthstring 00.00.0000 \series bold @@ -5932,7 +6038,7 @@ file"'. Like `-dD' except that the macro arguments and contents are omitted. Only `#define name' is included in the output. \layout List -\labelwidthstring 00.00.0000 +\added_space_bottom bigskip \labelwidthstring 00.00.0000 \series bold @@ -6249,7 +6355,12 @@ status Collapsed \end_inset - is placed after the pdata segment. + is placed after the pdata +\begin_inset LatexCommand \index{pdata (mcs51, ds390 storage class)} + +\end_inset + + segment. Using this option the xstack can be placed anywhere in the external memory space of the 8051. The value entered can be in Hexadecimal or Decimal format, e.g. @@ -6514,6 +6625,11 @@ status Collapsed \end_inset +\begin_inset LatexCommand \index{HC08!Options!-\/-out-fmt-elf} + +\end_inset + + \bar under \series default @@ -6524,9 +6640,14 @@ The linker output (final object code) is in ELF format \end_inset . - (Currently only supported for the HC08 processors) + (Currently only supported for the HC08 +\begin_inset LatexCommand \index{HC08} + +\end_inset + + processors) \layout List -\labelwidthstring 00.00.0000 +\added_space_bottom bigskip \labelwidthstring 00.00.0000 \series bold @@ -6540,7 +6661,23 @@ linkOption[,linkOption] ... Pass the linkOption to the linker. - See file sdcc/as/doc/asxhtm.html for more on linker options. + If a bootloader is used an option like +\begin_inset Quotes sld +\end_inset + +-Wl\SpecialChar ~ +-bCSEG=0x1000 +\begin_inset Quotes srd +\end_inset + + would be typical to set the start of the code segment. + See also #pragma constseg and #pragma codeseg in section +\begin_inset LatexCommand \ref{sec:Pragmas} + +\end_inset + + . + File sdcc/as/doc/asxhtm.html has more on linker options. \layout Subsection MCS51 Options @@ -6660,8 +6797,13 @@ status Collapsed \series default - Uses a pseudo stack in the first 256 bytes in the external ram for allocating - variables and passing parameters. + Uses a pseudo stack in the pdata +\begin_inset LatexCommand \index{pdata (mcs51, ds390 storage class)} + +\end_inset + + area (usually the first 256 bytes in the external ram) for allocating variables + and passing parameters. See section \begin_inset LatexCommand \ref{sub:External-Stack} @@ -6795,7 +6937,7 @@ status Collapsed data, idata and stack together. This is the default now. \layout List -\labelwidthstring 00.00.0000 +\added_space_bottom bigskip \labelwidthstring 00.00.0000 \series bold @@ -6826,7 +6968,7 @@ DS390 / DS400 Options \end_inset -\begin_inset LatexCommand \index{DS390 options} +\begin_inset LatexCommand \index{DS390} \end_inset @@ -6849,7 +6991,7 @@ status Collapsed -model-flat24 \series default -\begin_inset LatexCommand \index{-\/-model-flat24} +\begin_inset LatexCommand \index{DS390!Options!-\/-model-flat24} \end_inset @@ -6883,7 +7025,7 @@ status Collapsed \end_inset -protect-sp-update -\begin_inset LatexCommand \index{-\/-protect-sp-update} +\begin_inset LatexCommand \index{DS390!Options!-\/-protect-sp-update} \end_inset @@ -6908,7 +7050,7 @@ status Collapsed -stack-10bit \series default -\begin_inset LatexCommand \index{-\/-stack-10bit} +\begin_inset LatexCommand \index{DS390!Options!-\/-stack-10bit} \end_inset @@ -7003,7 +7145,7 @@ status Collapsed \end_inset -stack-probe -\begin_inset LatexCommand \index{-\/-stack-probe} +\begin_inset LatexCommand \index{DS390!Options!-\/-stack-probe} \end_inset @@ -7026,7 +7168,7 @@ status Collapsed \end_inset -tini-libid -\begin_inset LatexCommand \index{-\/-tini-libid} +\begin_inset LatexCommand \index{DS390!Options!-\/-tini-libid} \end_inset @@ -7035,7 +7177,7 @@ status Collapsed LibraryID used in -mTININative. \layout List -\labelwidthstring 00.00.0000 +\added_space_bottom bigskip \labelwidthstring 00.00.0000 \series bold @@ -7050,7 +7192,7 @@ status Collapsed \end_inset -use-accelerator -\begin_inset LatexCommand \index{-\/-use-accelerator} +\begin_inset LatexCommand \index{DS390!Options!-\/-use-accelerator} \end_inset @@ -7066,7 +7208,7 @@ Z80 Options \end_inset -\begin_inset LatexCommand \index{Z80 options} +\begin_inset LatexCommand \index{Z80} \end_inset @@ -7089,7 +7231,7 @@ status Collapsed -callee-saves-bc \series default -\begin_inset LatexCommand \index{-\/-callee-saves-bc} +\begin_inset LatexCommand \index{Z80!Options!-\/-callee-saves-bc} \end_inset @@ -7101,7 +7243,7 @@ status Collapsed \emph default Force a called function to always save BC. \layout List -\labelwidthstring 00.00.0000 +\added_space_bottom bigskip \labelwidthstring 00.00.0000 \series bold @@ -7118,7 +7260,7 @@ status Collapsed -no-std-crt0 \series default -\begin_inset LatexCommand \index{-\/-no-std-crt0} +\begin_inset LatexCommand \index{Z80!Options!-\/-no-std-crt0} \end_inset @@ -7525,7 +7667,7 @@ status Collapsed The compiler will optimize code generation towards fast code, possibly at the expense of code size. \layout List -\labelwidthstring 00.00.0000 +\added_space_bottom bigskip \labelwidthstring 00.00.0000 \series bold @@ -7948,8 +8090,8 @@ status Collapsed \series default This option can be used if the code generated is called by a monitor program or if the main routine includes an endless loop. - This option might result in slightly smaller code and save two bytes of - stack space. + This option results in slightly smaller code and saves two bytes of stack + space. The return from the 'main' \begin_inset LatexCommand \index{main return} @@ -8220,6 +8362,8 @@ status Collapsed \series default Display errors and warnings using MSVC style, so you can use SDCC with visual studio. + With SDCC both offering a GCC-like (the default) and a MSVC-like output + style, integration into most programming editors should be straightforward. \layout List \labelwidthstring 00.00.0000 @@ -8434,7 +8578,7 @@ status Collapsed Can be used for instance when using bank switching to put the const data in a bank. \layout List -\labelwidthstring 00.00.0000 +\added_space_bottom bigskip \labelwidthstring 00.00.0000 \series bold @@ -8820,7 +8964,7 @@ status Collapsed \series default Will create a dump of the live ranges of iTemp's \layout List -\labelwidthstring 00.00.0000 +\added_space_bottom bigskip \labelwidthstring 00.00.0000 \series bold @@ -8851,7 +8995,7 @@ Will cause all the above mentioned dumps to be created. Redirecting output on Windows Shells \layout Standard - +\added_space_bottom bigskip By default SDCC writes it's error messages to \begin_inset Quotes sld \end_inset @@ -9094,7 +9238,7 @@ Search Paths .. \layout Standard - +\added_space_bottom bigskip There are some more environment variables recognized by SDCC, but these are solely used for debugging purposes. They can change or disappear very quickly, and will never be documented. @@ -9616,6 +9760,11 @@ sfr \end_inset +\begin_inset LatexCommand \index{sbit} + +\end_inset + + \layout Standard Like the bit keyword, @@ -9710,6 +9859,61 @@ sfr32. \emph default Allthough SDCC usually accesses them Least Significant Byte (LSB) first, this is not guaranteed. +\newline + +\layout Standard + +Please note, if you use a header file which was written for another compiler + then the sfr / sfr16 / sfr32 / sbit Storage Class extensions will most + likely be +\emph on +not +\emph default +compatible. + Specifically the syntax +\family typewriter +\SpecialChar ~ +sfr P0 = 0x80;\SpecialChar ~ + +\family default + is compiled +\emph on +without warning +\emph default + by SDCC to an assignment of 0x80 to a variable called P0 +\family typewriter + +\begin_inset Marginal +collapsed true + +\layout Standard + + +\series bold +\SpecialChar ~ +! +\end_inset + +. + +\family default +Nevertheless it is possible to write header files +\begin_inset LatexCommand \index{Header files} + +\end_inset + + +\begin_inset LatexCommand \index{Include files} + +\end_inset + + which can be shared among different compilers (see section +\begin_inset LatexCommand \ref{sec:Porting-code-to-other-compilers} + +\end_inset + +). + \layout Subsubsection Pointers @@ -9763,10 +9967,15 @@ __code unsigned char * __code p; \newline \newline -/* the following is a generic pointer physically located in xdata space - */ +/* generic pointer physically located in xdata space */ +\newline +unsigned char * __xdata p; +\newline + +\newline +/* generic pointer physically located in default memory space */ \newline -char * __xdata p; +unsigned char * p; \newline \newline @@ -10106,7 +10315,7 @@ status Collapsed If in doubt, don't specify any options and see if the resulting memory layout is appropriate, then you can adjust it. \layout Standard - +\added_space_bottom bigskip The linker generates two files with memory allocation information. The first, with extension .map \begin_inset LatexCommand \index{.map} @@ -10129,7 +10338,7 @@ The linker generates two files with memory allocation information. \layout Subsection Z80/Z180 Storage Class -\begin_inset LatexCommand \index{Storage class} +\begin_inset LatexCommand \index{Z80!Storage class} \end_inset @@ -10166,6 +10375,16 @@ utput memory. I/O memory \begin_inset LatexCommand \index{I/O memory (Z80, Z180)} +\end_inset + + +\begin_inset LatexCommand \index{Z80!I/O memory} + +\end_inset + + +\begin_inset LatexCommand \index{Z180!I/O memory} + \end_inset is accessed with special instructions, e.g.: @@ -10279,13 +10498,13 @@ sfr \end_inset /HD64180 -\begin_inset LatexCommand \index{HD64180} +\begin_inset LatexCommand \index{HD64180 (see Z180)} \end_inset ) \layout Standard - +\added_space_bottom bigskip The compiler option - \begin_inset ERT status Collapsed @@ -10296,9 +10515,14 @@ status Collapsed / \end_inset --portmode=180 (80) and a compiler #pragma\SpecialChar ~ +-portmode +\begin_inset LatexCommand \index{Z180!Options!-\/-portmode} + +\end_inset + +=180 (80) and a compiler #pragma\SpecialChar ~ portmode -\begin_inset LatexCommand \index{\#pragma portmode} +\begin_inset LatexCommand \index{Z180!Pragmas!\#pragma portmode} \end_inset @@ -10316,7 +10540,7 @@ in/out \layout Subsection HC08 Storage Class -\begin_inset LatexCommand \index{Storage class} +\begin_inset LatexCommand \index{HC08!Storage class} \end_inset @@ -10338,8 +10562,12 @@ data The data storage class declares a variable that resides in the first 256 bytes of memory (the direct page). - The HC08 is most efficient at accessing variables (especially pointers) - stored here. + The HC08 +\begin_inset LatexCommand \index{HC08} + +\end_inset + + is most efficient at accessing variables (especially pointers) stored here. \layout Subsubsection xdata @@ -10354,7 +10582,7 @@ xdata \layout Standard - +\added_space_bottom bigskip The xdata storage class declares a variable that can reside anywhere in memory. This is the default if no storage class is specified. @@ -10408,10 +10636,10 @@ xdata \end_inset - (0x7ffe) unsigned int chksum; + 0x7ffe unsigned int chksum; \layout Standard -or +or, better conforming to ISO/IEC 9899 C: \layout Verse @@ -10772,7 +11000,7 @@ __bit \SpecialChar ~ /* I/O port 1, bit 2 */ \layout Standard - +\added_space_bottom bigskip and you can use the same hardware dependent routine without changes, as for example in a library. This is somehow similar to sbit, but only one absolute address has to be @@ -11023,8 +11251,12 @@ Parameters It is however allowed to use bit parameters in reentrant functions and also non-static local bit variables are supported. Efficient use is limited to 8 semi-bitregisters in bit space. - They are pushed and popped to stack as a single byte just like the normal - registers. + They are pushed and popped to stack +\begin_inset LatexCommand \index{stack} + +\end_inset + + as a single byte just like the normal registers. \layout Section Overlaying @@ -11174,7 +11406,7 @@ set_error(10); \newline } \layout Standard - +\added_space_bottom bigskip In the above example the parameter \emph on errcd @@ -11472,7 +11704,7 @@ status Collapsed being aware of it. \layout Standard - +\added_space_bottom bigskip Calling other functions from an interrupt service routine is not recommended, avoid it if possible. Note that when some function is called from an interrupt service routine @@ -11794,7 +12026,7 @@ using This scheme may be advantageous for small interrupt service routines which have low register usage. \layout Standard - +\added_space_bottom bigskip If the interrupt service routine is defined to be using a specific register bank then only \emph on @@ -11802,16 +12034,31 @@ a, b, dptr \emph default & psw are saved and restored, if such an interrupt service routine calls another function (using another register bank) then the entire register - bank of the called function will be saved on the stack. + bank of the called function will be saved on the stack +\begin_inset LatexCommand \index{stack} + +\end_inset + +. This scheme is recommended for larger interrupt service routines. \layout Subsection -HC08 Interrupt Service Routines +HC08 +\begin_inset LatexCommand \index{HC08} + +\end_inset + + Interrupt Service Routines \layout Standard +\added_space_bottom bigskip +Since the number of interrupts +\begin_inset LatexCommand \index{HC08!interrupt} + +\end_inset -Since the number of interrupts available is chip specific and the interrupt - vector table always ends at the last byte of memory, the interrupt numbers - corresponds to the interrupt vectors in reverse order of address. + available is chip specific and the interrupt vector table always ends at + the last byte of memory, the interrupt numbers corresponds to the interrupt + vectors in reverse order of address. For example, interrupt 1 will use the interrupt vector at 0xfffc, interrupt 2 will use the interrupt vector at 0xfffa, and so on. However, interrupt 0 (the reset vector at 0xfffe) is not redefinable in @@ -11826,7 +12073,16 @@ Since the number of interrupts available is chip specific and the interrupt Z80 Interrupt Service Routines \layout Standard -The Z80 uses several different methods for determining the correct interrupt +The Z80 +\begin_inset LatexCommand \index{Z80} + +\end_inset + + uses several different methods for determining the correct interrupt +\begin_inset LatexCommand \index{Z80!interrupt} + +\end_inset + vector depending on the hardware implementation. Therefore, SDCC ignores the optional interrupt number and does not attempt to generate an interrupt vector table. @@ -11857,7 +12113,7 @@ void nmi_isr (void) critical interrupt \newline } \layout Standard - +\added_space_bottom bigskip However if you need to create a non-interruptable interrupt service routine you would also require the \emph on @@ -12098,7 +12354,12 @@ On other architectures which have seperate opcodes for enabling and disabling \end_inset - (HC08): + (HC08 +\begin_inset LatexCommand \index{HC08!interrupt} + +\end_inset + +): \layout Verse @@ -12372,7 +12633,23 @@ possible exception: if a function is called ONLY from 'interrupt' functions \newline \emph on -(pending: I don't think this has been done yet) +(pending: Note, nowadays the +\emph default +using +\emph on + attribute has an effect on +\emph default + +\emph on +the generated code for a +\emph default +non-interrupt +\emph on + function +\emph default +. +\emph on +) \layout Standard An @@ -12412,7 +12689,7 @@ used own: I suggest using the default bank zero and taking the small performance hit. \layout Standard - +\added_space_bottom bigskip It is most efficient if your ISR calls no other functions. If your ISR must call other functions, it is most efficient if those functions use the same bank as the ISR (see note 1 below); the next best is if the @@ -12480,7 +12757,12 @@ _sdcc_external_startup() \end_inset memory has to be explicitly enabled before it can be accessed or if the - watchdog needs to be disabled, this is the place to do it. + watchdog +\begin_inset LatexCommand \index{watchdog} + +\end_inset + + needs to be disabled, this is the place to do it. The startup code clears all internal data memory, 256 bytes by default, but from 0 to n-1 if \emph on @@ -12504,8 +12786,8 @@ n is used. (recommended for Chipcon CC1010). \layout Standard - -See also the compiler option +\added_space_bottom bigskip +See also the compiler options \emph on - \begin_inset ERT @@ -12528,7 +12810,26 @@ opt \end_inset - and section +, +\emph on +- +\begin_inset ERT +status Collapsed + +\layout Standard + +\backslash +/ +\end_inset + +-main-return +\emph default + +\begin_inset LatexCommand \index{-\/-main-return} + +\end_inset + +and section \begin_inset LatexCommand \ref{sub:MCS51-variants} \end_inset @@ -12539,15 +12840,25 @@ about MCS51-variants. HC08 Startup Code \layout Standard +\added_space_bottom bigskip +The HC08 +\begin_inset LatexCommand \index{HC08} -The HC08 startup code follows the same scheme as the MCS51 startup code. +\end_inset + + startup code follows the same scheme as the MCS51 startup code. \layout Subsection Z80 Startup Code \layout Standard +\added_space_bottom bigskip +On the Z80 +\begin_inset LatexCommand \index{Z80} + +\end_inset -On the Z80 the startup code is inserted by linking with crt0.o which is generated - from sdcc/device/lib/z80/crt0.s. + the startup code is inserted by linking with crt0.o which is generated from + sdcc/device/lib/z80/crt0.s. If you need a different startup code you can use the compiler option \emph on - @@ -12659,7 +12970,7 @@ needed to integer */ \begin_inset Marginal -collapsed false +collapsed true \layout Standard @@ -12765,7 +13076,22 @@ mov\SpecialChar ~ \SpecialChar ~ r2,dpl \newline -;buffer.c if( head != (unsigned char)(tail-1) ) +;buffer.c if( head != (unsigned char)(tail-1) ) \SpecialChar ~ +/* cast +\series bold +needed +\series default + to avoid promotion +\begin_inset LatexCommand \index{promotion to signed int} + +\end_inset + + +\begin_inset LatexCommand \index{type promotion} + +\end_inset + + to integer */ \newline \SpecialChar ~ \SpecialChar ~ @@ -13167,13 +13493,8 @@ _endasm \layout Standard The inline assembler code can contain any valid code understood by the assembler -, this includes any assembler directives and comment lines -\begin_inset Foot -collapsed false - -\layout Standard - -The assembler does not like some characters like ':' or ''' in comments. +, this includes any assembler directives and comment lines. + The assembler does not like some characters like ':' or ''' in comments. You'll find an 100+ pages assembler manual in sdcc/as/doc/asxhtm.html \begin_inset LatexCommand \index{asXXXX (as-gbz80, as-hc08, asx8051, as-z80)} @@ -13184,11 +13505,16 @@ The assembler does not like some characters like ':' or ''' in comments. \end_inset + or online at +\begin_inset LatexCommand \url{http://svn.sourceforge.net/viewvc/*checkout*/sdcc/trunk/sdcc/as/doc/asxhtm.html} \end_inset +\SpecialChar ~ . - The compiler does not do any validation of the code within the +\layout Standard + +The compiler does not do any validation of the code within the \family typewriter _asm \begin_inset LatexCommand \index{\_asm} @@ -13427,12 +13753,16 @@ For an 8051 target, the generated simpleInterrupt looks like: \family typewriter Note, this is an -\series bold +\emph on outdated -\series default +\emph default example, recent versions of SDCC generate \newline -the same code for simpleInterrupt() and nakedInterrupt()! +the +\emph on +same +\emph default + code for simpleInterrupt() and nakedInterrupt()! \newline \newline @@ -14275,7 +14605,7 @@ pop _bp \SpecialChar ~ ret \layout Standard - +\added_space_bottom bigskip The compiling and linking procedure remains the same, however note the extra entry & exit linkage required for the assembler code, _bp is the stack frame pointer and is used to compute the offset into the stack for parameters @@ -14591,9 +14921,9 @@ Floating Point Support \layout Standard -SDCC supports IEEE (single precision 4 bytes) floating point numbers.The - floating point support routines are derived from gcc's floatlib.c and consist - of the following routines: +SDCC supports IEEE (single precision 4 bytes) floating point numbers. + The floating point support routines are derived from gcc's floatlib.c and + consist of the following routines: \newline \layout Standard @@ -15226,7 +15556,7 @@ convert long to floating point number \newline \layout Standard - +\added_space_bottom bigskip These support routines are developed in ANSI-C so there is room for space and speed improvement \begin_inset Foot @@ -15577,7 +15907,9 @@ C, CAN, Ethernet, Profibus, Modbus, USB, SPI, JTAG ...), Media (IDE, Memory \SpecialChar ~ would certainly like to hear about it. - Programmers coding for embedded systems are not especially famous for being +\layout Standard +\added_space_bottom bigskip +Programmers coding for embedded systems are not especially famous for being enthusiastic, so don't expect a big hurray but as the mailing list is searchabl e these references are very valuable. Let's help to create a climate where information is shared. @@ -15834,6 +16166,11 @@ status Collapsed \layout Section Pragmas +\begin_inset LatexCommand \label{sec:Pragmas} + +\end_inset + + \begin_inset LatexCommand \index{Pragmas} \end_inset @@ -15844,17 +16181,25 @@ Pragmas SDCC supports the following #pragma directives: \layout Itemize + +\series bold save +\series default + \begin_inset LatexCommand \index{\#pragma save} \end_inset - - this will save all current options to the save/restore stack. + - this will save most current options to the save/restore stack. See #pragma\SpecialChar ~ restore. \layout Itemize + +\series bold restore +\series default + \begin_inset LatexCommand \index{\#pragma restore} \end_inset @@ -15869,7 +16214,11 @@ save. \layout Itemize + +\series bold callee_saves +\series default + \begin_inset LatexCommand \index{\#pragma callee\_saves} \end_inset @@ -15915,7 +16264,11 @@ callee_saves is appended to the list of functions specified in the command line. \layout Itemize + +\series bold exclude +\series default + \begin_inset LatexCommand \index{\#pragma exclude} \end_inset @@ -15967,7 +16320,11 @@ none . \layout Itemize + +\series bold less_pedantic +\series default + \begin_inset LatexCommand \index{\#pragma less\_pedantic} \end_inset @@ -15976,7 +16333,11 @@ less_pedantic your own now ;-( \layout Itemize -disable_warning + +\series bold +disable_warning +\series default + \begin_inset LatexCommand \index{\#pragma disable\_warning} \end_inset @@ -15984,7 +16345,11 @@ disable_warning - the compiler will not warn you anymore about warning number . \layout Itemize + +\series bold nogcse +\series default + \begin_inset LatexCommand \index{\#pragma nogcse} \end_inset @@ -15992,7 +16357,11 @@ nogcse - will stop global common subexpression elimination. \layout Itemize + +\series bold noinduction +\series default + \begin_inset LatexCommand \index{\#pragma noinduction} \end_inset @@ -16000,7 +16369,11 @@ noinduction - will stop loop induction optimizations. \layout Itemize + +\series bold noinvariant +\series default + \begin_inset LatexCommand \index{\#pragma noinvariant} \end_inset @@ -16014,7 +16387,11 @@ noinvariant . \layout Itemize + +\series bold noiv +\series default + \begin_inset LatexCommand \index{\#pragma noiv} \end_inset @@ -16039,7 +16416,11 @@ noiv about interrupts. \layout Itemize + +\series bold nojtbound +\series default + \begin_inset LatexCommand \index{\#pragma nojtbound} \end_inset @@ -16054,7 +16435,11 @@ nojtbound . \layout Itemize + +\series bold noloopreverse +\series default + \begin_inset LatexCommand \index{\#pragma noloopreverse} \end_inset @@ -16062,7 +16447,11 @@ noloopreverse - Will not do loop reversal optimization \layout Itemize + +\series bold nooverlay +\series default + \begin_inset LatexCommand \index{\#pragma nooverlay} \end_inset @@ -16071,7 +16460,11 @@ nooverlay function. \layout Itemize + +\series bold stackauto +\series default + \begin_inset LatexCommand \index{\#pragma stackauto} \end_inset @@ -16099,25 +16492,39 @@ status Collapsed Parameters and Local Variables. \layout Itemize -opt_code_speed + +\series bold +opt_code_speed +\series default + \begin_inset LatexCommand \index{\#pragma opt\_code\_speed} \end_inset - The compiler will optimize code generation towards fast code, possibly at the expense of code size. + Currently this has little effect. \layout Itemize -opt_code_size + +\series bold +opt_code_size +\series default + \begin_inset LatexCommand \index{\#pragma opt\_code\_size} \end_inset - The compiler will optimize code generation towards compact code, possibly at the expense of code speed. + Currently this has little effect. \layout Itemize -opt_code_balanced + +\series bold +opt_code_balanced +\series default + \begin_inset LatexCommand \index{\#pragma opt\_code\_balanced} \end_inset @@ -16128,7 +16535,11 @@ opt_code_balanced \layout Itemize -std_sdcc89 + +\series bold +std_sdcc89 +\series default + \begin_inset LatexCommand \index{\#pragma std\_sdcc89} \end_inset @@ -16137,7 +16548,11 @@ std_sdcc89 with the standard (default). \layout Itemize -std_c89 + +\series bold +std_c89 +\series default + \begin_inset LatexCommand \index{\#pragma std\_c89} \end_inset @@ -16146,7 +16561,11 @@ std_c89 standard. \layout Itemize -std_sdcc99 + +\series bold +std_sdcc99 +\series default + \begin_inset LatexCommand \index{\#pragma std\_sdcc99} \end_inset @@ -16155,7 +16574,11 @@ std_sdcc99 with the standard (incomplete support). \layout Itemize -std_c99 + +\series bold +std_c99 +\series default + \begin_inset LatexCommand \index{\#pragma std\_c99} \end_inset @@ -16164,7 +16587,11 @@ std_c99 standard (incomplete support). \layout Itemize -codeseg + +\series bold +codeseg +\series default + \begin_inset LatexCommand \index{\#pragma codeseg} \end_inset @@ -16184,7 +16611,11 @@ status Collapsed -codeseg. \layout Itemize -constseg + +\series bold +constseg +\series default + \begin_inset LatexCommand \index{\#pragma constseg} \end_inset @@ -16204,10 +16635,19 @@ status Collapsed -constseg. \layout Standard -SDCPP supports the following #pragma directives: +The preprocessor SDCPP +\begin_inset LatexCommand \index{SDCPP (preprocessor)} + +\end_inset + + supports the following #pragma directives: \layout Itemize + +\series bold preproc_asm +\series default + \begin_inset LatexCommand \index{\#pragma preproc\_asm} \end_inset @@ -16818,17 +17258,17 @@ sfr \family typewriter -sfr at 0x92 _XPAGE; /* Cypress EZ-USB family */ +__sfr __at (0x92) _XPAGE; /* Cypress EZ-USB family */ \layout Verse \family typewriter -sfr at 0xaf _XPAGE; /* some Silicon Labs (Cygnal) chips */ +__sfr __at (0xaf) _XPAGE; /* some Silicon Labs (Cygnal) chips */ \layout Verse \family typewriter -sfr at 0xaa _XPAGE; /* some Silicon Labs (Cygnal) chips */ +__sfr __at (0xaa) _XPAGE; /* some Silicon Labs (Cygnal) chips */ \layout Standard For more exotic implementations further customizations may be needed. @@ -16842,7 +17282,7 @@ For more exotic implementations further customizations may be needed. Other Features available by SFR \layout Standard - +\added_space_bottom bigskip Some MCS51 variants offer features like Double DPTR \begin_inset LatexCommand \index{DPTR} @@ -16856,8 +17296,18 @@ Some MCS51 variants offer features like Double DPTR DS400 port \layout Standard +\added_space_bottom bigskip +The DS80C400 +\begin_inset LatexCommand \index{DS80C400} + +\end_inset + -The DS80C400 microcontroller has a rich set of peripherals. +\begin_inset LatexCommand \index{DS400} + +\end_inset + + microcontroller has a rich set of peripherals. In its built-in ROM library it includes functions to access some of the features, among them is a TCP stack with IP4 and IP6 support. Library headers (currently in beta status) and other files are provided @@ -16875,7 +17325,7 @@ The DS80C400 microcontroller has a rich set of peripherals. The Z80 and gbz80 port \layout Standard -SDCC can target both the Zilog +SDCC can target both the Zilog Z80 \begin_inset LatexCommand \index{Z80} \end_inset @@ -16899,11 +17349,11 @@ regressions tests variables and bitfield support is fine. See mailing lists and forums about interrupt routines. \layout Standard - +\added_space_bottom bigskip As always, the code is the authoritative reference - see z80/ralloc.c and z80/gen.c. The stack -\begin_inset LatexCommand \index{stack} +\begin_inset LatexCommand \index{Z80!stack} \end_inset @@ -16911,7 +17361,7 @@ As always, the code is the authoritative reference - see z80/ralloc.c and IX is used as the base pointer, HL and IY are used as a temporary registers, and BC and DE are available for holding variables. Return values -\begin_inset LatexCommand \index{return value} +\begin_inset LatexCommand \index{Z80!return value} \end_inset @@ -16924,7 +17374,7 @@ As always, the code is the authoritative reference - see z80/ralloc.c and The HC08 port \layout Standard - +\added_space_bottom bigskip The port to the Motorola HC08 \begin_inset LatexCommand \index{HC08} @@ -16936,12 +17386,8 @@ The port to the Motorola HC08 unoptimized. Some of the SDCC's standard C library functions have embedded non-HC08 inline assembly and so are not yet usable. -\newline - -\newline - \layout Section - +\pagebreak_top The PIC14 port \layout Standard @@ -17005,15 +17451,19 @@ For devices that have multiple code pages it is more efficient to use the Creating a device include file \layout Standard -For generating a device include file use the support perl script inc2h.pl - kept in directory support/script. +For generating a device include file +\begin_inset LatexCommand \index{PIC14!Header files} + +\end_inset + + use the support perl script inc2h.pl kept in directory support/script. \layout Subsection Interrupt code \layout Standard For the interrupt function, use the keyword 'interrupt' -\begin_inset LatexCommand \index{interrupt} +\begin_inset LatexCommand \index{PIC14!interrupt} \end_inset @@ -17183,7 +17633,12 @@ status Collapsed / \end_inset --debug-extra emit debug info in assembly output +-debug-extra +\begin_inset LatexCommand \index{PIC14!Options!-\/-debug-extra} + +\end_inset + + emit debug info in assembly output \layout List \labelwidthstring 00.00.0000 @@ -17197,7 +17652,12 @@ status Collapsed / \end_inset --no-pcode-opt disable (slightly faulty) optimization on pCode +-no-pcode-opt +\begin_inset LatexCommand \index{PIC14!Options!-\/-no-pcode-opt} + +\end_inset + + disable (slightly faulty) optimization on pCode \layout Subsection The library @@ -17244,7 +17704,12 @@ XXX \layout Standard This warning can usually be ignored due to the very good compatibility amongst - 14 bit PIC devices. + 14 bit PIC +\begin_inset LatexCommand \index{PIC14} + +\end_inset + + devices. \layout Standard You might also consider recompiling the library for your specific device @@ -17278,8 +17743,23 @@ main() not \series default be initialized. -\layout Section +\family typewriter +\size footnotesize + +\begin_inset Marginal +collapsed true + +\layout Standard + +\series bold +\SpecialChar ~ +! +\end_inset + + +\layout Section +\pagebreak_top The PIC16 \begin_inset LatexCommand \index{PIC16} @@ -17537,7 +18017,12 @@ status Collapsed / \end_inset --callee-saves See - +-callee-saves +\begin_inset LatexCommand \index{PIC16!Options!-\/-callee-saves} + +\end_inset + + See - \begin_inset ERT status Collapsed @@ -17561,7 +18046,12 @@ status Collapsed / \end_inset --all-callee-saves All function arguments are passed on stack by default. +-all-callee-saves +\begin_inset LatexCommand \index{PIC16!Options!-\/-all-callee-saves} + +\end_inset + + All function arguments are passed on stack by default. \emph on There is no need to specify this in the command line. @@ -17578,8 +18068,12 @@ status Collapsed / \end_inset --fommit-frame-pointer Frame pointer will be omitted when the function uses - no local variables. +-fommit-frame-pointer +\begin_inset LatexCommand \index{PIC16!Options!-\/-fommit-frame-pointer} + +\end_inset + + Frame pointer will be omitted when the function uses no local variables. \layout Subsection Port Specific Options @@ -17707,7 +18201,12 @@ status Collapsed / \end_inset --mplab-comp MPLAB compatibility option. +-mplab-comp MPLAB +\begin_inset LatexCommand \index{PIC16!MPLAB} + +\end_inset + + compatibility option. Currently only suppresses special gpasm directives. \layout Subsubsection @@ -18368,8 +18867,18 @@ PIC16 port currently supports the following pragmas: \layout List \labelwidthstring 00.00.0000 -stack pragma stack forces the code generator to initialize the stack & frame - pointers at a specific address. +stack +\begin_inset LatexCommand \index{PIC16!Pragmas!\#pragma stack} + +\end_inset + + pragma stack +\begin_inset LatexCommand \index{PIC16!stack} + +\end_inset + + forces the code generator to initialize the stack & frame pointers at a + specific address. This is an adhoc solution for cases where no STACK directive is available in the linker script or gplink is not instructed to create a stack section. \newline @@ -18433,7 +18942,12 @@ This pragma is deprecated. \layout List \labelwidthstring 00.00.0000 -code place a function symbol at static FLASH address +code +\begin_inset LatexCommand \index{PIC16!Pragmas!\#pragma code} + +\end_inset + + place a function symbol at static FLASH address \layout LyX-Code Example: @@ -18791,8 +19305,12 @@ Header Files \layout Standard -There is one main header file that can be included to the source files using - the pic16 port. +There is one main header file +\begin_inset LatexCommand \index{PIC16!Header files} + +\end_inset + + that can be included to the source files using the pic16 port. That file is the \series bold pic18fregs.h @@ -18814,7 +19332,12 @@ The specific microcontroller is selected within the pic18fregs.h automatically, Libraries \layout Standard -The libraries that PIC16 +The libraries +\begin_inset LatexCommand \index{PIC16!Libraries} + +\end_inset + + that PIC16 \begin_inset LatexCommand \index{PIC16} \end_inset @@ -19031,8 +19554,13 @@ The standard device libraries (see Stack \layout Standard -The stack implementation for the PIC16 port uses two indirect registers, - FSR1 and FSR2. +The stack +\begin_inset LatexCommand \index{PIC16!stack} + +\end_inset + + implementation for the PIC16 port uses two indirect registers, FSR1 and + FSR2. \layout List \labelwidthstring 00.00.0000 @@ -19200,7 +19728,12 @@ In addition to the standard SDCC function keywords, PIC16 port makes available \layout List \labelwidthstring 00.00.0000 -wparam Use the WREG to pass one byte of the first function argument. +wparam +\begin_inset LatexCommand \index{PIC16!wparam} + +\end_inset + + Use the WREG to pass one byte of the first function argument. This improves speed but you may not use this for functions with arguments that are called via function pointers, otherwise the first byte of the first parameter will get lost. @@ -19230,9 +19763,14 @@ This keyword replaces the deprecated wparam pragma. \layout List \labelwidthstring 00.00.0000 -shadowregs When entering/exiting an ISR, it is possible to take advantage - of the PIC18F hardware shadow registers which hold the values of WREG, - STATUS and BSR registers. +shadowregs +\begin_inset LatexCommand \index{PIC16!shadowregs} + +\end_inset + + When entering/exiting an ISR, it is possible to take advantage of the PIC18F + hardware shadow registers which hold the values of WREG, STATUS and BSR + registers. This can be done by adding the keyword \emph on shadowregs @@ -19396,7 +19934,12 @@ on stack, FSR0 points to the beginning Interrupts \layout Standard -An interrupt servive routine (ISR) is declared using the +An interrupt +\begin_inset LatexCommand \index{PIC16!interrupt} + +\end_inset + + service routine (ISR) is declared using the \emph on interrupt \emph default @@ -20921,7 +21464,12 @@ Here you can find some general tips for compiling programs with SDCC/pic16. Stack size \layout Standard -The default stack size (that is 64 bytes) probably is enough for many programs. +The default stack +\begin_inset LatexCommand \index{PIC16!stack} + +\end_inset + + size (that is 64 bytes) probably is enough for many programs. One must take care that when there are many levels of function nesting, or there is excessive usage of stack, its size should be extended. An example of such a case is the printf/sprintf family of functions. @@ -21081,7 +21629,7 @@ e. digital oscilloscope \emph default -\begin_inset LatexCommand \index{oscilloscope} +\begin_inset LatexCommand \index{Oscilloscope} \end_inset @@ -21580,13 +22128,26 @@ bmeps -c -e8f -p3 ddd_example.png >ddd_example.eps \layout Comment The screenshot was included in sdccman.lyx cvs version 1.120 but later removed - as this broke the build system on Sourceforge (pdf-file was broken). + as this broke the build system on Sourceforge (pdf-file was broken. + pdflatex does not accept eps files). \layout Standard -The .eps File -\size footnotesize +The +\emph on +p +\emph default +ortable +\emph on +n +\emph default +etwork +\emph on +g +\emph default +raphics File +\size footnotesize -\begin_inset LatexCommand \url{http://svn.sourceforge.net/viewcvs.cgi/*checkout*/sdcc/trunk/sdcc/doc/figures/ddd_example.eps} +\begin_inset LatexCommand \url{http://svn.sourceforge.net/viewcvs.cgi/*checkout*/sdcc/trunk/sdcc/doc/figures/ddd_example.png} \end_inset @@ -22510,6 +23071,18 @@ Use the smallest data type to represent your data-value. promoted to 'signed int' \begin_inset LatexCommand \index{promotion to signed int} +\end_inset + + +\begin_inset Marginal +collapsed true + +\layout Standard + + +\series bold +\SpecialChar ~ +! \end_inset before doing any operation. @@ -22598,6 +23171,8 @@ comp.lang.c FAQ : \layout Quote + +\emph on If well-defined overflow characteristics are important and negative values are not, or if you want to steer clear of sign-extension problems when manipulating bits or bytes, use one of the corresponding unsigned types. @@ -22702,18 +23277,40 @@ feeling \layout Section Porting code from or to other compilers +\begin_inset LatexCommand \label{sec:Porting-code-to-other-compilers} + +\end_inset + + \layout Itemize check whether endianness of the compilers differs and adapt where needed. \layout Itemize -check the device specific header files for compiler specific syntax. +check the device specific header files +\begin_inset LatexCommand \index{Header files} + +\end_inset + + +\begin_inset LatexCommand \index{Include files} + +\end_inset + + for compiler specific syntax. Eventually include the file to allow using common header files. + (see f.e. + cc2510fx.h +\begin_inset LatexCommand \url{http://svn.sourceforge.net/viewvc/sdcc/trunk/sdcc/device/include/mcs51/P89c51RD2.h?view=markup} + +\end_inset + +). \layout Itemize check whether the startup code contains the correct initialization (watchdog, @@ -22758,10 +23355,48 @@ check and convert compiler specific extensions (interrupts, memory areas, pragmas etc.). \layout Itemize -check for differences in type promotion (especially check for math operations - on char variables and for the use of the ~\SpecialChar ~ -operator on bit variables. - See +check for differences in type promotion. + Especially check for math operations on +\family typewriter +char +\family default + or +\family typewriter +unsigned char +\family default + variables. + For the sake of C99 compatibility SDCC will probably promote these to +\family typewriter +int +\family default + more often than other compilers. + Eventually insert explicit casts to +\family typewriter +(char) +\family default +or +\family typewriter + (unsigned char) +\family default +. + Also check that the ~\SpecialChar ~ +operator +\begin_inset LatexCommand \index{\~\/ Operator} + +\end_inset + + is not used on +\family typewriter +bit +\begin_inset LatexCommand \index{bit} + +\end_inset + + +\family default + variables, use the !\SpecialChar ~ +operator instead. + See sections \begin_inset LatexCommand \ref{type promotion} \end_inset @@ -22771,7 +23406,7 @@ operator on bit variables. \end_inset -). +. \layout Itemize check the assembly code generated for interrupt routines (f.e. @@ -22783,14 +23418,36 @@ check whether timing loops result in proper timing (or preferably consider \layout Itemize check for differences in printf parameters (some compilers push (va_arg -\begin_inset LatexCommand \index{va\_arg} +\begin_inset LatexCommand \index{vararg, va\_arg} \end_inset -) char variables as integers others as char). +) char variables as +\family typewriter +int +\family default + others push them as +\family typewriter +char +\family default +. + See section +\begin_inset LatexCommand \ref{sec:Compatibility-with-previous} + +\end_inset + +). \layout Itemize -check the resulting memory layout. +check the resulting memory map +\begin_inset LatexCommand \index{Memory map} + +\end_inset + +. + Usage of different memory spaces: code, stack, data (for mcs51/ds390 additional +ly idata, pdata, xdata). + Eventually check if unexpected library functions are included. \layout Section Tools @@ -22800,7 +23457,7 @@ Tools included in the distribution \layout Standard -\align center +\align left \begin_inset Tabular @@ -22874,7 +23531,17 @@ keil2sdcc.pl \layout Standard -header file conversion +header file +\begin_inset LatexCommand \index{Header files} + +\end_inset + + +\begin_inset LatexCommand \index{Include files} + +\end_inset + + conversion \end_inset @@ -23171,7 +23838,12 @@ packihx \layout Standard -ihx packer +Intel Hex packer +\begin_inset LatexCommand \index{packihx (tool)} + +\end_inset + + \end_inset @@ -23208,7 +23880,7 @@ Documentation included in the distribution \layout Standard -\align center +\align left \begin_inset Tabular @@ -23487,7 +24159,7 @@ Related open source tools \layout Standard -\align center +\align left \begin_inset Tabular @@ -23981,7 +24653,7 @@ Debugger, serves nicely as GUI to SDCDB Related documentation / recommended reading \layout Standard -\align center +\align left \begin_inset Tabular @@ -24258,6 +24930,298 @@ bookstore (very dedicated, probably read other books first) \newline +\layout Section + +Application notes specifically for SDCC +\layout Standard + +SDCC makes no claims about the completeness of this list and about up-to-datenes +s or correctness of the application notes +\begin_inset LatexCommand \index{Application notes} + +\end_inset + +. +\layout Standard +\align left + +\size footnotesize + +\begin_inset Tabular + + + + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Vendor +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Subject / Title +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Where to get +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Maxim / Dallas +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Using the SDCC Compiler for the DS80C400 +\begin_inset LatexCommand \index{DS80C400} + +\end_inset + + +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize + +\begin_inset LatexCommand \url{http://pdfserv.maxim-ic.com/en/an/AN3346.pdf} + +\end_inset + + +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Maxim / Dallas +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Using the Free SDCC C Compiler to Develop Firmware for the DS89C420/430/440/450 +\begin_inset LatexCommand \index{DS89C4x0} + +\end_inset + + Family of Microcontrollers +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize + +\begin_inset LatexCommand \url{http://pdfserv.maxim-ic.com/en/an/AN3477.pdf} + +\end_inset + + +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Silicon Laboratories / Cygnal +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Integrating SDCC 8051 Tools Into The Silicon Labs IDE +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize + +\begin_inset LatexCommand \url{http://www.silabs.com/public/documents/tpub_doc/anote/Microcontrollers/en/an198.pdf} + +\end_inset + + +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Ramtron / Goal Semiconductor +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Interfacing SDCC to Syn and Textpad +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize + +\begin_inset LatexCommand \url{http://www.goalsemi.com/TB_%20Interfacing%20SDCC%20to%20Syn%20and%20Textpad.pdf} + +\end_inset + + +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Ramtron / Goal Semiconductor +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Installing and Configuring SDCC and Crimson Editor +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize + +\begin_inset LatexCommand \url{http://www.ramtron.com/lib/mcusupporttools/TB100%20-%20How%20to%20Install%20and%20Configure%20the%20SDCC%20&%20Crimson%20Editor.pdf} + +\end_inset + + +\end_inset + + + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +Texas Instruments +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize +MSC12xx Programming with SDCC +\end_inset + + +\begin_inset Text + +\layout Standard + + +\size footnotesize + +\begin_inset LatexCommand \url{http://focus.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=sbaa109&fileType=pdf} + +\end_inset + + +\end_inset + + + + +\end_inset + + \layout Section Some Questions @@ -24330,7 +25294,7 @@ Support SDCC has grown to be a large project. The compiler alone (without the preprocessor, assembler and linker) is - well over 100,000 lines of code (blank stripped). + well over 150,000 lines of code (blank stripped). The open source nature of this project is a key to its continued growth and support. You gain the benefit and support of many active software developers and @@ -24413,7 +25377,7 @@ status Collapsed \end_inset option can sometimes be useful in locating optimization problems. - When reporting a bug please maker sure you: + When reporting a bug please make sure you: \layout Enumerate Attach the code you are compiling with SDCC. @@ -24457,6 +25421,29 @@ Please have a short check that you are using a recent version of SDCC and \end_inset +. + With SDCC on average having more than 200 downloads +\begin_inset LatexCommand \index{download} + +\end_inset + + on sourceforge per day +\begin_inset Foot +collapsed false + +\layout Standard + +220 daily downloads on average Jan-Sept 2006 and about 150 daily downloads + between 2002 and 2005. + This does not include other methods of distribution. +\end_inset + + there must be some users. + So it's not exactly easy to find a new bug. + If you find one we need it: +\emph on +reporting bugs is good +\emph default . \layout Section @@ -24613,7 +25600,7 @@ sdcc --version \series default or the filenames of the snapshot versions of SDCC include date and its Subversion -\begin_inset LatexCommand \index{Subversion} +\begin_inset LatexCommand \index{Subversion code repository} \end_inset @@ -24628,8 +25615,13 @@ sdcc --version An on-line source code browser and detailled instructions are also available there. SDCC versions starting from 1999 up to now are available (currently the - versions prior to the conversion from cvs to Subversion (April 2006) are - either by accessible by Subversion or by cvs). + versions prior to the conversion from cvs +\begin_inset LatexCommand \index{cvs (see Subversion)} + +\end_inset + + to Subversion (April 2006) are either by accessible by Subversion or by + cvs). \layout Section Release policy @@ -24871,7 +25863,7 @@ their \emph default choice (among them Alpha, i386, i386_64, MacOs, Mips, Sparc, Windows and eventually -\begin_inset LatexCommand \url[OLPC]{http://wiki.laptop.org/wiki/One_Laptop_per_Child} +\begin_inset LatexCommand \url[OLPC]{http://www.laptop.org} \end_inset @@ -27897,9 +28889,23 @@ status Collapsed command line option is specified. \layout Itemize -structures and unions cannot be assigned values directly, cannot be passed - as function parameters or assigned to each other and cannot be a return - value from a function, e.g.: +structures +\begin_inset LatexCommand \index{struct} + +\end_inset + + and unions +\begin_inset LatexCommand \index{union} + +\end_inset + + cannot be assigned values directly, cannot be passed as function parameters + or assigned to each other and cannot be a return value +\begin_inset LatexCommand \index{return value} + +\end_inset + + from a function, e.g.: \begin_deeper \layout Verse @@ -27936,8 +28942,15 @@ s1 = s2 ; /* is invalid in SDCC although allowed in ANSI */ \newline } \newline -struct s foo1 (struct s parms) /* invalid in SDCC although allowed in ANSI - */ + +\series bold +struct +\series default + s foo1 ( +\series bold +struct +\series default + s parms) /* invalid in SDCC although allowed in ANSI */ \newline { \newline @@ -27958,7 +28971,7 @@ struct s rets; \SpecialChar ~ \SpecialChar ~ \SpecialChar ~ -return rets;/* is invalid in SDCC although allowed in ANSI */ +return rets; /* is invalid in SDCC although allowed in ANSI */ \newline } \end_deeper @@ -27970,7 +28983,12 @@ initialization of structure arrays must be fully braced. \family typewriter -struct s { char x } a[] = {1, 2}; /* invalid in SDCC */ +struct s { char x } a[] = {1, 2};\SpecialChar ~ +\SpecialChar ~ +\SpecialChar ~ +\SpecialChar ~ +\SpecialChar ~ +/* invalid in SDCC */ \newline struct s { char x } a[] = {{1}, {2}}; /* OK */ \end_deeper @@ -28038,9 +29056,21 @@ Most enhancements in C99 are not supported, f.e.: \family typewriter \series bold inline +\begin_inset LatexCommand \index{inline (not supported)} + +\end_inset + + \series default int increment (int a) { return a+1; } /* is invalid in SDCC although allowed - in C99 */ + in C99. + An empty define +\emph on +#define inline +\emph default + can be used as a work around */ +\newline + \newline for ( \series bold