CREATE - create a co-routine.

Usage:

B:
   fcv = create( [stack, [space,]] function, [a1, a2...] )
C:
   void *create(int stack, int space, void *function, ...);

Where:

fcv
is a pointer to the co-routine descriptor.
stack
is the amount of stack space to allocate for the co-routine. The default is 100 words.
space
is the amount of user co-routine descriptor space. This space is referenced by fcv[N] (N>=0). The default is 0 words.
function
is the function where the co-routine is to begin execution.
a1, a2...
are the arguments for "function".

Description:

CREATE creates a co-routine and returns a pointer to the function control vector. When control is initially passed to the co-routine, it is entered at the entry point to "function" with "a1", "a2", etc. set up as the arguments. ("nargs" will work correctly).

Note that the B run-time library may require up to 225 words of stack when performing I/O, so if the co-routine is to do any I/O, the stack size should be increased.

Copyright © 1996, Thinkage Ltd.