From 125c15e6fb6b60132d160ad849e5688e78c40a17 Mon Sep 17 00:00:00 2001 From: maartenbrock Date: Sun, 30 Oct 2005 13:30:20 +0000 Subject: [PATCH] * doc/sdccman.lyx: documented medium model git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3922 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 1 + doc/sdccman.lyx | 106 ++++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 94 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index f6898e63..48d39328 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ * device/include/mcs51/c8051f310.h: added sfr16 definitions * device/lib/_mullong.c: update for medium model * device/lib/incl.mk: added medium model + * doc/sdccman.lyx: documented medium model * src/SDCCast.c (isBitAndPow2): simplified using updated powof2 * src/SDCCicode.c (geniCodeMultiply, geniCodeDivision): use updated powof2 * src/SDCCmain.c (optionsTable, linkEdit): enabled medium model diff --git a/doc/sdccman.lyx b/doc/sdccman.lyx index 6583cd31..699ed0f6 100644 --- a/doc/sdccman.lyx +++ b/doc/sdccman.lyx @@ -6045,6 +6045,33 @@ Generate code for Small Model programs, see section Memory Models for more \labelwidthstring 00.00.0000 +\series bold +- +\begin_inset ERT +status Collapsed + +\layout Standard + +\backslash +/ +\end_inset + +-model-medium +\begin_inset LatexCommand \index{-\/-model-medium} + +\end_inset + + +\series default + Generate code for Medium model programs, see section Memory Models for + more details. + If this option is used all source files in the project have to be compiled + with this option. + It must also be used when invoking the linker. +\layout List +\labelwidthstring 00.00.0000 + + \series bold - \begin_inset ERT @@ -8770,6 +8797,11 @@ Paged xdata access is just as straightforward as using the other addressing \end_inset ). + This is the +\series bold +default +\series default + storage class for the Medium Memory model, e.g.: \layout Verse @@ -14731,12 +14763,12 @@ MCS51 Memory Models \layout Subsubsection -Small and Large +Small, Medium and Large \layout Standard -SDCC allows two memory models for MCS51 code, +SDCC allows three memory models for MCS51 code, \shape slanted -small +small, medium \shape default and \shape slanted @@ -14748,16 +14780,15 @@ large never \emph default be combined together or the results would be unpredictable. - The library routines supplied with the compiler are compiled as both small - and large. - The compiled library modules are contained in separate directories as small - and large so that you can link to either set. - + The library routines supplied with the compiler are compiled as small, + medium and large. + The compiled library modules are contained in separate directories as small, + medium and large so that you can link to the appropriate set. \layout Standard -When the large model is used all variables declared without a storage class - will be allocated into the external ram, this includes all parameters and - local variables (for non-reentrant +When the medium or large model is used all variables declared without a + storage class will be allocated into the external ram, this includes all + parameters and local variables (for non-reentrant \begin_inset LatexCommand \index{reentrant} \end_inset @@ -15425,7 +15456,7 @@ The compiler creates the following #defines \begin_inset Tabular - + @@ -15626,6 +15657,43 @@ status Collapsed \layout Standard +SDCC_MODEL_MEDIUM +\begin_inset LatexCommand \index{SDCC\_MODEL\_MEDIUM} + +\end_inset + + +\end_inset + + +\begin_inset Text + +\layout Standard + +when +\emph on +- +\begin_inset ERT +status Collapsed + +\layout Standard + +\backslash +/ +\end_inset + +-model-medium +\emph default + is used +\end_inset + + + + +\begin_inset Text + +\layout Standard + SDCC_MODEL_LARGE \begin_inset LatexCommand \index{SDCC\_MODEL\_LARGE} @@ -25728,7 +25796,7 @@ not \emph default be recognized. They are standard C expressions, so I heartily recommend these be the only - way to get the highest order bit, (it is portable). + way to get the higher order byte/word, (it is portable). Of course it will be recognized even if it is embedded in other expressions, e.g.: \layout Verse @@ -26252,6 +26320,18 @@ return rets;/* is invalid in SDCC although allowed in ANSI */ \end_deeper \layout Itemize +initialization of structure arrays must be fully braced. +\begin_deeper +\layout Verse + + +\family typewriter +struct s { char x } a[] = {1, 2}; /* invalid in SDCC */ +\newline +struct s { char x } a[] = {{1}, {2}}; /* OK */ +\end_deeper +\layout Itemize + 'long long \begin_inset LatexCommand \index{long long (not supported)} -- 2.39.5