\layout Title
-
-\begin_inset ERT
-status Open
-
-\layout Standard
-
-\backslash
-NotSpecial{
-\backslash
-do
-\backslash
--}
-\end_inset
-
SDCC Compiler User Guide
\layout Standard
will push a as an int and as a char resp.
\layout Itemize
-option
-\family typewriter
---
-\family default
-regextend has been removed
+option ---regextend has been removed
\layout Itemize
-option --noregparms has been removed
+option ---noregparms has been removed
\layout Itemize
-option --stack-after-data has been removed
+option ---stack-after-data has been removed
\layout Standard
Linux (and other gcc-builds like Solaris, Cygwin, Mingw and OSX) by default
install in /usr/local.
- You can override this when configuring with --prefix-path.
+ You can override this when configuring with ---prefix-path.
Subdirs used will be bin, share/sdcc/include, share/sdcc/lib and share/sdcc/doc.
\newline
Windows MSVC and Borland builds will install in one single tree (e.g.
Type
\family sans
\series bold
-"sdcc --version"
+"sdcc ---version"
\family default
\series default
at the prompt, and the program should run and tell you the version.
\end_inset
command has several options.
- The most commonly used option is --prefix=<directory name>, where <directory
+ The most commonly used option is ---prefix=<directory name>, where <directory
name> is the final location for the sdcc executables and libraries, (default
location is /usr/local).
The installation process will create the following directory structure
\begin_inset Quotes sld
\end_inset
-./configure --prefix=/usr/local
+./configure ---prefix=/usr/local
\begin_inset Quotes erd
\end_inset
sourcefile.map - The memory map for the load module, created by the Linker
\newline
sourcefile.ihx - The load module in Intel hex format (you can select the
- Motorola S19 format with --out-fmt-s19)
+ Motorola S19 format with ---out-fmt-s19)
\newline
-sourcefile.cdb - An optional file (with --debug) containing debug information
+sourcefile.cdb - An optional file (with ---debug) containing debug information
\newline
\layout Subsubsection
\series bold
-L\SpecialChar ~
---lib-path
+---lib-path
\bar under
\series default
\series bold
---xram-loc
+---xram-loc
\series default
<Value> The start location of the external ram, default value is 0.
- The value entered can be in Hexadecimal or Decimal format, e.g.: --xram-loc
- 0x8000 or --xram-loc 32768.
+ The value entered can be in Hexadecimal or Decimal format, e.g.: ---xram-loc
+ 0x8000 or ---xram-loc 32768.
\layout List
\labelwidthstring 00.00.0000
\series bold
---code-loc
+---code-loc
\series default
<Value> The start location of the code segment, default value 0.
Note when this option is used the interrupt vector table is also relocated
to the given address.
- The value entered can be in Hexadecimal or Decimal format, e.g.: --code-loc
- 0x8000 or --code-loc 32768.
+ The value entered can be in Hexadecimal or Decimal format, e.g.: ---code-loc
+ 0x8000 or ---code-loc 32768.
\layout List
\labelwidthstring 00.00.0000
\series bold
---stack-loc
+---stack-loc
\series default
<Value> By default the stack is placed after the data segment.
Using this option the stack can be placed anywhere in the internal memory
space of the 8051.
The value entered can be in Hexadecimal or Decimal format, e.g.
- --stack-loc 0x20 or --stack-loc 32.
+ ---stack-loc 0x20 or ---stack-loc 32.
Since the sp register is incremented before a push or call, the initial
sp will be set to one byte prior the provided value.
The provided value should not overlap any other memory areas such as used
\series bold
---data-loc
+---data-loc
\series default
<Value> The start location of the internal ram data segment.
The value entered can be in Hexadecimal or Decimal format, eg.
- --data-loc 0x20 or --data-loc 32.
+ ---data-loc 0x20 or ---data-loc 32.
(By default, the start location of the internal ram data segment is set
as low as possible in memory, taking into account the used register banks
and the bit segment at address 0x20.
For example if register banks 0 and 1 are used without bit variables, the
- data segment will be set, if --data-loc is not used, to location 0x10.)
+ data segment will be set, if ---data-loc is not used, to location 0x10.)
\layout List
\labelwidthstring 00.00.0000
\series bold
---idata-loc
+---idata-loc
\series default
<Value> The start location of the indirectly addressable internal ram, default
value is 0x80.
The value entered can be in Hexadecimal or Decimal format, eg.
- --idata-loc 0x88 or --idata-loc 136.
+ ---idata-loc 0x88 or ---idata-loc 136.
\layout List
\labelwidthstring 00.00.0000
\series bold
---out-fmt-ihx
+---out-fmt-ihx
\bar under
\series default
\series bold
---out-fmt-s19
+---out-fmt-s19
\bar under
\series default
\series bold
---model-large
+---model-large
\series default
Generate code for Large model programs see section Memory Models for more
details.
\series bold
---model-small
+---model-small
\series default
\size large
\emph on
\series bold
---model-flat24
+---model-flat24
\series default
\size large
\emph on
\series bold
---stack-10bit
+---stack-10bit
\series default
Generate code for the 10 bit stack mode of the Dallas DS80C390 part.
This is the one and only that the ds390 code generator supports right now
any re-entrant functions compiled with this option.
In principle, this should work with the
\emph on
---stack-auto
+---stack-auto
\emph default
option, but that has not been tested.
It is incompatible with the
\emph on
---xstack
+---xstack
\emph default
option.
It also only makes sense if the processor is in 24 bit contiguous addressing
mode (see the
\emph on
---model-flat24 option
+---model-flat24 option
\emph default
).
\layout Subsubsection
\series bold
---nogcse
+---nogcse
\series default
Will not do global subexpression elimination, this option may be used when
the compiler creates undesirably large stack/data spaces to store compiler
\series bold
---noinvariant
+---noinvariant
\series default
Will not do loop invariant optimizations, this may be turned off for reasons
explained for the previous option.
\series bold
---noinduction
+---noinduction
\series default
Will not do loop induction optimizations, see section strength reduction
for more details.It is recommended that this option is NOT used, #pragma\SpecialChar ~
\series bold
---nojtbound
+---nojtbound
\size large
\bar under
\series bold
---noloopreverse
+---noloopreverse
\series default
\size large
\series bold
---no-xinit-opt
+---no-xinit-opt
\series default
This will disable the memcpy of initialized data in far space from code
space
\series bold
-c\SpecialChar ~
---compile-only
+---compile-only
\series default
will compile and assemble the source, but will not call the linkage editor.
\layout List
\series bold
---stack-auto
+---stack-auto
\series default
\size large
\emph on
\series bold
---xstack
+---xstack
\series default
Uses a pseudo stack in the first 256 bytes in the external ram for allocating
variables and passing parameters.
\series bold
---callee-saves function1[,function2][,function3]....
+---callee-saves function1[,function2][,function3]....
\series default
The compiler by default uses a caller saves convention for register saving
option is used for a library function the appropriate library function
needs to be recompiled with the same option.
If the project consists of multiple source files then all the source file
- should be compiled with the same --callee-saves option string.
+ should be compiled with the same ---callee-saves option string.
Also see #pragma\SpecialChar ~
CALLEE-SAVES.
\layout List
\series bold
---debug
+---debug
\bar under
\series default
\series bold
---peep-file
+---peep-file
\series default
<filename> This option can be used to use additional rules to be used by
the peep hole optimizer.
\series bold
---int-long-reent
+---int-long-reent
\series default
\size large
\series bold
---cyclomatic
+---cyclomatic
\bar under
\series default
\series bold
---float-reent
+---float-reent
\bar under
\series default
\series bold
---nooverlay
+---nooverlay
\series default
The compiler will not overlay parameters and local variables of any function,
see section Parameters and local variables for more details.
\series bold
---main-return
+---main-return
\series default
This option can be used when the code generated is called by a monitor
program.
\series bold
---no-peep
+---no-peep
\series default
Disable peep-hole optimization.
\layout List
\series bold
---peep-asm
+---peep-asm
\series default
Pass the inline assembler code through the peep hole optimizer.
This can cause unexpected changes to inline assembler code, please go through
\series bold
---iram-size
+---iram-size
\series default
<Value> Causes the linker to check if the internal ram usage is within limits
of the given value.
\series bold
---xram-size
+---xram-size
\series default
<Value> Causes the linker to check if the external ram usage is within limits
of the given value.
\series bold
---code-size
+---code-size
\series default
<Value> Causes the linker to check if the code usage is within limits of
the given value.
\series bold
---nostdincl
+---nostdincl
\series default
This will prevent the compiler from passing on the default include path
to the preprocessor.
\series bold
---nostdlib
+---nostdlib
\series default
This will prevent the compiler from passing on the default library path
to the linker.
\series bold
---verbose
+---verbose
\series default
Shows the various actions the compiler is performing.
\layout List
\series bold
---dumpraw
+---dumpraw
\series default
This option will cause the compiler to dump the intermediate code into
a file of named
\series bold
---dumpgcse
+---dumpgcse
\series default
Will create a dump of iCode's, after global subexpression elimination,
into a file named
\series bold
---dumpdeadcode
+---dumpdeadcode
\series default
Will create a dump of iCode's, after deadcode elimination, into a file
named
\series bold
---dumploop
+---dumploop
\series default
\size large
\series bold
---dumprange
+---dumprange
\series default
\size large
\series bold
---dumlrange
+---dumlrange
\series default
Will dump the life ranges for all symbols.
\layout List
\series bold
---dumpregassign
+---dumpregassign
\bar under
\series default
\series bold
---dumplrange
+---dumplrange
\series default
Will create a dump of the live ranges of iTemp's
\layout List
\series bold
---dumpall
+---dumpall
\size large
\bar under
\newline
They can be placed on the stack either by using the
\emph on
- --stack-auto
+ ---stack-auto
\emph default
option or by using the
\emph on
\emph default
keyword or the
\emph on
- --stack-auto
+ ---stack-auto
\emph default
option should be used sparingly.
Note that the reentrant keyword just means that the parameters & local
in internal ram.
When compiled with
\emph on
---stack-auto
+---stack-auto
\emph default
or when a function is declared as
\emph on
these operations then the support routines (as mentioned in a following
section) will have to be recompiled using the
\emph on
- --stack-auto
+ ---stack-auto
\emph default
option and the source file will need to be compiled using the
\emph on
---int-long-ren
+---int-long-ren
\emph default
t compiler option.
\layout Standard
be placed in a separate line (as the example shows).
When the
\emph on
---peep-asm
+---peep-asm
\emph default
command line option is used, the inline assembler code will be passed through
the peephole optimizer.
If this is unavoidable then the above routines will need to be compiled
with the
\emph on
---stack-auto
+---stack-auto
\emph default
option, after which the source program will have to be compiled with
\emph on
---int-long-rent
+---int-long-rent
\emph default
option.
\layout Subsection
\newline
Like the
\emph on
---model-large
+---model-large
\emph default
option, variables will by default be placed into the XDATA segment.
\newline
Segments may be placed anywhere in the 4 meg address space using the usual
- --*-loc options.
+ ---*-loc options.
Note that if any segments are located above 64K, the -r flag must be passed
to the linker to generate the proper segment relocations, and the Intel
HEX output format must be used.
SDCC_STACK_AUTO - this symbol is defined when
\emph on
---stack-auto
+---stack-auto
\emph default
option is used.
\layout Itemize
SDCC_MODEL_SMALL - when
\emph on
---model-small
+---model-small
\emph default
is used.
\layout Itemize
SDCC_MODEL_LARGE - when
\emph on
---model-large
+---model-large
\emph default
is used.
\layout Itemize
SDCC_USE_XSTACK - when
\emph on
---xstack
+---xstack
\emph default
option is used.
\layout Itemize
The compiler will generate a warning message when it is forced to allocate
extra space either on the stack or data space.
If this extra space allocation is undesirable then induction optimization
- can be eliminated either for the entire source file (with --noinduction
+ can be eliminated either for the entire source file (with ---noinduction
option) or for a given function only using #pragma\SpecialChar ~
NOINDUCTION.
\newline
A default set of rules are compiled into the compiler, additional rules
may be added with the
\emph on
---peep-file <filename>
+---peep-file <filename>
\emph default
option.
The rule language is best illustrated with examples.
\newline
Other special case optimizations may be added by the user (via
\emph on
---peep-file option
+---peep-file option
\emph default
).
E.g.
have some better means.
If you are looking at this file, you will also see the default rules that
are compiled into the compiler, you can add your own rules in the default
- set there if you get tired of specifying the --peep-file option.
+ set there if you get tired of specifying the ---peep-file option.
\layout Subsection
Pragmas
reduce code & improve run time performance of the generated code.
In future the compiler (with interprocedural analysis) will be able to
determine the appropriate scheme to use for each function call.
- If --callee-saves command line option is used, the function names specified
+ If ---callee-saves command line option is used, the function names specified
in #pragma\SpecialChar ~
CALLEE-SAVES is appended to the list of functions specified inthe
command line.
\emph default
to pass the first parameter to a routine.
The second parameter onwards is either allocated on the stack (for reentrant
- routines or if --stack-auto is used) or in the internal / external ram
+ routines or if ---stack-auto is used) or in the internal / external ram
(depending on the memory model).
\layout Subsubsection
The external stack is located at the start of the external ram segment,
and is 256 bytes in size.
- When --xstack option is used to compile the program, the parameters and
+ When ---xstack option is used to compile the program, the parameters and
local variables of all reentrant functions are allocated in this area.
This option is provided for programs with large stack space requirements.
- When used with the --stack-auto option, all parameters and local variables
+ When used with the ---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).
\layout Standard
\layout Standard
The amount of stack being used is affected by the use of the "internal stack"
- to save registers before a subroutine call is made (--stack-auto will declare
- parameters and local variables on the stack) and the number of nested subroutin
-es.
+ to save registers before a subroutine call is made (---stack-auto will
+ declare parameters and local variables on the stack) and the number of
+ nested subroutines.
\layout Standard
If you detect that the stack is over writing you data, then the following
can be done.
- --xstack will cause an external stack to be used for saving registers and
- (if --stack-auto is being used) storing parameters and local variables.
+ ---xstack will cause an external stack to be used for saving registers
+ and (if ---stack-auto is being used) storing parameters and local variables.
However this will produce more code which will be slower to execute.
\layout Standard
---stack-loc will allow you specify the start of the stack, i.e.
+---stack-loc will allow you specify the start of the stack, i.e.
you could start it after any data in the general purpose area.
However this may waste the memory not used by the register banks and if
the size of the "near data" increases, it may creep into the bottom of
the stack.
\layout Standard
---stack-after-data, similar to the --stack-loc, but it automatically places
+---stack-after-data, similar to the ---stack-loc, but it automatically places
the stack after the end of the "near data".
Again this could waste any spare register space.
\layout Standard
---data-loc allows you to specify the start address of the near data.
+---data-loc allows you to specify the start address of the near data.
This could be used to move the "near data" further away from the stack
giving it more room to grow.
This will only work if no bit variables are being used and the stack can
If you find that the stack is over writing your bit variables or "near data"
then the approach which best utilised the internal memory is to position
the "near data" after the last bank of used registers or, if you use bit
- variables, after the last bit variable by using the --data-loc, e.g.
- if two register banks are being used and no bit variables, --data-loc 16,
- and use the --stack-after-data option.
+ variables, after the last bit variable by using the ---data-loc, e.g.
+ if two register banks are being used and no bit variables, ---data-loc
+ 16, and use the ---stack-after-data option.
\layout Standard
If bit variables are being used, another method would be to try and squeeze
The intermediate code generation assumes the target machine has unlimited
number of registers, and designates them with the name iTemp.
The compiler can be made to dump a human readable form of the code generated
- by using the --dumpraw option.
+ by using the ---dumpraw option.
\layout Itemize
This phase does the bulk of the standard optimizations and is also MCU independe
How the Debugger Works
\layout Standard
-When the --debug option is specified the compiler generates extra symbol
+When the ---debug option is specified the compiler generates extra symbol
information some of which are put into the the assembler source and some
are put into the .cdb file, the linker updates the .cdb file with the address
information for the symbols.
Command Line Options.
\layout Itemize
---directory=<source file directory> this option can used to specify the
+---directory=<source file directory> this option can used to specify the
directory search list.
The debugger will look into the directory list specified for source, cdb
& ihx files.
The items in the directory list must be separated by ':', e.g.
if the source files can be in the directories /home/src1 and /home/src2,
- the --directory option should be --directory=/home/src1:/home/src2.
+ the ---directory option should be ---directory=/home/src1:/home/src2.
Note there can be no spaces in the option.
\layout Itemize
\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
--------\SpecialChar ~
+------\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
--------
+--------
\newline
;;
\newline
which reproduces the problem.
If you can isolate the problem by looking at the generated assembly code,
this can be very helpful.
- Compiling your program with the --dumpall option can sometimes be useful
+ Compiling your program with the ---dumpall option can sometimes be useful
in locating optimization problems.
\layout Section
xdata will be treated as a storage class specifier when parsing 8051 C
code but will be treated as a C identifier when parsing z80 or ATMEL AVR
C code.
-\layout Paragraph
+\layout Paragraph*
Generating iCode
\layout Standard
ICode is the term given to the intermediate form generated by the compiler.
ICode example section shows some examples of iCode generated for some simple
C source functions.
-\layout Paragraph
+\layout Paragraph*
Optimizations.
\layout Standard
The optimizations include constant propagation, common sub-expression eliminati
on, loop invariant code movement, strength reduction of loop induction variables
and dead-code elimination.
-\layout Paragraph
+\layout Paragraph*
Live range analysis
\layout Standard
The live ranges are computed in terms of these numbers.
The from number is the number of the iCode which first defines the operand
and the to number signifies the iCode which uses this operand last.
-\layout Paragraph
+\layout Paragraph*
Register Allocation
\layout Standard
There are other MCU specific considerations in this phase.
Some MCUs have an accumulator; very short-lived operands could be assigned
to the accumulator instead of general-purpose register.
-\layout Paragraph
+\layout Paragraph*
Code generation
\layout Standard
Some of the iCode operations are generated on a MCU specific manner for
example, the z80 port does not use registers to pass parameters so the
SEND and RECV iCode operations will not be generated, and it also does
- not support JUMPTABLES
-\layout Section*
+ not support JUMPTABLES.
+
+\newline
+\series bold
+\shape italic
+\color red
<Where is Figure II ?>
-\layout Paragraph
+\layout Paragraph*
ICode Example
\layout Standard
\newline
15.\SpecialChar ~
\SpecialChar ~
-for (i = 0, j = 10 ; i < 10 ; i++, j--) {
+for (i = 0, j = 10 ; i < 10 ; i++, j---) {
\newline
16.\SpecialChar ~
\SpecialChar ~
\newline
\shape italic
+\size footnotesize
Filename(linenumber: iCode Execution sequence number : ICode hash table
key : loop depth of the iCode).
-\newline
-
\shape default
+\size default
+
+\newline
Then follows the human readable form of the ICode operation.
Each operand of this triplet form can be of three basic types a) compiler
generated temporary b) user defined variable c) a constant value.
\newline
\shape italic
+\size footnotesize
Operand Name [lr live-from : live-to ] { type information } [ registers
allocated ].
-\newline
-
\shape default
+\size default
+
+\newline
As mentioned earlier the live ranges are computed in terms of the execution
sequence number of the iCodes, for example
\newline
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c (5:1:0:0) _entry($9) :
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(5:2:1:0) proc _function [lr0:0]{function short}
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(11:3:2:0) iTemp0 [lr3:5]{_near * int}[r2] = recv
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(11:4:53:0) preHeaderLbl0($11) :
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(11:5:55:0) iTemp6 [lr5:16]{_near * int}[r0] := iTemp0 [lr3:5]{_near
* int}[r2]
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(11:6:5:1) _whilecontinue_0($1) :
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(11:7:7:1) iTemp4 [lr7:8]{int}[r2 r3] = @[iTemp6 [lr5:16]{_near *
int}[r0]]
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(11:8:8:1) if iTemp4 [lr7:8]{int}[r2 r3] == 0 goto _whilebreak_0($3)
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(11:9:14:1) iTemp7 [lr9:13]{_far * int}[DPTR] := _p [lr0:0]{_far
* int}
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(11:10:15:1) _p [lr0:0]{_far * int} = _p [lr0:0]{_far * int} + 0x2
{short}
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(11:13:18:1) iTemp10 [lr13:14]{int}[r2 r3] = @[iTemp7 [lr9:13]{_far
* int}[DPTR]]
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(11:14:19:1) *(iTemp6 [lr5:16]{_near * int}[r0]) := iTemp10 [lr13:14]{int
}[r2 r3]
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(11:15:12:1) iTemp6 [lr5:16]{_near * int}[r0] = iTemp6 [lr5:16]{_near
* int}[r0] +
\layout Standard
-\family typewriter
+\size footnotesize
0x2 {short}
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(11:16:20:1) goto _whilecontinue_0($1)
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(11:17:21:0)_whilebreak_0($3) :
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(12:18:22:0) iTemp2 [lr18:40]{short}[r2] := 0x0 {short}
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(13:19:23:0) iTemp11 [lr19:40]{short}[r3] := 0x0 {short}
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(15:20:54:0)preHeaderLbl1($13) :
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(15:21:56:0) iTemp21 [lr21:38]{short}[r4] := 0x0 {short}
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(15:22:57:0) iTemp23 [lr22:38]{int}[r5 r6] := 0xa {int}
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(15:23:58:0) iTemp17 [lr23:38]{int}[r7 r0] := 0x1e {int}
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(15:24:26:1)_forcond_0($4) :
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(15:25:27:1) iTemp13 [lr25:26]{char}[CC] = iTemp21 [lr21:38]{short}[r4]
< 0xa {short}
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(15:26:28:1) if iTemp13 [lr25:26]{char}[CC] == 0 goto _forbreak_0($7)
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(16:27:31:1) iTemp2 [lr18:40]{short}[r2] = iTemp2 [lr18:40]{short}[r2]
+
\layout Standard
-\family typewriter
+\size footnotesize
ITemp21 [lr21:38]{short}[r4]
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(17:29:33:1) iTemp15 [lr29:30]{short}[r1] = iTemp21 [lr21:38]{short}[r4]
* 0x3 {short}
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(17:30:34:1) iTemp11 [lr19:40]{short}[r3] = iTemp11 [lr19:40]{short}[r3]
+
\layout Standard
-\family typewriter
+\size footnotesize
iTemp15 [lr29:30]{short}[r1]
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(18:32:36:1:1) iTemp17 [lr23:38]{int}[r7 r0]= iTemp17 [lr23:38]{int}[r7
r0]- 0x3 {short}
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(18:33:37:1) _gint [lr0:0]{int} = _gint [lr0:0]{int} + iTemp17 [lr23:38]{
int}[r7 r0]
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(15:36:42:1) iTemp21 [lr21:38]{short}[r4] = iTemp21 [lr21:38]{short}[r4]
+ 0x1 {short}
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(15:37:45:1) iTemp23 [lr22:38]{int}[r5 r6]= iTemp23 [lr22:38]{int}[r5
r6]- 0x1 {short}
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(19:38:47:1) goto _forcond_0($4)
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(19:39:48:0)_forbreak_0($7) :
\layout Standard
-\family typewriter
+\size footnotesize
Sample.c(20:40:49:0) iTemp24 [lr40:41]{short}[DPTR] = iTemp2 [lr18:40]{short}[r2]
+
\layout Standard
-\family typewriter
+\size footnotesize
ITemp11 [lr19:40]{short}[r3]
\layout Standard
-\family typewriter
+\size footnotesize
sample.c(20:41:50:0) ret iTemp24 [lr40:41]{short}
\layout Standard
-\family typewriter
+\size footnotesize
sample.c(20:42:51:0)_return($8) :
\layout Standard
-\family typewriter
+\size footnotesize
sample.c(20:43:52:0) eproc _function [lr0:0]{ ia0 re0 rm0}{function short}
-\newline
+\size default
-\family default
+\newline
\newline
Finally the code generated for this function:
\layout Standard
-\family typewriter
+\size footnotesize
.area DSEG (DATA)
\layout Standard
-\family typewriter
+\size footnotesize
_p::
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
.ds 2
\layout Standard
-\family typewriter
+\size footnotesize
_gint::
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
.ds 2
\layout Standard
-\family typewriter
+\size footnotesize
; sample.c 5
\layout Standard
-\family typewriter
-; -----------------------------------------
+\size footnotesize
+; ----------------------------------------------
\layout Standard
-\family typewriter
+\size footnotesize
; function function
\layout Standard
-\family typewriter
-; -----------------------------------------
+\size footnotesize
+; ----------------------------------------------
\layout Standard
-\family typewriter
+\size footnotesize
_function:
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp0 [lr3:5]{_near * int}[r2] = recv
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov r2,dpl
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp6 [lr5:16]{_near * int}[r0] := iTemp0 [lr3:5]{_near * int}[r2]
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov ar0,r2
\layout Standard
-\family typewriter
+\size footnotesize
;_whilecontinue_0($1) :
\layout Standard
-\family typewriter
+\size footnotesize
00101$:
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp4 [lr7:8]{int}[r2 r3] = @[iTemp6 [lr5:16]{_near * int}[r0]]
\layout Standard
-\family typewriter
+\size footnotesize
; if iTemp4 [lr7:8]{int}[r2 r3] == 0 goto _whilebreak_0($3)
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov ar2,@r0
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
inc r0
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov ar3,@r0
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
dec r0
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov a,r2
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
orl a,r3
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
jz 00103$
\layout Standard
-\family typewriter
+\size footnotesize
00114$:
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp7 [lr9:13]{_far * int}[DPTR] := _p [lr0:0]{_far * int}
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov dpl,_p
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov dph,(_p + 1)
\layout Standard
-\family typewriter
+\size footnotesize
; _p [lr0:0]{_far * int} = _p [lr0:0]{_far * int} + 0x2 {short}
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov a,#0x02
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
add a,_p
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov _p,a
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
clr a
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
addc a,(_p + 1)
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov (_p + 1),a
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp10 [lr13:14]{int}[r2 r3] = @[iTemp7 [lr9:13]{_far * int}[DPTR]]
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
movx a,@dptr
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov r2,a
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
inc dptr
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
movx a,@dptr
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov r3,a
\layout Standard
-\family typewriter
+\size footnotesize
; *(iTemp6 [lr5:16]{_near * int}[r0]) := iTemp10 [lr13:14]{int}[r2 r3]
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov @r0,ar2
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
inc r0
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov @r0,ar3
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp6 [lr5:16]{_near * int}[r0] =
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp6 [lr5:16]{_near * int}[r0] +
\layout Standard
-\family typewriter
+\size footnotesize
; 0x2 {short}
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
inc r0
\layout Standard
-\family typewriter
+\size footnotesize
; goto _whilecontinue_0($1)
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
sjmp 00101$
\layout Standard
-\family typewriter
+\size footnotesize
; _whilebreak_0($3) :
\layout Standard
-\family typewriter
+\size footnotesize
00103$:
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp2 [lr18:40]{short}[r2] := 0x0 {short}
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov r2,#0x00
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp11 [lr19:40]{short}[r3] := 0x0 {short}
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov r3,#0x00
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp21 [lr21:38]{short}[r4] := 0x0 {short}
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov r4,#0x00
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp23 [lr22:38]{int}[r5 r6] := 0xa {int}
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov r5,#0x0A
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov r6,#0x00
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp17 [lr23:38]{int}[r7 r0] := 0x1e {int}
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov r7,#0x1E
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov r0,#0x00
\layout Standard
-\family typewriter
+\size footnotesize
; _forcond_0($4) :
\layout Standard
-\family typewriter
+\size footnotesize
00104$:
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp13 [lr25:26]{char}[CC] = iTemp21 [lr21:38]{short}[r4] < 0xa {short}
\layout Standard
-\family typewriter
+\size footnotesize
; if iTemp13 [lr25:26]{char}[CC] == 0 goto _forbreak_0($7)
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
clr c
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov a,r4
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
xrl a,#0x80
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
subb a,#0x8a
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
jnc 00107$
\layout Standard
-\family typewriter
+\size footnotesize
00115$:
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp2 [lr18:40]{short}[r2] = iTemp2 [lr18:40]{short}[r2] +
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp21 [lr21:38]{short}[r4]
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov a,r4
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
add a,r2
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov r2,a
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp15 [lr29:30]{short}[r1] = iTemp21 [lr21:38]{short}[r4] * 0x3 {short}
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov b,#0x03
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov a,r4
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mul ab
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov r1,a
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp11 [lr19:40]{short}[r3] = iTemp11 [lr19:40]{short}[r3] +
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp15 [lr29:30]{short}[r1]
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
add a,r3
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov r3,a
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp17 [lr23:38]{int}[r7 r0]= iTemp17 [lr23:38]{int}[r7 r0]- 0x3 {short}
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov a,r7
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
add a,#0xfd
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov r7,a
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov a,r0
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
addc a,#0xff
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov r0,a
\layout Standard
-\family typewriter
+\size footnotesize
; _gint [lr0:0]{int} = _gint [lr0:0]{int} + iTemp17 [lr23:38]{int}[r7 r0]
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov a,r7
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
add a,_gint
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov _gint,a
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov a,r0
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
addc a,(_gint + 1)
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov (_gint + 1),a
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp21 [lr21:38]{short}[r4] = iTemp21 [lr21:38]{short}[r4] + 0x1 {short}
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
inc r4
\layout Standard
-\family typewriter
+\size footnotesize
; iTemp23 [lr22:38]{int}[r5 r6]= iTemp23 [lr22:38]{int}[r5 r6]- 0x1 {short}
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
dec r5
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
cjne r5,#0xff,00104$
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
dec r6
\layout Standard
-\family typewriter
+\size footnotesize
; goto _forcond_0($4)
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
sjmp 00104$
\layout Standard
-\family typewriter
+\size footnotesize
; _forbreak_0($7) :
\layout Standard
-\family typewriter
+\size footnotesize
00107$:
\layout Standard
-\family typewriter
+\size footnotesize
; ret iTemp24 [lr40:41]{short}
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov a,r3
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
add a,r2
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
mov dpl,a
\layout Standard
-\family typewriter
+\size footnotesize
; _return($8) :
\layout Standard
-\family typewriter
+\size footnotesize
00108$:
\layout Standard
-\family typewriter
+\size footnotesize
\SpecialChar ~
\SpecialChar ~
ret
-\family default
+\size default
\newline