+.
+ The caller must see this in the prototype of the callee and the callee
+ needs it for a proper return.
+ Called functions within the same bank as the caller do not need the
+\emph on
+banked
+\emph default
+ keyword nor do functions in the common area.
+ Beware: SDCC does not know or check if functions are in the same bank.
+ This is your responsibility!
+\newline
+
+\newline
+Normally all functions you write end up in
+ the segment CSEG.
+ If you want a function explicitly to reside in the common area put it in
+ segment HOME.
+ This applies for instance to interrupt service routines as they should
+ not be banked.
+\end_layout
+
+\begin_layout Standard
+Functions that need to be in a switched bank must be put in a named segment.
+ The name can be mostly anything up to eight characters (e.g.
+ BANK1).
+ To do this you either use -
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-codeseg BANK1 (See
+\begin_inset LatexCommand ref
+reference "lyx:-codeseg"
+
+\end_inset
+
+) on the command line when compiling or #pragma codeseg BANK1 (See
+\begin_inset LatexCommand ref
+reference "sec:Pragmas"
+
+\end_inset
+
+) at the top of the C source file.
+ The segment name always applies to the whole source file and generated
+ object so functions for different banks need to be defined in different
+ source files.
+\newline
+
+\newline
+When linking your objects you need to tell the linker where
+ to put your segments.
+ To do this you use the following command line option to SDCC: -Wl-b BANK1=0x180
+00 (See
+\begin_inset LatexCommand ref
+reference "lyx:-Wl option"
+
+\end_inset
+
+).
+ This sets the virtual start address of this segment.
+ It sets the banknumber to 0x01 and maps the bank to 0x8000 and up.
+ The linker will not check for overflows, again this is your responsibility.
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+DS400 port
+\end_layout
+
+\begin_layout Standard
+The DS80C400
+\begin_inset LatexCommand index
+name "DS80C400"
+
+\end_inset
+
+
+\begin_inset LatexCommand index
+name "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
+ at
+\size footnotesize
+
+\begin_inset LatexCommand url
+target "ftp://ftp.dalsemi.com/pub/tini/ds80c400/c_libraries/sdcc/index.html"
+
+\end_inset
+
+.
+
+\begin_inset VSpace bigskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+The Z80 and gbz80 port
+\end_layout
+
+\begin_layout Standard
+SDCC can target both the Zilog Z80
+\begin_inset LatexCommand index
+name "Z80"
+
+\end_inset
+
+ and the Nintendo Gameboy's Z80-like gbz80
+\begin_inset LatexCommand index
+name "gbz80 (GameBoy Z80)"
+
+\end_inset
+
+.
+ The Z80 port is passed through the same
+\emph on
+regressions tests
+\begin_inset LatexCommand index
+name "Regression test"
+
+\end_inset
+
+
+\emph default
+ (see section
+\begin_inset LatexCommand ref
+reference "sec:Quality-control"
+
+\end_inset
+
+) as the MCS51 and DS390 ports, so floating point support, support for long
+ variables and bitfield support is fine.
+ See mailing lists and forums about interrupt routines.
+\end_layout
+
+\begin_layout Standard
+As always, the code is the authoritative reference - see z80/ralloc.c and
+ z80/gen.c.
+ The stack
+\begin_inset LatexCommand index
+name "Z80!stack"
+
+\end_inset
+
+ frame is similar to that generated by the IAR Z80 compiler.
+ 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
+name "Z80!return value"
+
+\end_inset
+
+ for the Z80 port are stored in L (one byte), HL (two bytes), or DEHL (four
+ bytes).
+ The gbz80 port use the same set of registers for the return values, but
+ in a different order of significance: E (one byte), DE (two bytes), or
+ HLDE (four bytes).
+\begin_inset VSpace bigskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+The HC08 port
+\end_layout
+
+\begin_layout Standard
+The port to the Freescale/Motorola HC08
+\begin_inset LatexCommand index
+name "HC08"
+
+\end_inset
+
+ family has been added in October 2003, and is still undergoing some basic
+ development.
+ The code generator is complete, but the register allocation is still quite
+ unoptimized.
+ Some of the SDCC's standard C library functions have embedded non-HC08
+ inline assembly and so are not yet usable.
+\end_layout
+
+\begin_layout Standard
+The HC08 port passes the regression test suite (see section
+\begin_inset LatexCommand ref
+reference "sec:Quality-control"
+
+\end_inset
+
+).
+\begin_inset VSpace bigskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+The PIC14
+\begin_inset LatexCommand index
+name "PIC14"
+
+\end_inset
+
+ port
+\end_layout
+
+\begin_layout Standard
+The PIC14 port adds support for Microchip
+\begin_inset LatexCommand index
+name "Microchip"
+
+\end_inset
+
+
+\begin_inset Formula $^{\text{TM}}$
+\end_inset
+
+ PIC
+\begin_inset LatexCommand index
+name "PIC14"
+
+\end_inset
+
+
+\begin_inset Formula $^{\text{TM}}$
+\end_inset
+
+ MCUs with 14 bit wide instructions.
+ This port is not yet mature and still lacks many features.
+ However, it can work for simple code.
+\end_layout
+
+\begin_layout Standard
+\noindent
+Currently supported devices include:
+\end_layout
+
+\begin_layout Standard
+12F: 629, 635, 675, 683
+\end_layout
+
+\begin_layout Standard
+16C: 432, 433
+\end_layout
+
+\begin_layout Standard
+16C: 554, 557, 558
+\end_layout
+
+\begin_layout Standard
+16C: 62, 620, 620a, 621, 621a, 622, 622a, 63a, 65b
+\end_layout