On entry to the P0st Routine Register 1 should point to an ECB and Register 0 contains a post code that is stored into the ECB. The Post Routine is either called by the SVC 2 front end or directly through a branch entry.
000000 13 TXXPOST CSECT , 00000 14 USING TXXPOST,R15 ESTABLISH BASE REGISTER 15 * 000000 5400 F080 00080 16 N R0,=A(X'3FFFFFFF') CLEAR WAIT/POST BITS 000004 5600 F084 00084 17 O R0,=A(X'40000000') SET POST BIT 000008 5820 1000 00000 18 L R2,0(,R1) GET RB ADDRESS 19 * 00000C 9180 1000 00000 20 TM 0(R1),X'80' IS ECB WAITING 000010 47E0 F064 00000 21 BNO POST901 NO - BRANCH
First we clean up the post code since the first two bits are reserved for the Wait and Post bit. We then set the Post Bit (x’40’) to complete the post code. The RB address pointer is loaded into R2 and then a test is done to see if a RB is waiting on the ECB. If no RB is currently waiting we only need to store the post code into the ECB and exit.
000014 5000 1000 00000 23 ST R0,0(,R1) UPDATE ECB CONTENTS 000018 5420 F088 00088 24 N R2,=A(X'00FFFFFF') CLEAN UP 24 BIT 00001C 5810 0010 00010 25 L R1,16 CVT 000020 5810 1004 00004 26 L R1,CVTTASKQ-@CVT(,R1) GET TASK QUEUE 000024 5810 1000 00000 27 L R1,TCBNEXT-@TCB(,R1) SKIP OVER WAIT TASK 000028 28 POST010 DS 0H 000028 1211 29 LTR R1,R1 END OF TCB CHAIN ? 00002A 4780 F06A 0006A 30 BZ POST902 YES - RB TO POST NOT FOUND 00002E 5830 1008 00008 31 L R3,TCBRB-@TCB(,R1) GET RB ADDRESS 000032 32 POST020 DS 0H 000032 1233 33 LTR R3,R3 END OF RB LIST 000034 4780 F046 00046 34 BZ POST030 YES - NEXT TCB 35 * 000038 1923 36 CR R2,R3 RB TO POST ? 00003A 4780 F04E 0004E 37 BE POST040 YES - GO POST IT 38 * 00003E 5830 3000 00000 39 L R3,RBNEXT-@RB(,R3) NEXT RB 000042 47F0 F032 00032 40 B POST020 AND LOOP BACK 41 * 000046 43 POST030 DS 0H 000046 5810 1000 00000 44 L R1,TCBNEXT-@TCB(,R1) NEXT TCB 00004A 47F0 F028 00028 45 B POST010 AND LOOP BACK
If there is a RB waiting on the ECB we need to validate the RB address. We do this by scanning through the TCB chain looking at each RB chained to each TCB. If the RB address in the ECB is not matched to a RB chained to a TCB we branch to generate an Abend.
00004E 48 POST040 DS 0H 00004E 9200 3004 00004 49 MVI RBWTCNT-@RB(R3),0 CLEAR WAIT COUNT FOR RB 50 * 000052 5830 1008 00008 51 L R3,TCBRB-@TCB(,R1) POINT TO TOP RB FOR TCB 000056 9500 3004 00004 52 CLI RBWTCNT-@RB(R3),0 WAITING ? 00005A 4770 F062 00062 53 BNE POST050 YES - NOTHING TO UPDATE 54 * 00005E 947F 1004 00004 55 NI TCBFLGS-@TCB(R1),X'FF'-TCBFWAIT CLEAR WAIT FLAG 56 * 000062 57 POST050 DS 0H 000062 07FE 58 BR R14 RETURN TO CALLER
Once the RB address is validated we can clear the Wait Count in the RB. If the RB at the top of the chain we can clear the Wait Flag in the TCB making it dispatchable one again.
000064 62 POST060 DS 0H 000064 5000 1000 00000 63 ST R0,0(,R1) UPDATE ECB CONTENTS 000068 07FE 64 BR R14 RETURN TO CALLER
The ECB is not currently being waited upon so we just store the post code and exit.
00006A 66 POST902 DS 0H 00006A 5810 F08C 0008C 67 L R1,=A(X'102') ABEND CODE 00006E 47F0 F072 00072 68 B POST999 69 * 000072 71 POST999 DS 0H 72 @CALL ABEND 000072 58F0 0014 00014 73+ L R15,20 MVT ADDRESS 000076 58F0 F020 00020 74+ L R15,MVTABEND-@MVT(,R15) ROUTINE ADDRESS 00007A 05EF 75+ BALR R14,R15
Here we set the Abend code and call the Abend routine if the RB address in the ECB was not valid.
[Next – TXXGMAIN, GXXFMAIN, TXXABEND]