# 3.5 SDCC Language Extensions

SDCC supports some language extensions useful for embedded systems. These include named address spaces (see also section 5.1 of the Embedded C standard). SDCC supports both intrinsic named address spaces (which ones are supported depends on the target architecture) and non-intrinsic named address spaces (defined by the user using the keyword __addressmod, they are particularly useful with custom bank-switching hardware). Unlike the Embedded C standard, SDCC allows local variables to have an intrinsic named address space even when not explicitly declared as static or extern. Depending on the target architecture, support can be limited to objects in such address spaces and exclude pointer-based access to those.

Subsections

- 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/eZ80 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 SM83 intrinsic named address spaces
  - 3.5.3.1 __sfr
- 3.5.4 HC08/S08 intrinsic named address spaces
  - 3.5.4.1 __data
  - 3.5.4.2 __xdata
- 3.5.5 PDK14/PDK15 intrinsic named address spaces
  - 3.5.5.1 __sfr
  - 3.5.5.2 __sfr16
- 3.5.6 Non-intrinsic named address spaces
- 3.5.7 Absolute Addressing
- 3.5.8 __sdcc_external_startup
- 3.5.9 Preserved register specification
- 3.5.10 Binary constants
- 3.5.11 Returning void
- 3.5.12 Omitting promotion on arguments of vararg function (does not apply to pdk13, pdk14, pdk15)