Stm8 support.

STM8 is an 8-bit processor, see also:


Since there are so few registers, one possible approach is to emulate registers in the first 16 or 32 bytes of ram. We can then use these ram locations as ‘registers’ and do register allocation and instruction selection using these ‘registers’. This way, we treat the stm8 as a risc machine with many registers, while in reality it is not.

Calling conventions

There is not really a standard calling convention for the stm8 processor.

Since the stm8 has only few registers, a calling convention must place most arguments on stack.

class ppci.arch.stm8.Stm8Arch(options=None)

STM8 architecture description.


Calling convention in priority order:

  • Pointers in index registers;
  • 16-bit variables in index registers;
  • 8-bit variables in accumulator register first, afterwards in index registers.