#ifndef CO
#define CO
typedef struct Continuation * Co;
typedef void (*Routine)(Co);

#define Do(CO,NOW) do { Routine DOTMP = (CO)->routine; (CO)->routine = (NOW); while((CO)->routine != 0) { Routine fn = (CO)->routine; (CO)->routine = 0; fn((CO)); } (CO)->routine = DOTMP; } while(0)

#define Deed(co,routines) do { for (int i=0;(routines)[i] != 0; i++) { Do((co),(routines)[i]); } } while(0)

#define Next(CO,NOW) do { (CO)->routine = (NOW); } while(0)


/* 
8bits fun
when 16bits is required , 
explicitly define a type for it
for 6502 int is 16bits signed 
*/
#define MAX 100
typedef unsigned char Let;
typedef unsigned short Cnt;

#endif
