Next:
3.1 Standard-Compliance
Up:
SDCC Compiler User Guide
Previous:
2.9.5 sdcdb - Source
Contents
Index
3
. Using SDCC
Subsections
3
.
1
Standard-Compliance
3
.
1
.
1
ISO C90 and ANSI C89
3
.
1
.
2
ISO C95
3
.
1
.
3
ISO C99
3
.
1
.
4
ISO C11
3
.
1
.
5
Embedded C
3
.
2
Compiling
3
.
2
.
1
Single Source File Projects
3
.
2
.
2
Postprocessing the Intel Hex file
3
.
2
.
3
Projects with Multiple Source Files
3
.
2
.
4
Projects with Additional Libraries
3
.
2
.
5
Using sdar to Create and Manage Libraries
3
.
2
.
6
Using sdcclib to Create and Manage Libraries (deprecated)typeset@protect @@footnote SF@gobble@opt With SDCC version 3.2.0 the sdcclib utility is deprecated. Sdar utility should be used to create sdcc object file archives. Sdcclib utility will become obsolete in one of next sdcc releases and will be removed from sdcc packages.
3
.
3
Command Line Options
3
.
3
.
1
Processor Selection Options
3
.
3
.
2
Preprocessor Options
3
.
3
.
3
Optimization Options
3
.
3
.
4
Other Options
3
.
3
.
5
Linker Options
3
.
3
.
6
MCS51 Options
3
.
3
.
7
DS390 / DS400 Options
3
.
3
.
8
Options common to all z80-related ports (z80, z180, r2k, r3ka, gbz80)
3
.
3
.
9
Z80 Options (apply to z80, z180, r2k and r3ka port)
3
.
3
.
10
GBZ80 Options
3
.
3
.
11
Intermediate Dump Options
3
.
3
.
12
Redirecting output on Windows Shells
3
.
4
Environment variables
3
.
5
SDCC Language Extensions
3
.
5
.
1
MCS51/DS390 intrinsic named address spaces
3
.
5
.
1
.
1
__data / __near
3
.
5
.
1
.
2
__xdata / __far
3
.
5
.
1
.
3
__idata
3
.
5
.
1
.
4
__pdata
3
.
5
.
1
.
5
__code
3
.
5
.
1
.
6
__bit
3
.
5
.
1
.
7
__sfr / __sfr16 / __sfr32 / __sbit
3
.
5
.
1
.
8
Pointers to MCS51/DS390 intrinsic named address spaces
3
.
5
.
1
.
9
Notes on MCS51 memory layout
3
.
5
.
2
Z80/Z180 intrinsic named address spaces
3
.
5
.
2
.
1
__sfr (in/out to 8-bit addresses)
3
.
5
.
2
.
2
__banked __sfr (in/out to 16-bit addresses)
3
.
5
.
2
.
3
__sfr (in0/out0 to 8 bit addresses on Z180/HD64180)
3
.
5
.
3
HC08/S08 intrinsic named address spaces
3
.
5
.
3
.
1
__data
3
.
5
.
3
.
2
__xdata
3
.
5
.
4
Non-intrinsic named address spaces
3
.
5
.
5
Absolute Addressing
3
.
5
.
6
Preserved register specification
3
.
5
.
7
Binary constants
3
.
5
.
8
Returning void
3
.
5
.
9
Omitting promotion on arguments of vararg function
3
.
6
Parameters and Local Variables
3
.
7
Overlaying
3
.
8
Interrupt Service Routines
3
.
8
.
1
General Information
3
.
8
.
1
.
1
Common interrupt pitfall: variable not declared
volatile
3
.
8
.
1
.
2
Common interrupt pitfall:
non-atomic access
3
.
8
.
1
.
3
Common interrupt pitfall:
stack overflow
3
.
8
.
1
.
4
Common interrupt pitfall:
use of non-reentrant functions
3
.
8
.
2
MCS51/DS390 Interrupt Service Routines
3
.
8
.
3
HC08 Interrupt Service Routines
3
.
8
.
4
Z80 and Z180 Interrupt Service Routines
3
.
8
.
5
Rabbit 2000, 3000, 3000A and 4000 Interrupt Service Routines
3
.
8
.
6
GBZ80 and TLCS-90 Interrupt Service Routines
3
.
8
.
7
STM8 Interrupt Service Routines
3
.
9
Enabling and Disabling Interrupts
3
.
9
.
1
Critical Functions and Critical Statements
3
.
9
.
2
Enabling and Disabling Interrupts directly
3
.
9
.
3
Semaphore locking (mcs51/ds390)
3
.
10
Functions using private register banks(mcs51/ds390)
3
.
11
Inline Assembler Code
3
.
11
.
1
Inline Assembler Code Formats
3
.
11
.
1
.
1
Old __asm ... __endasm; Format
3
.
11
.
1
.
2
New __asm__ (”inline_assembler_code”) Format
3
.
11
.
2
A Step by Step Introduction
3
.
11
.
3
Naked Functions
3
.
11
.
4
Use of Labels within Inline Assembler
3
.
12
Interfacing with Assembler Code
3
.
12
.
1
Global Registers used for Parameter Passing (8051)
3
.
12
.
2
Registers usage (8051)
3
.
12
.
3
Assembler Routine (non-reentrant) (8051)
3
.
12
.
4
Assembler Routine (reentrant) (8051)
3
.
12
.
5
Small-C calling convention
3
.
13
Support routines for integer multiplicative operators
3
.
14
Floating Point Support
3
.
15
Library Routines
3
.
15
.
1
Compiler support routines (_gptrget, _mulint etc.)
3
.
15
.
2
Stdclib functions (puts, printf, strcat etc.)
3
.
15
.
2
.
1
<stdio.h>
3
.
15
.
2
.
1
.
1
getchar(), putchar()
3
.
15
.
2
.
1
.
2
printf()
3
.
15
.
2
.
2
<malloc.h>
3
.
15
.
3
Math functions (sinf, powf, sqrtf etc.)
3
.
15
.
3
.
1
<math.h>
3
.
15
.
4
Other libraries
3
.
16
Memory Models
3
.
16
.
1
MCS51 Memory Models
3
.
16
.
1
.
1
Small, Medium, Large and Huge
3
.
16
.
1
.
2
External Stack
3
.
16
.
2
DS390 Memory Model
3
.
17
Pragmas
3
.
18
Defines Created by the Compiler