User guide

4.3. COMMANDS 105
or global vector. There are thus 16 posible states a task can have of which only six
indicate that it is runnable, they are as follows.
#b0000
This task is runnable but has no packet on its work queue. It is either the current
task or it gave up control voluntarily by for instance sendi ng a packet to a higher
priority task. W he n it next gains control it will immediately return from the
function that caused it to give up control.
#b0001
This is just like t he case above except there is a packet on its work queue.
#b0101
This indicates that the task is waiting for a packet and that one has ar r i ved.
It is thus runnable and whe n given control the first packet on its work queue
will be dequeued and returned as the result of the taskwait call that caused its
suspension.
#b1000
This indicates the task is in interr upt e d state with an empty work queue. It is
thus runnable and when gi ven control it will resume execution using the Cintcode
register values save in the TCB when it was interrupted.
#b1001
This indicate s the task is in interrupted state with a non empty work queue.
It is thus runnable and when given control it will resume execution using the
Cintcode register values save in the TCB when it was interrupted.
#b1101
This is a task in DEAD state (with n o stack or global vector) but it now has a
startup packet on its work queue. It is thus runnable and when given control will
be initialised with a new stack and global vector and its main function start
in global variable 1 will be called with the startup packet as its first argument.
This packet will have been dequeued.
4.3 Commands
This secti on describes the Command Language Interpreter commands whose source
code can be found in either cintcode/com or cintpos/com. The rdargs argument
format string for each com mand is given.
abort NUMBER CIN:y, POS:y, NAT:y
The command: abort n calls the BLIB function abort with argument n. If n is
zero, this causes a successful return from the BCPL system. If n is non zero, the
interactive debugger is entered with fault code n. The def aul t value for n is 99. The
interactive debugger is described i n section 7.