Envoy Application Programming Manual

Table Of Contents
TINET Multipoint Supervisor Protocol
Envoy Application Programming Manual427159-001
8-39
Steps of Example Program
Example 8-15. Program Code for TINET Multipoint Supervisor (Page 7 of 13)
! This procedure is used to select and write to a terminal.
PROC write^line (id, buffer, write^count);
INT id, .buffer, write^count;
BEGIN
! set system call stack base.
STACK (system^call^base); CODE (SETS);
! set entry number into message control word.
linebuf := id;
! move data into line buffer.
linebuf[1] ’:=’ buffer FOR (write^count + 1) / 2;
! put terminal address into message.
slinebuf[term^addr] := saddr^list [ id * addr^size * 2
+ 2];
! write the message.
CALL WRITE (linefnum, linebuf, write^count + 2);
IF <> THEN
BEGIN
! log error on operator console.
! set terminal inoperative.
saddr^list[ id * addr^size * 2 ] := eot + no^poll;
END;
END; ! write^line.