Implementation of green threads in C and assembly