Envoy Application Programming Manual

Table Of Contents
TINET Multipoint Supervisor Protocol
Envoy Application Programming Manual427159-001
8-44
Steps of Example Program
Example 8-15. Program Code for TINET Multipoint Supervisor (Page 12 of 13)
! This procedure performs the task-startup function.
! 1. The startup message is read from the $RECEIVE file.
! 2. The line is opened and defined.
! 3. Each task (that is, poll^count tasks) is started:
! -The stack base for task "i" is calculated. TheS’
! register is set to this value.
! -The stack base for system calls is calculated by
! adding the space allocated to each task to the stack
! base of the task to be launched.
! -Task "i" is started (task). Its local area begins
! at the current ’S’ value + 4.
! 4. Polling is initiated (poll^line).
PROC start^up MAIN;
BEGIN
INT s = ’S’,
i,
base,
fnum,
.terms,
.buf[0:33];
! open and read $RECEIVE.
buf ’:=["$RECEIVE",8 * [" "]];
CALL OPEN (buf,fnum);
CALL READ (fnum,buf,66);
IF <> THEN CALL ABEND;
! open line.
CALL OPEN (buf[9], linefnum);
IF <> THEN CALL ABEND;