TXXEXTIR – External Interrupt Routine

The External Interrupt Routine is called from the first level Ext Interrupt handler in low memory when an external interrupt occurs.

000000                                8 TXXEXTIR CSECT ,
000000 18CF                           9          LR    R12,R15
                            00000    10          USING TXXEXTIR,R12                BASE REG
                                     11 *
                            00000    12          USING @TCB,R4
                                     13 *
000002 9180 401B      0001B          14          TM    TCBPSW+3,X'80'     TIMER INTERRUPT ?
000006 4710 C016      00016          15          BO    TIMER              YES - BRANCH
                                     16 *
00000A 9140 401B      0001B          17          TM    TCBPSW+3,X'40'     EXT KEY PRESSED ?
00000E 4710 C026      00026          18          BO    EXTKEY             YES - BRANCH
                                     19 *
000012 8200 C038      00038          20          LPSW  EXTWPSW            GO INTO WAIT STATE

We begin by examining the PSW to determine what type of external interruption occurred.  The two conditions we are interested in are the Interval Timer expired and an operator generated interruption.  If neither of these types of interruptions is indicated a wait state PSW is loaded.

000016                               26 TIMER    DS    0H
000016 5810 C040      00040          27          L     R1,=A(X'80')       RESTART TIMER
00001A 5010 0050      00050          28          ST    R1,ITIMER-@LOWCORE
                                     29 *
00001E 9610 4004      00004          30          OI    TCBFLGS,X'10'      INDICATE TIME EXPIRED
000022 47F0 C02A      0002A          31          B     EXIT               AND EXIT

If the interruption is the result of the Interval Timer expiring then it means the executing task is hogging the CPU.  We set a bit in the TCB flags indicating the task was interrupted by the timer.  This will cause the task to not be dispatched until all other tasks have been given the opportunity to run.

000026                               37 EXTKEY   DS    0H
000026 47F0 C02A      0002A          38          B     EXIT               IGNORE FOR NOW 

00002A                               44 EXIT     DS    0H
00002A 58F0 0014      00014          45          L     R15,20             GET CVT ADDRESS
00002E 58F0 F004      00004          46          L     R15,MVTDISP-@MVT(,R15)   GET DISPATCHER EP
000032 07FF                          47          BR    R15                      BRANCH TO DISPATCHER

000038                               51          DS    0D
000038 0002000000EE0002              52 EXTWPSW  DC    AL1(0,2,0,0),A(@E@EXT)  DISABLED WAIT PSW

For now we will just ignore an external interrupt caused by the operator.  Exit is simply branching to the Dispatcher routine.

[Next – TXXDISP – Dispatcher Routine]

Leave a Reply

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