From b0d251d7c01f8185c2208d53ccce6f5326a1ca7f Mon Sep 17 00:00:00 2001 From: vrokas Date: Mon, 16 Feb 2004 22:18:01 +0000 Subject: [PATCH] * doc/sdccman.lyx: added more pic16 port documentation git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3202 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 4 + doc/sdccman.lyx | 237 ++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 221 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5f905362..06a54245 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2004-02-17 Vangelis Rokas + + * doc/sdccman.lyx: added more pic16 port documentation + 2004-02-16 Bernhard Held * doc/sdccman.lyx: added Vangelis' contribution diff --git a/doc/sdccman.lyx b/doc/sdccman.lyx index bbd5d414..07a06934 100644 --- a/doc/sdccman.lyx +++ b/doc/sdccman.lyx @@ -14486,8 +14486,8 @@ The PIC16 \end_inset - port (refered from now on as pic16) is the portion of SDCC that is responsible - to produce code for the Microchip + port is the portion of SDCC that is responsible to produce code for the + Microchip \begin_inset LatexCommand \index{Microchip} \end_inset @@ -14499,8 +14499,8 @@ The PIC16 Global Options \layout Standard -The pic16 port supports the standard command line arguments as supposed, - with the exception of certain cases that will be mentioned in the following +PIC16 port supports the standard command line arguments as supposed, with + the exception of certain cases that will be mentioned in the following list: \layout List \labelwidthstring 00.00.0000 @@ -14683,6 +14683,13 @@ status Collapsed This command line soon will be deprecated and stack will be enabled by default. For the time being it must be entered if one wants to have stack. +\newline + +\series bold +This option is deprecated. + Stack is enabled by default in the port and there is no way to disable + it. + It is left here only for reference. \layout List \labelwidthstring 00.00.0000 @@ -15030,6 +15037,122 @@ small model \layout Itemize large model +\layout Standard + +Memory model affects the default size of pointers within the source. + The sizes are shown in the next table: +\layout Standard +\align center + +\begin_inset Tabular + + + + + + + +\begin_inset Text + +\layout Standard + +Pointer sizes according to memory model +\end_inset + + +\begin_inset Text + +\layout Standard + +small model +\end_inset + + +\begin_inset Text + +\layout Standard + +large model +\end_inset + + + + +\begin_inset Text + +\layout Standard + +code pointers +\end_inset + + +\begin_inset Text + +\layout Standard + +16-bits +\end_inset + + +\begin_inset Text + +\layout Standard + +24-bits +\end_inset + + + + +\begin_inset Text + +\layout Standard + +data pointers +\end_inset + + +\begin_inset Text + +\layout Standard + +16-bits +\end_inset + + +\begin_inset Text + +\layout Standard + +16-bits +\end_inset + + + + +\end_inset + + +\layout Standard + +It is advisable that all sources within a project are compiled with the + same memory model. + If one wants to override the default memory model, this can be done by + declaring a pointer as +\series bold +far +\series default + or +\series bold +near +\series default +. + Far selects large memory model's pointers, while near selects small memory + model's pointers. +\layout Standard + +The standard device libraries (see 4.5.6) contain no reference to pointers, + so they can be used with both memory models. \layout Subsection Stack @@ -15164,14 +15287,18 @@ Frame pointer FSR2 \layout Subsection -Pointers +Function return values +\layout Standard + +Return values from functions are placed to the appropriate registers following + a modified Microchip policy optimized for SDCC. + The following table shows these registers: \layout Standard \align center \begin_inset Tabular - + - @@ -15180,15 +15307,25 @@ Pointers \layout Standard -Pointer sizes according to memory model +size +\end_inset + + +\begin_inset Text + +\layout Standard + +destination register \end_inset + + \begin_inset Text \layout Standard -small model +8 bits \end_inset @@ -15196,25 +15333,35 @@ small model \layout Standard -large model +WREG \end_inset - + \begin_inset Text \layout Standard -code pointers +16 bits \end_inset - + \begin_inset Text \layout Standard -16-bits +PRODL:WREG +\end_inset + + + + +\begin_inset Text + +\layout Standard + +24 bits \end_inset @@ -15222,25 +15369,35 @@ code pointers \layout Standard -24-bits +PRODH:PRODL:WREG \end_inset - + \begin_inset Text \layout Standard -data pointers +32 bits \end_inset - + \begin_inset Text \layout Standard -16-bits +FSR0L:PRODH:PRODL:WREG +\end_inset + + + + +\begin_inset Text + +\layout Standard + +>32 bits \end_inset @@ -15248,7 +15405,7 @@ data pointers \layout Standard -24-bits +on stack, FSR0 points to the beginning \end_inset @@ -15257,6 +15414,46 @@ data pointers \end_inset +\layout Subsection + +Interrupts +\layout Standard + +When entering an interrupt, currently the PIC16 port automatically saves + the following registers: +\layout Itemize + +WREG +\layout Itemize + +STATUS +\layout Itemize + +BSR +\layout Itemize + +PROD (PRODL and PRODH) +\layout Itemize + +FSR0 (FSR0L and FSR0H) +\layout Standard + +These registers are restored upon return from the interrupt routine +\begin_inset Foot +collapsed false + +\layout Standard + +NOTE that when the _naked attribute is specified for an interrupt routine, + then NO registers are stored or restored. +\end_inset + +. +\layout Standard + +Currently interrupt enable flags are left unaffected when entering an interrupt + routine. + This may change in the future. \layout Chapter Debugging with SDCDB -- 2.30.2