GDSX Manual
Design and Development
Extended General Device Support (GDSX) Manual–134303
2-37
Example
Each item in the list also has two parts, item-part[0] and item-part[1]. Item-part[0]
contains the address of the next item in the list. If this item is the last item in the list,
item-part[0] contains the address of header[0]. Item-part[1] contains the address of the
previous item in the list. If this item is the first item in the list, item-part[1] contains the
address of header[0].
For lists in global memory, the header uses two words, and each item in the list uses two
words. For lists in extended memory, the header uses two doublewords, and each item
in the list uses two doublewords.
Example
This example shows how TSCODE handles a linked list of IOCBs associated with a task
(a TCB). Each item in this list uses two doublewords.
! initialize tcb queue header
CALL INIT^XLIST (tcb.qh);
! As a result, the header points to itself.
! The following gives possible content.
!
! Address Content
!
! tcb.qh 588362 588362
! tcb.qt 588366 588362
!
! put iocb onto tcb queue
CALL INSERT^XITEM (tcb.qt, @iocb );
! As a result, the iocb is linked to the header.
! The following gives possible content.
!
! Address Content
!
! tcb.qh 588362 589000
! tcb.qt 588366 589000
!
! iocb.tcblink[0] 589000 588362
! iocb.tcblink[1] 589004 588362
!
! take iocb off tcb queue
CALL DELETE^XITEM (@iocb );
! As a result, the iocb is removed from the list.
!
! Address Content
!
! tcb.qh 588362 588362
! tcb.qt 588366 588362
!
! iocb.tcblink[0] 589000 0
! iocb.tcblink[1] 589004 588362
item-part[0]: Address of next item in list. If this item is last in list, contains address of
header[0].
item-part[1]: Address of previous item in list. If this item is first in list, contains address of
header[0].