Envoy Application Programming Manual

Table Of Contents
TINET Multipoint Supervisor Protocol
Envoy Application Programming Manual427159-001
8-36
Steps of Example Program
Example 8-15. Program Code for TINET Multipoint Supervisor (Page 4 of 13)
! task definition.
! Each terminal is controlled by a separate "task." Control
! information for a task is kept in its "task control
! block." A task control block entry (and, therefore, a
! task is referenced by its "id"; a task’s id is the same as
! the corresponding terminal’s address-list entry number in
! the poll list.
LITERAL
cb^len = 6, ! task control block entry length.
in^max = 32, ! task’s inbuffer size.
out^max = 32, ! task’s outbuffer size.
call^space = 32; ! space for nonsystem calls.
! task control block definition.
INT .term^cb[ -cb^len : poll^count * cb^len - 1 ];
DEFINE
return^p = term^cb[ id * cb^len + 0 ]#, ! return p entry.
return^e = term^cb[ id * cb^len + 1 ]#, ! return e entry.
return^l = term^cb[ id * cb^len + 2 ]#, ! return l entry.
buf^addr = term^cb[ id * cb^len + 3 ]#, ! buffer address.
cnt^addr = term^cb[ id * cb^len + 4 ]#, ! count address.
term^state = term^cb[ id * cb^len + 5 ]#; ! terminal state.
! miscellaneous task control.
INT start, ! process in task-startup phase.
task^space, ! task’s local area size.
system^call^base; ! S register setting for system calls.
! stack marker definition.
LITERAL
stack^p = -2,
stack^e = -1,
stack^l = 0;
?NOLIST
?SOURCE $SYSTEM.SYSTEM.EXTDECS (ABEND, AWAITIO, DEBUG,
? CHANGELIST, CONTROL,
? DEFINELIST, FILEINFO, OPEN,
? READ, WRITE, WRITEREAD)
?LIST