\layout Standard
..
-\backslash
-
\end_inset
</cell>
</row>
\begin_inset Quotes srd
\end_inset
-compile on Cygwin for Mingw32(see also sdcc/support/scripts/sdcc_cygwin_mingw32)
+compile on Cygwin for Mingw32 (see also sdcc/support/scripts/sdcc_cygwin_mingw32)
:
\layout LyX-Code
Win32-binary can be built, which will not need the Cygwin-DLL.
For the necessary 'configure' options see section 'configure options' or
- the script 'sdcc/support/scripts/sdcc_cygwinmingw32'.
+ the script 'sdcc/support/scripts/sdcc_cygwin_mingw32'.
\newline
\newline
\layout Enumerate
-Download the binary package and unpack it using your favorite unpacking
- tool (gunzip, WinZip, etc).
+Download the binary package from
+\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/snap.php}
+
+\end_inset
+
+ and unpack it using your favorite unpacking tool (gunzip, WinZip, etc).
This should unpack to a group of sub-directories.
An example directory structure after unpacking the mingw32 package is:
c:
\end_inset
-.See section Installation for more details.
+.
+ See section Installation for more details.
\layout List
\labelwidthstring 00.00.0000
function.
The default option is to lock up i.e.
- generate a 'ljmp '.
+ generate a '
+\family typewriter
+ljmp .
+\family default
+'.
\layout List
\labelwidthstring 00.00.0000
\family typewriter
-/* pointer physically in xternal ram pointing to object in internal ram
+/* pointer physically in internal ram pointing to object in external ram
+ */
+\newline
+xdata unsigned char * data p;
+\newline
+
+\newline
+/* pointer physically in external ram pointing to object in internal ram
*/
\newline
data unsigned char * xdata p;
\layout Subsection
Startup Code
+\begin_inset LatexCommand \label{sub:Startup-Code}
+
+\end_inset
+
+
\begin_inset LatexCommand \index{Startup code}
\end_inset
- Bytes 00-1F - 32 bytes to hold up to 4 banks of the registers R0 to R7,
\newline
-- Bytes 20-2F - 16 bytes to hold 128 bit variables and,
+- Bytes 20-2F - 16 bytes to hold 128 bit
+\begin_inset LatexCommand \index{bit}
+
+\end_inset
+
+ variables and,
\newline
- Bytes 30-7F - 80 bytes for general purpose use.
\newline
\emph on
idata
\emph default
+
+\begin_inset LatexCommand \index{idata}
+
+\end_inset
+
).
Furthermore, some chips may have some built in external memory (
\emph on
xdata
\emph default
+
+\begin_inset LatexCommand \index{xdata}
+
+\end_inset
+
) which should not be confused with the internal, directly addressable RAM
memory (
\emph on
data
\emph default
+
+\begin_inset LatexCommand \index{data}
+
+\end_inset
+
).
Sometimes this built in
\emph on
SDCC has grown to be a large project.
The compiler alone (without the preprocessor, assembler and linker) is
- about 40,000 lines of code (blank stripped).
+ well over 100,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
Both the above switch statements will be implemented using a jump-table.
The example to the right side is slightly more efficient as the check for
- the lower bound of the jump-table is not needed.
+ the lower boundary of the jump-table is not needed.
\end_deeper
\layout Itemize
\newline
\SpecialChar ~
\SpecialChar ~
-case 9: \SpecialChar ~
+case 9:\SpecialChar ~
+\SpecialChar ~
...
\newline
\SpecialChar ~
\SpecialChar ~
-case 10: ...
+case 10:\SpecialChar ~
+...
\newline
\SpecialChar ~
\SpecialChar ~
-case 11: ...
+case 11:\SpecialChar ~
+...
\newline
\SpecialChar ~
\family typewriter
-mov a,_i
+mov\SpecialChar ~
+ a,_i
\newline
swap a
\newline
-anl a,#0x0f
+anl\SpecialChar ~
+ a,#0x0f
\newline
-mov _i,a
+mov\SpecialChar ~
+ _i,a
\layout Standard
In general SDCC will never setup a loop if the shift count is known.
_i,a
\layout Standard
-Note that SDCC stores numbers in little-endian format (i.e.
+Note that SDCC stores numbers in little-endian
+\begin_inset LatexCommand \index{little-endian}
+
+\end_inset
+
+
+\begin_inset LatexCommand \index{Endianness}
+
+\end_inset
+
+ format (i.e.
lowest order first).
\layout Subsubsection
\layout Comment
license statements for the libraries are missing.
- sdcc/device/lib/ser_ir.c f.e.
- comes with a GPL (as opposed to LGPL) License - this will not be liberal
+ sdcc/device/lib/ser_ir.c
+\layout Comment
+
+or _decdptr f.e.
+ come with a GPL (as opposed to LGPL) License - this will not be liberal
enough for many embedded programmers.
\layout Subsection
\layout Standard
-The external stack is located at the start of the external ram segment,
- and is 256 bytes in size.
+The external stack (-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash
+/
+\end_inset
+
+-xstack option
+\begin_inset LatexCommand \index{-\/-xstack}
+
+\end_inset
+
+) is located at the start of the external ram segment, and is 256 bytes
+ in size.
When -
\begin_inset ERT
status Collapsed
/
\end_inset
--stack-auto option, all parameters and local variables are allocated on
- the external stack (note support libraries will need to be recompiled with
- the same options).
+-stack-auto
+\begin_inset LatexCommand \index{-\/-stack-auto}
+
+\end_inset
+
+ option, all parameters and local variables are allocated on the external
+ stack (note support libraries will need to be recompiled with the same
+ options).
\layout Standard
The compiler outputs the higher order address byte of the external ram segment
Other Processors
\layout Subsubsection
+MCS51 variants
+\begin_inset LatexCommand \index{MCS51 variants}
+
+\end_inset
+
+
+\layout Standard
+
+MCS51 processors are available from many vendors and come in many different
+ flavours.
+ While they might differ considerably in respect to Special Function Registers
+ the core MCS51 is usually not modified or is kept compatible.
+
+\layout Subsubsection*
+
+pdata access by SFR
+\layout Standard
+
+With the upcome of devices with internal xdata and flash memory devices
+ using port P2 as dedicated I/O port is becoming more popular.
+ Switching the high byte for pdata
+\begin_inset LatexCommand \index{pdata}
+
+\end_inset
+
+ access which was formerly done by port P2 is then achieved by a Special
+ Function Register.
+ In well-established MCS51 tradition the address of this
+\emph on
+sfr
+\emph default
+ is where the chip designers decided to put it.
+ As pdata addressing is used in the startup code for the initialization
+ of xdata variables a separate startup code should be used as described
+ in section
+\begin_inset LatexCommand \ref{sub:Startup-Code}
+
+\end_inset
+
+.
+\layout Subsubsection*
+
+Other Features available by SFR
+\layout Standard
+
+Some MCS51 variants offer features like Double DPTR
+\begin_inset LatexCommand \index{DPTR}
+
+\end_inset
+
+, multiple DPTR, decrementing DPTR, 16x16 Multiply.
+ These are currently not used for the MCS51 port.
+ If you absolutely need them you can fall back to inline assembly or submit
+ a patch to SDCC.
+\layout Subsubsection
+
The Z80 and gbz80 port
\layout Standard