• sdcc
  • sccz80
  • Making code faster without rewriting it
  • Sample results
  • Making code smaller
  • Tips
  • Use unsigned where possible (sccz80, zsdcc)
  • Prefer unsigned char (sccz80, zsdcc)
  • Switch on a char (sccz80)
  • Operate with a constant value (sccz80)
  • Constant ordering (sccz80)
  • Prefer pre- to post-increment/decrement (sccz80)
  • When possible use static variables (sccz80/zsdcc)
  • Avoid long lists of function parameters (sccz80/zsdcc)
  • Use types of appropriate size (sccz80/zsdcc)
  • Demote larger types to smaller types as soon as possible (sccz80/zsdcc)
  • Declare most frequently used variables last (sccz80)
  • Use (in)equality operators by preference (sccz80)
  • Avoid inserting debugging code (sccz80)
  • Use the __z88dk_fastcall calling convention (sccz80, zsdcc)
  • Use __z88dk_callee calling convention (sccz80, sdcc)
  • Compute things once and store the result (sccz80/zsdcc)
  • Assign data to appropriate sections (sccz80/zsdcc)
  • Do not reinvent the wheel
  • Split your libraries in modules
  • Classic Library
  • Disable std*
  • Switch to an alternate console driver
  • Disable unused graphics modes
  • Link to the dummy fcntl library
  • Switch maths library implementations
  • Don't initialise BSS memory
  • Disable/reduce the atexit stack
  • Newlib
  • Ensure that the minimal crt required is selected
  • Modify the crt to change font
  • Configure the library and crt