* support/regression/tests/swap.c: 64 bit hosts failed
authorfrief <frief@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 25 Jan 2007 14:15:21 +0000 (14:15 +0000)
committerfrief <frief@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 25 Jan 2007 14:15:21 +0000 (14:15 +0000)
* doc/sdccman.lyx: added preliminary mcs51 printf feature matrix

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4596 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
doc/sdccman.lyx
support/regression/tests/swap.c

index 1fc1679e5bb11e9ffcdc048e32a4e048c601ad3a..6b69ebc9a5ddf8a954a9162a852e869ca6b29c76 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-01-25 Frieder Ferlemann <Frieder.Ferlemann AT web.de>
+
+       * support/regression/tests/swap.c: 64 bit hosts failed
+       * doc/sdccman.lyx: added preliminary mcs51 printf feature matrix
+
 2007-01-25 Raphael Neider <rneider AT web.de>
 
        * src/pic/pcode.c (sameBank,FixRegisterBanking): optimize banksels
index eb16337ed11ee2e862c4ece108fe103efdf91ed1..05f928a99525f0850da55b8ad8daf659160f085e 100644 (file)
@@ -15993,159 +15993,883 @@ Stdclib functions (puts, printf, strcat etc.)
 \layout Subsubsection
 
 <stdio.h>
+\layout Paragraph
+
+getchar(), putchar()
+\layout Standard
+
+
+\begin_inset LatexCommand \index{<stdio.h>}
+
+\end_inset 
+
+As usual on embedded systems you have to provide your own 
+\family typewriter 
+getchar()
+\begin_inset LatexCommand \index{getchar()}
+
+\end_inset 
+
+\family default 
+and 
+\family typewriter 
+putchar()
+\begin_inset LatexCommand \index{putchar()}
+
+\end_inset 
+
+
+\family default 
+ routines.
+ SDCC does not know whether the system connects to a serial line with or
+ without handshake, LCD, keyboard or other device.
+ And whether a 
+\family typewriter 
+lf
+\family default 
+ to 
+\family typewriter 
+crlf
+\family default 
+ conversion within 
+\family typewriter 
+putchar()
+\family default 
+ is intended.
+ You'll find examples for serial routines f.e.
+ in sdcc/device/lib.
+ For the mcs51 this minimalistic polling 
+\family typewriter 
+putchar()
+\family default 
+ routine might be a start:
+\layout Verse
+
+
+\family typewriter 
+void putchar (char c) { 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+while (!TI)\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ /* assumes UART is initialized */
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+;
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+TI = 0;
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+SBUF = c;
+\newline 
+}
+\layout Paragraph
+
+printf()
+\layout Standard
+
+The default
+\family typewriter 
+ printf()
+\begin_inset LatexCommand \index{printf()}
+
+\end_inset 
+
+
+\family default 
+ implementation in
+\family typewriter 
+ printf_large.c
+\family default 
+ does not support float (except on ds390).
+ To enable this recompile it with the option 
+\emph on 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+DUSE_FLOATS=1
+\begin_inset LatexCommand \index{USE\_FLOATS}
+
+\end_inset 
+
+
+\emph default 
+ on the command line.
+ Use
+\emph on 
+ -
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-model-large
+\begin_inset LatexCommand \index{-\/-model-large}
+
+\end_inset 
+
+
+\emph default 
+ for the mcs51 port, since this uses a lot of memory.
+\layout Standard
+
+If you're short on code memory you might want to use 
+\family typewriter 
+printf_small()
+\begin_inset LatexCommand \index{printf\_small()}
+
+\end_inset 
+
+
+\family default 
+\emph on 
+instead
+\emph default 
+ of
+\family typewriter 
+ printf().
+
+\family default 
+ For the mcs51 there additionally are assembly versions 
+\family typewriter 
+printf_tiny()
+\begin_inset LatexCommand \index{printf\_tiny() (mcs51)}
+
+\end_inset 
+
+
+\family default 
+ (subset of printf using less than 270 bytes) and 
+\family typewriter 
+printf_fast()
+\begin_inset LatexCommand \index{printf\_fast() (mcs51)}
+
+\end_inset 
+
+\family default 
+and
+\family typewriter 
+ printf_fast_f()
+\begin_inset LatexCommand \index{printf\_fast\_f() (mcs51)}
+
+\end_inset 
+
+
+\family default 
+ (floating-point aware version of printf_fast) which should fit the requirements
+ of many embedded systems (printf_fast() can be customized by unsetting
+ #defines to 
+\emph on 
+not
+\emph default 
+ support long variables and field widths).
+ Be shure to only use only one of these printf options within a project.
+\newline 
+
+\layout Standard
+
+Feature matrix of different 
+\emph on 
+printf
+\emph default 
+ options on mcs51.
+\layout Standard
+
+
+\begin_inset  Tabular
+<lyxtabular version="3" rows="9" columns="7">
+<features islongtable="true">
+<column alignment="left" valignment="center" leftline="true" width="14col%">
+<column alignment="center" valignment="top" leftline="true" width="0">
+<column alignment="center" valignment="top" leftline="true" width="12col%">
+<column alignment="center" valignment="top" leftline="true" width="10col%">
+<column alignment="center" valignment="top" leftline="true" width="0">
+<column alignment="center" valignment="top" leftline="true" rightline="true" width="12col%">
+<column alignment="center" valignment="top" rightline="true" width="0">
+<row topline="true" bottomline="true" endhead="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\series bold 
+\size large 
+mcs51
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+printf
+\begin_inset LatexCommand \index{printf}
+
+\end_inset 
+
+
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+printf 
+\size scriptsize 
+USE_FLOATS=1
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+printf_small
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+printf_fast
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+printf_fast_f
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+printf_tiny
+\end_inset 
+</cell>
+</row>
+<row topline="true" endhead="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+filename
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size scriptsize 
+printf_large.c
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size scriptsize 
+printf_large.c
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size scriptsize 
+printfl.c
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size scriptsize 
+printf_fast.c
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size scriptsize 
+printf_fast_f.c
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size scriptsize 
+printf_tiny.c
+\end_inset 
+</cell>
+</row>
+<row topline="true" endhead="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+code size (small\SpecialChar ~
+/\SpecialChar ~
+large) in\SpecialChar ~
+kByte
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+1.4 / 2.0
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+2.8 / 3.7
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+0.45 / 0.47 (+ _ltoa)
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+1.2 / 1.2
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+1.6 / 1.6
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+0.26 / 0.26
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+formats
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+cd(f)i
+\emph on 
+o
+\emph default 
+psx
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+cd
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
+f
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+i
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph on 
+\bar default 
+\noun default 
+\color default
+o
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+psx
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+c
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+d
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph on 
+\bar default 
+\noun default 
+\color default
+o
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+s
+\family default 
+\series default 
+\shape default 
+\size default 
+\emph default 
+\bar default 
+\noun default 
+\color default
+x
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+cdsx
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+cdfsx
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+cdsx
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+long (32 bit) support
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+x
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+x
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+x
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+x/(-)
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+x/(-)
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+-
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+byte arguments on stack
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+b
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+b
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+-
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
 \layout Standard
 
+h
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
 
-\begin_inset LatexCommand \index{<stdio.h>}
+\layout Standard
 
+h
 \end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
 
-As usual on embedded systems you have to provide your own 
-\family typewriter 
-getchar()
-\begin_inset LatexCommand \index{getchar()}
+\layout Standard
 
+-
 \end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
-\family default 
-and 
-\family typewriter 
-putchar()
-\begin_inset LatexCommand \index{putchar()}
+\layout Standard
+
+float format
+\begin_inset LatexCommand \index{Floating point support}
 
 \end_inset 
 
 
-\family default 
- routines.
- SDCC does not know whether the system connects to a serial line with or
- without handshake, LCD, keyboard or other device.
- And whether a 
-\family typewriter 
-lf
-\family default 
- to 
-\family typewriter 
-crlf
-\family default 
- conversion within 
-\family typewriter 
-putchar()
-\family default 
- is intended.
- You'll find examples for serial routines f.e.
- in sdcc/device/lib.
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
 \layout Standard
 
-The default
-\family typewriter 
- printf()
-\begin_inset LatexCommand \index{printf()}
+(%f)
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
 
+%f
 \end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
+\layout Standard
 
-\family default 
-implementation in
-\family typewriter 
- printf_large.c
-\family default 
- does not support float (except on ds390).
- To enable this recompile it with the option 
-\emph on 
 -
-\begin_inset ERT
-status Collapsed
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
 \layout Standard
 
-\backslash 
-/
+(%f)
 \end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
 
-DUSE_FLOATS=1
-\begin_inset LatexCommand \index{USE\_FLOATS}
+\layout Standard
 
+%f (limited\SpecialChar ~
+range)
 \end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
 
+\layout Standard
 
-\emph default 
- on the command line.
- Use
-\emph on 
- -
-\begin_inset ERT
-status Collapsed
+-
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
 \layout Standard
 
-\backslash 
-/
+float formats %e %g
 \end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
--model-large
-\begin_inset LatexCommand \index{-\/-model-large}
+\layout Standard
 
+-
 \end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
 
+-
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
-\emph default 
- for the mcs51 port, since this uses a lot of memory.
 \layout Standard
 
-If you're short on memory you might want to use 
-\family typewriter 
-printf_small()
-\begin_inset LatexCommand \index{printf\_small()}
+-
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
+\layout Standard
+
+-
 \end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
 
+\layout Standard
 
-\family default 
-\emph on 
-instead
-\emph default 
- of
-\family typewriter 
- printf().
+-
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
 
-\family default 
- For the mcs51 there additionally are assembly versions 
-\family typewriter 
-printf_tiny()
-\begin_inset LatexCommand \index{printf\_tiny() (mcs51)}
+\layout Standard
 
+-
 \end_inset 
+</cell>
+</row>
+<row topline="true" bottomline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
+\layout Standard
 
-\family default 
- (subset of printf using less than 270 bytes) and 
-\family typewriter 
-printf_fast()
-\begin_inset LatexCommand \index{printf\_fast() (mcs51)}
+field width
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
 
+x
 \end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
-\family default 
-and
-\family typewriter 
- printf_fast_f()
-\begin_inset LatexCommand \index{printf\_fast\_f() (mcs51)}
+\layout Standard
+
+x
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+-
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+x/(-)
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+x/(-)
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+-
+\end_inset 
+</cell>
+</row>
+</lyxtabular>
 
 \end_inset 
 
 
-\family default 
- (floating-point aware version of printf_fast) which should fit the requirements
- of many embedded systems (printf_fast() can be customized by unsetting
- #defines to 
-\emph on 
-not
-\emph default 
- support long variables and field widths).
 \layout Subsubsection
 
 <malloc.h>
@@ -16177,17 +16901,14 @@ As of SDCC 2.6.2 you no longer need to call an initialization routine before
 
 \family typewriter 
 sdcc -c _heap.c -D HEAD_SIZE=2048
-\newline 
+\layout Standard
 
-\family default 
 And then link it with:
 \layout Verse
 
 
 \family typewriter 
 sdcc main.rel _heap.rel
-\newline 
-
 \layout Subsection
 
 Math functions (sinf, powf, sqrtf etc.)
@@ -22764,7 +23485,22 @@ and DDD was invoked with
 \newline 
 
 \newline 
-ddd -debugger 'sdcdb -cpu 8032 ddd_example'
+ddd -debugger "sdcdb -cpu 8032 ddd_example"
+\layout Standard
+
+
+\begin_inset Note
+collapsed false
+
+\layout Standard
+
+Check that the double quotes or an apostroph within the command line survive
+ the LyX tool chain.
+ Previously the apostrophs got slanted in the PDF output so a cut and paste
+ did not work.
+\end_inset 
+
+
 \layout Subsection
 
 Interfacing SDCDB with XEmacs
@@ -24007,7 +24743,12 @@ Directory
 
 \layout Standard
 
-ucSsim
+uCsim
+\begin_inset LatexCommand \index{uCsim}
+
+\end_inset 
+
+
 \end_inset 
 </cell>
 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
@@ -24661,7 +25402,12 @@ online at
 
 \layout Standard
 
-Software simulator for microcontrollers
+uCsim
+\begin_inset LatexCommand \index{uCsim}
+
+\end_inset 
+
+ Software simulator for microcontrollers
 \end_inset 
 </cell>
 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
index fbec0ec23e5fcc3a0ad318ad230e1537eefc8571..4dbe4ec9901422ce1ba15f68c1cb340a2535571b 100644 (file)
@@ -22,7 +22,7 @@ static void testSwap_4(void)
 }
 
 
-#define SWAP_8(x) (((x)<<8)|((x)>>8))
+#define SWAP_8(x) ((((x)<<8)|((x)>>8)) & 0xffff)
 
 static void testSwap_8(void)
 {
@@ -64,8 +64,7 @@ static void testSwap_8(void)
 }
 
 
-#define SWAP_16(x) (((x)<<16) | ((x)>>16))
-#define SWAP_16_2(x) ((unsigned int)((SWAP_8((unsigned int)x))<<16) | (SWAP_8(x)>>16))
+#define SWAP_16(x) ((((x)<<16) | ((x)>>16)) & 0xffffFFFF)
 
 static void testSwap_16(void)
 {
@@ -77,10 +76,6 @@ static void testSwap_16(void)
     tt = SWAP_16(tt);
     ASSERT( tt == SWAP_16(TEST_VECT_32));
 
-    tt = t;
-    tt = SWAP_16_2(tt);
-    ASSERT( tt == SWAP_16_2(TEST_VECT_32));
-
     /* swapping union with little register pressure */
     {
         unsigned char c;