GDSX Manual

Service Routines
Extended General Device Support (GDSX) Manual134303
8-80
TCBADDR
The following condition code settings are valid:
TCBADDR
Given a task’s TCB number, this procedure returns the address of the TCB. If you do
not have the task’s TCB number, you may find it more efficient to obtain the TCB
address by means of the DCB that corresponds to the task. See the example for the
WRITE^ITC^MESSAGE[X] procedure.
address returned value
INT(32):value
is the returned address of the TCB. If task-number is less than 1 or greater than the
value of the MAXTASKS configuration parameter, address is equal to 0.
task-number input
INT:value
is the TCB number of a task, a value from 1 through the value of MAXTASKS.
Tasks 0 and 1 are always the monitor and listener system tasks.
Example
This code may be used to scan the TCB pool:
t1 := 2; !We start at 2 because tcb[0] & tcb[1] are always
!system tasks
WHILE (t1 <= MAXTSKS) do
BEGIN
tcb^addr := TCBADDR(t1);
.
Do desired processing here
.
t1 := t1 + 1
END;
= CCE indicates that the task now owns break for its terminal.
< CCL indicates that an I/O error occurred on the SETPARAM 3 issued by
TSCODE to take break ownership. The error number can be obtained by calling
^FILEINFO. Error 99 is returned if the BREAKENABLED configuration
parameter was not equal to 1.
> CCG indicates that the calling task already owns break.
address := TCBADDR ( task-number ); !
i
Note. Specifying a task-number value less than 1 or greater than the value of MAXTASKS
causes the current task to fault with an EMS message.