TXXDINIT – Dispatcher Initialization

For now the Dispatcher initialization routine will simply add the dummy Wait Task to the TCB queue.  This dummy task TCB must always be present and must be the first TCB on the queue.  Because we are not adding any other TCB’s to the queue for now the only thing that will happen when we IPL is the Dispatcher will enter the enabled wait until the Interval Timer expires at which time the Dispatcher will once again enter the enabled wait.  Later we will add additional TCB’s that will perform some work.

000000                                4 TXXDINIT CSECT ,
000000 18CF                           5          LR    R12,R15             ESTABLISH
                            00000     6          USING TXXDINIT,R12                 BASE REGISTER
                                      7 *
000002 58B0 0010      00010           8          L     R11,16              CVT ADDRESS
                            00000     9          USING @CVT,R11
                                     10 *
000006 4140 C098      00098          11          LA    R4,WAITTASK         POINT TO DUMMY WAIT TASK
                            00000    12          USING @TCB,R4
                                     13 *
00000A 9640 4004      00004          14          OI    TCBFLGS,TCBFNDSP    DO NOT DISPATCH TASK
                                     15 *
00000E 5040 B004      00004          16          ST    R4,CVTTASKQ         ADD TO TASK QUEUE
000012 5040 B000      00000          17          ST    R4,CVTCTCB          MAKE IT CURRENT TASK
000088 07FE                          51          BR    R14                 RETURN TO CALLER

The only thing we need to do to set up the TCB is to set the Do Not Dispatch flag (TCBFNDSP).

                                     60          PUSH PRINT
                                     61          PRINT NOGEN
                                     62          @TCB  ,
                                    110          @RB   ,
                                    142          POP   PRINT

000094                              146 TXXDINIT CSECT ,
000098                              147 WAITTASK DS    0D
000098 0000000000000000             148          DC    (TCBLEN)X'00'

Because we want to refer the length of the TCB control block DSECT to define the Wait Task TCB storage, the equate for TCBLEN must be defined before it is used.  To do so, we can include the @TCB macro to define the DSECT and then we continue the CSECT.

[Next – TXXSVCIR – SVC Interrupt Routine]

Leave a Reply

Your email address will not be published. Required fields are marked *