When writing code to be compiled with SDCC targetting Z80, assembler code fragments can be inserted in the C functions by enclosing them between the __asm and __endasm; tags:
void DoNotDisturb()
{
__asm
di
| /* A tiny BASIC interpreter */ | |
| // heavily modified from: | |
| // https://gist.github.com/pmachapman/661f0fff9814231fde48 | |
| // | |
| // Now it works with doubles instead of ints. Also fixed some bugs. | |
| #include <string.h> | |
| #include <stdio.h> | |
| #include <setjmp.h> |