Discova
Back to cards
Programming1 min readWikipedia, updated 28 November 2026

Small Device C Compiler

C compiler for microcontrollers

The Small Device C Compiler (SDCC) is a free-software, partially retargetable C compiler for 8-bit microcontrollers. It is distributed under the GNU General Public License. The package also contains an assembler, linker, simulator and debugger. SDCC is a popular open-source C compiler for microcontrollers compatible with Intel 8051/MCS-51.

Version 4.6.0 added e.g. "C2y _Countof operator", octal, and if-declaration, "Conditional operator with omitted second operand (originally a GNU extension)"; C23 compound literals with storage class specifiers and "C23 constexpr (mostly)"


Supported hosts

Sources, documentation, and binaries are available for Linux (32-bit and 64-bit), macOS (PPC and 64-bit), and Windows (32-bit and 64-bit).

Supported targets

The following include binary compatible derivatives:

  • Intel 8031, 8032, 8051, 8052; Maxim/Dallas DS80C390; C8051
  • Motorola/Freescale/NXP 68HC08 and S08
  • Padauk PDK14 and PDK15
  • Sharp SM83, the CPU found in the Nintendo Game Boy LR35902 SoC
  • STMicroelectronics STM8
  • Zilog Z80, Z180, eZ80 in Z80 mode; Rabbit Semiconductor 2000, 2000A, 3000, 3000A, 4000, 6000; Toshiba TLCS-90; Z80N (ZX Spectrum Next processor), R800.
  • MOS Technology 6502, WDC 65C02.

Work in progress:

  • Microchip PIC16 and PIC18.
  • Padauk PDK13.

Obsolete:

  • AVR microcontrollers used to be a supported target, but was made obsolete by avr-gcc in 2010 (SDCC 3.0.0).

Adapted from the Wikipedia article, CC BY-SA 4.0. Continue on Wikipedia

Go deeper

Ideas this article links to.