Example: bachelor of science

SDCC Compiler User Guide

SDCC Compiler User Guide SDCC $Date:: 2022-01-02 #$. $Revision: 12834 $. Contents 1 Introduction 7. About SDCC .. 7. SDCC Suite Licenses .. 8. Documentation .. 9. Typographic conventions .. 9. Compatibility with previous versions .. 9. System Requirements .. 12. Other Resources .. 12. 2 Installing SDCC 13. Configure Options .. 13. Install paths .. 15. Search Paths .. 16. Building SDCC .. 18. Building SDCC on Linux .. 18. Building SDCC on Mac OS X .. 19. Cross compiling SDCC on Linux for Windows .. 19. Building SDCC using Cygwin and Mingw32 .. 19. Building SDCC Using Microsoft Visual C++ 2010 (MSVC) .. 20. Windows Install Using a ZIP Package .. 21. Windows Install Using the Setup Program .. 21. VPATH feature .. 21. Building the Documentation.

May 02, 2022 · CONTENTS CONTENTS 3.1.7 Implementation-defined behavior. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 3.1.7.1 Translation ...

Tags:

  Dscc

Information

Domain:

Source:

Link to this page:

Please notify us if you found a problem with this document:

Other abuse

Transcription of SDCC Compiler User Guide

1 SDCC Compiler User Guide SDCC $Date:: 2022-01-02 #$. $Revision: 12834 $. Contents 1 Introduction 7. About SDCC .. 7. SDCC Suite Licenses .. 8. Documentation .. 9. Typographic conventions .. 9. Compatibility with previous versions .. 9. System Requirements .. 12. Other Resources .. 12. 2 Installing SDCC 13. Configure Options .. 13. Install paths .. 15. Search Paths .. 16. Building SDCC .. 18. Building SDCC on Linux .. 18. Building SDCC on Mac OS X .. 19. Cross compiling SDCC on Linux for Windows .. 19. Building SDCC using Cygwin and Mingw32 .. 19. Building SDCC Using Microsoft Visual C++ 2010 (MSVC) .. 20. Windows Install Using a ZIP Package .. 21. Windows Install Using the Setup Program .. 21. VPATH feature .. 21. Building the Documentation.

2 22. Reading the Documentation .. 22. Testing the SDCC Compiler .. 22. Install Trouble-shooting .. 23. If SDCC does not build correctly .. 23. What the ./configure does .. 23. What the make does .. 23. What the make install command does.. 23. Components of SDCC .. 24. sdcc - The Compiler .. 25. sdcpp - The C-Preprocessor .. 25. sdas, sdld - The Assemblers and Linkage Editors .. 25. s51, sz80, shc08, sstm8 - The Simulators .. 25. sdcdb - Source Level Debugger .. 25. 3 Using SDCC 26. Standard-Compliance .. 26. ISO C90 and ANSI C89 .. 26. ISO C95 .. 27. ISO C99 .. 27. ISO C11 and ISO C17 .. 27. ISO C2X .. 27. Embedded C .. 27. 1. CONTENTS CONTENTS. Implementation-defined behavior .. 27. Translation .. 27. Environment .. 27. Identifiers .. 27.

3 Characters .. 28. Integers .. 28. Floating point .. 28. Arrays and Pointers .. 28. Hints .. 28. Structures, unions, enumerations and bit-fields .. 28. Qualifiers .. 28. Preprocessing directives .. 28. Library functions .. 29. Architecture .. 29. Compiling .. 29. Single Source File Projects .. 29. Postprocessing the Intel Hex file .. 30. Projects with Multiple Source Files .. 30. Projects with Additional Libraries .. 31. Using sdar to Create and Manage Libraries .. 31. Command Line Options .. 31. Processor Selection Options .. 31. Preprocessor Options .. 32. Optimization Options .. 33. Other Options .. 34. Linker Options .. 36. MCS51 Options .. 37. DS390 / DS400 Options .. 37. Options common to all z80-related ports (z80, z180, r2k, r3ka, sm83, tlcs90, ez80_z80).

4 38. Z80 Options (apply to z80, z180, r2k, r3ka, tlcs90, ez80_z80) .. 38. SM83 Options .. 38. STM8 Options .. 38. Intermediate Dump Options .. 38. Redirecting output on Windows Shells .. 39. Environment variables .. 39. SDCC Language Extensions .. 39. MCS51/DS390 intrinsic named address spaces .. 39. __data / __near .. 40. __xdata / __far .. 40. __idata .. 40. __pdata .. 40. __code .. 41. __bit .. 41. __sfr / __sfr16 / __sfr32 / __sbit .. 41. Pointers to MCS51/DS390 intrinsic named address spaces .. 42. Notes on MCS51 memory layout .. 42. Z80/Z180/eZ80 intrinsic named address spaces .. 43. __sfr (in/out to 8-bit addresses) .. 43. __banked __sfr (in/out to 16-bit addresses) .. 43. __sfr (in0/out0 to 8 bit addresses on Z180/HD64180) .. 43.

5 HC08/S08 intrinsic named address spaces .. 43. __data .. 43. __xdata .. 44. PDK14/PDK15 intrinsic named address spaces .. 44. __sfr .. 44. __sfr16 .. 44. 2. CONTENTS CONTENTS. Non-intrinsic named address spaces .. 44. Absolute Addressing .. 45. Preserved register specification .. 46. Binary constants .. 46. Returning void .. 46. Omitting promotion on arguments of vararg function (does not apply to pdk13, pdk14, pdk15) 46. Parameters and Local Variables .. 46. Overlaying .. 47. Interrupt Service Routines .. 47. General Information .. 47. Common interrupt pitfall: variable not declared volatile .. 48. Common interrupt pitfall: non-atomic access .. 48. Common interrupt pitfall: stack overflow .. 48. Common interrupt pitfall: use of non-reentrant functions.

6 48. MCS51/DS390 Interrupt Service Routines .. 48. HC08 Interrupt Service Routines .. 49. Z80, Z180 and eZ80 Interrupt Service Routines .. 49. Rabbit 2000, 3000 and 3000A Interrupt Service Routines .. 49. SM83 and TLCS-90 Interrupt Service Routines .. 50. STM8 Interrupt Service Routines .. 50. Enabling and Disabling Interrupts .. 50. Critical Functions and Critical Statements .. 50. Enabling and Disabling Interrupts directly .. 50. Semaphore locking (mcs51/ds390) .. 51. Functions using private register banks (mcs51/ds390) .. 51. Inline Assembler Code .. 52. Inline Assembler Code Formats .. 52. Old __asm .. __endasm; Format .. 52. New __asm__ ( inline_assembler_code ) Format .. 52. A Step by Step Introduction .. 52. Naked Functions .. 54.

7 Use of Labels within Inline Assembler .. 55. Support routines for integer multiplicative operators .. 56. Floating Point Support .. 56. Library Routines .. 57. Compiler support routines (_gptrget, _mulint etc.) .. 57. Stdclib functions (puts, printf, strcat etc.) .. 57. < > .. 57. < > .. 58. Math functions (sinf, powf, sqrtf etc.) .. 58. < > .. 58. Other libraries .. 59. Memory Models .. 59. MCS51 Memory Models .. 59. Small, Medium, Large and Huge .. 59. External Stack .. 59. DS390 Memory Model .. 59. STM8 Memory Models .. 60. Pragmas .. 60. Defines Created by the Compiler .. 63. 3. CONTENTS CONTENTS. 4 Notes on supported Processors 65. MCS51 variants .. 65. pdata access by SFR .. 65. Other Features available by SFR .. 65. Bankswitching.

8 65. Hardware .. 66. Software .. 66. MCS51/DS390 Startup Code .. 66. Interfacing with Assembler Code .. 69. Global Registers used for Parameter Passing .. 69. Register usage .. 69. Assembler Routine (non-reentrant) .. 69. Assembler Routine (reentrant) .. 70. DS400 port .. 71. The Z80, Z180, Rabbit 2000, Rabbit 2000A, Rabbit 3000A, SM83 (GameBoy), eZ80 and TLCS-90. ports .. 71. Startup Code .. 71. Rabbit ports .. 71. Rabbit wait states .. 71. Z80, Z180 and Z80N calling conventions .. 71. Z80 SDCC calling convention, version 1 .. 72. Z80 SDCC calling convention, version 0 .. 72. Rabbit 2000, Rabbit 2000A, Rabbit 3000A, eZ80 and TLCS-90 calling conventions .. 72. Rabbit SDCC calling convention, version 1 .. 72. SM83 calling conventions .. 73.

9 SM83 SDCC calling convention, version 1 .. 73. SM83 SDCC calling convention, version 0 .. 73. Small-C calling convention .. 73. Complex instructions .. 73. Unsafe reads .. 73. Z80 banked calls .. 74. The HC08 and S08 ports .. 74. Startup Code .. 74. The STM8 port .. 74. Calling conventions .. 74. SDCC calling convention, version 1 .. 74. SDCC calling convention, version 0 .. 74. Raisonance calling convention .. 74. IAR calling convention .. 75. Cosmic calling convention .. 75. The PIC14 port .. 75. PIC Code Pages and Memory Banks .. 76. Adding New Devices to the Port .. 77. Interrupt Code .. 77. Configuration Bits .. 77. Linking and Assembling .. 77. Command-Line Options .. 78. Environment Variables .. 78. The Library .. 78. Enhanced cores.

10 79. Accessing bits of special function registers .. 79. Naming of special function registers .. 79. error: missing definition for symbol __gptrget1 .. 79. Processor mismatch in file XXX .. 79. Known Bugs .. 79. Function arguments .. 79. 4. CONTENTS CONTENTS. Regression tests fail .. 79. The PIC16 port .. 80. Global Options .. 81. Port Specific Options .. 81. Code Generation Options .. 82. Optimization Options .. 82. Assembling Options .. 82. Linking Options .. 82. Debugging Options .. 83. Environment Variables .. 83. Preprocessor Macros .. 83. Directories .. 83. Pragmas .. 84. Header Files and Libraries .. 85. Header Files .. 86. Libraries .. 86. Adding New Devices to the Port .. 86. Memory Models .. 87. Stack .. 87. Functions .. 88. Function return values.


Related search queries