Skip to content

Inline assembler

suborb edited this page Sep 28, 2019 · 1 revision

The Inline Assembler

The inline Assembler permits to easily include machine code portions in a C source:

   int one_hundred()
   {
      __asm
      ld hl,100
      __endasm;
   }

Caveats

The optimizer is active on the inline portions of code, too. When compiling with zsdcc including inline assembler will clobber certain rules.

It's thus recommended to isolate assembler into a separate file and include it via linking rather than inline assembly.

Clone this wiki locally
You can’t perform that action at this time.