cscg22-gearboy

CSCG 2022 Challenge 'Gearboy'
git clone https://git.sinitax.com/sinitax/cscg22-gearboy
Log | Files | Refs | sfeed.txt

stdarg.h (520B)


      1#ifndef ASM_Z80_STDARG_INCLUDE
      2#define ASM_Z80_STDARG_INCLUDE
      3
      4/* sdcc pushes right to left with the real sizes, not cast up
      5   to an int.
      6   so printf(int, char, long)
      7   results in push long, push char, push int
      8   On the z80 the stack grows down, so the things seem to be in
      9   the correct order.
     10 */
     11
     12typedef unsigned char * va_list;
     13#define va_start(list, last)	list = (unsigned char *)&last + sizeof(last)
     14#define va_arg(list, type)	*((type *)((list += sizeof(type)) - sizeof(type)))
     15
     16#define va_end(list)
     17
     18#endif