Source Code

These source-code files are part of a reconstructed copy of Comanche 72/3 (AKA Manche72 revision 3), the final, flown mission release of the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 13.

The starting point was the source code of Comanche 72 (itself previously reconstructed). Comanche 72 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 72 and 72/3. The resulting code assembles to have identical memory-bank checksums as those specified in NASA drawing 2021153G; this gives reasonably high confidence that the changes that have been made are correct. In places where ambiguity exists, this ambiguity is discussed in "## Reconstruction:" comments.

Since no contemporary listings of Comanche 72/3 are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

050520,000002:                                                                                                  ## Copyright:   Public domain.
050521,000003:                                                                                                  ## Filename:    EXECUTIVE.agc
050522,000004:                                                                                                  ## Purpose:     A section of Manche72 revision 3.
050523,000005:                                                                                                  ##              It is part of the reconstructed source code for the final, flown
050524,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
050525,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
050526,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
050527,000009:                                                                                                  ##              from a reconstructed copy of Comanche 072. It has been adapted
050528,000010:                                                                                                  ##              such that the resulting bugger words exactly match those
050529,000011:                                                                                                  ##              specified for Manche72 revision 3 in NASA drawing 2021153G,
050530,000012:                                                                                                  ##              which gives relatively high confidence that the reconstruction
050531,000013:                                                                                                  ##              is correct.
050532,000014:                                                                                                  ## Assembler:   yaYUL
050533,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
050534,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
050535,000017:                                                                                                  ## Mod history: 2024-05-19 MAS  Created from Comanche 072.
050536,000018: 
050537,000019:    5150                                           BLOCK    02                                    
050538,000020: 
050539,000021:                                                                                                  #  TO ENTER A JOB REQUEST REQUIRING NO VAC AREA:
050540,000022: 
050541,000023:    5150                                           COUNT    02/EXEC                               
050542,000024: 
050543,000025:    5150           00004        NOVAC              INHINT                                         
050544,000026:    5151           65242                           AD       FAKEPRET                              #  LOC(MPAC +6) - LOC(QPRET)
050545,000027:    5152           54063                           TS       NEWPRIO                               #  PRIORITY OF NEW JOB + NOVAC C(FIXLOC)
050546,000028: 
050547,000029:    5153           00006                           EXTEND                                         
050548,000030:    5154           50002                           INDEX    Q                                     #  Q WILL BE UNDISTURBED THROUGHOUT.
050549,000031:    5155           30001                           DCA      0                                     #  2CADR OF JOB ENTERED.
050550,000032:    5156           52066                           DXCH     NEWLOC                                
050551,000033:    5157           35241                           CAF      EXECBANK                              
050552,000034:    5160           56004                           XCH      FBANK                                 
050553,000035:    5161           54061                           TS       EXECTEM1                              
050554,000036:    5162           12650                           TCF      NOVAC2                                #  ENTER EXECUTIVE BANK.
050555,000037: 
050556,000038:                                                                                                  #  TO ENTER A JOB REQUEST REQUIRING A VAC AREA - E.G., ALL (PARTIALLY) INTERPRETIVE JOBS.
050557,000039: 
050558,000040:    5163           00004        FINDVAC            INHINT                                         
050559,000041:    5164           54063                           TS       NEWPRIO                               
050560,000042:    5165           00006                           EXTEND                                         
050561,000043:    5166           50002                           INDEX    Q                                     
050562,000044:    5167           30001                           DCA      0                                     
050563,000045:    5170           52066        SPVACIN            DXCH     NEWLOC                                
050564,000046:    5171           35241                           CAF      EXECBANK                              
050565,000047:    5172           56004                           XCH      FBANK                                 
050566,000048:    5173           12626                           TCF      FINDVAC2                              #  OFF TO EXECUTIVE SWITCHED-BANK.
050567,000049: 
050568,000050:                                                                                                  #  TO ENTER A FINDVAC WITH THE PRIORITY IN NEWPRIO TO THE 2CADR ARRIVING IN A AND L:
050569,000051:                                                                                                  #  USERS OF SPVAC MUST INHINT BEFORE STORING IN NEWPRIO.
050570,000052: 
050571,000053:    5174           56002        SPVAC              XCH      Q                                     
050572,000054:    5175           67715                           AD       NEG2                                  
050573,000055:    5176           56002                           XCH      Q                                     
050574,000056:    5177           15170                           TCF      SPVACIN                               
050575,000057: 
050576,000058:                                                                                                  #  TO SUSPEND A BASIC JOB SO A HIGHER PRIORITY JOB MAY BE SERVICED:
050577,000059: 
050578,000060:    5200           22002        CHANG1             LXCH     Q                                     
050579,000061:    5201           35241                           CAF      EXECBANK                              
050580,000062:    5202           56006                           XCH      BBANK                                 
050581,000063:    5203           12727                           TCF      CHANJOB                               
050582,000064: 
050583,000065:                                                                                                  #  TO SUSPEND AN INTERPRETIVE JOB:
050584,000066: 
050585,000067:    5204           40164        CHANG2             CS       LOC                                   #  NEGATIVE LOC SHOWS JOB = INTERPRETIVE.
050586,000068:                                                                                                  #  ITRACE (4) REFERS TO "CHANG2".
050587,000069:    5205           54001                           TS       L                                     
050588,000070:    5206           35241                 +2        CAF      EXECBANK                              
050589,000071:    5207           54006                           TS       BBANK                                 
050590,000072:    5210           12726                           TCF      CHANJOB    -1                         
050591,000073: 
050592,000074:                                                                                                  #  TO VOLUNTARILY SUSPEND A JOB UNTIL THE COMPLETION OF SOME ANTICIPATED EVENT (I/O EVENT ETC.):
050593,000075: 
050594,000076:    5211           54164        JOBSLEEP           TS       LOC                                   
050595,000077:    5212           35241                           CAF      EXECBANK                              
050596,000078:    5213           54004                           TS       FBANK                                 
050597,000079:    5214           13017                           TCF      JOBSLP1                               
050598,000080: 
050599,000081:                                                                                                  #  TO AWAKEN A JOB PUT TO SLEEP IN THE ABOVE FASHION:
050600,000082: 
050601,000083:    5215           00004        JOBWAKE            INHINT                                         
050602,000084:    5216           54065                           TS       NEWLOC                                
050603,000085:    5217           45032                           CS       TWO                                   #  EXIT IS VIA FINDVAC/NOVAC PROCEDURES.
050604,000086:    5220           26002                           ADS      Q                                     
050605,000087:    5221           35241                           CAF      EXECBANK                              
050606,000088:    5222           56004                           XCH      FBANK                                 
050607,000089:    5223           13044                           TCF      JOBWAKE2                              
050608,000090: 
050609,000091:                                                                                                  #  TO CHANGE THE PRIORITY OF A JOB CURRENTLY UNDER EXECUTION:
050610,000092: 
050611,000093:    5224           00004        PRIOCHNG           INHINT                                         #  NEW PRIORITY ARRIVES IN A.  RETURNS TO
050612,000094:    5225           54063                           TS       NEWPRIO                               #  CALLER AS SOON AS NEW JOB PRIORITY IS
050613,000095:    5226           35241                           CAF      EXECBANK                              #  HIGHEST.  PREPARE FOR POSSIBLE BASIC-
050614,000096:    5227           56006                           XCH      BBANK                                 #  STYLE CHANGE-JOB.
050615,000097:    5230           54165                           TS       BANKSET                               
050616,000098:    5231           30002                           CA       Q                                     
050617,000099:    5232           13113                           TCF      PRIOCH2                               
050618,000100: 
050619,000101:                                                                                                  #  TO REMOVE A JOB FROM EXECUTIVE CONSIDERATIONS:
050620,000102: 
050621,000103:    5233           35241        ENDOFJOB           CAF      EXECBANK                              
050622,000104:    5234           54004                           TS       FBANK                                 
050623,000105:    5235           13124                           TCF      ENDJOB1                               
050624,000106: 
050625,000107:    5236           30061        ENDFIND            CA       EXECTEM1                              #  RETURN TO CALLER AFTER JOB ENTRY
050626,000108:    5237           54004                           TS       FBANK                                 #  COMPLETE.
050627,000109:    5240           16710                           TCF      Q+2                                   
050628,000110:    5241           02626        EXECBANK           CADR     FINDVAC2                              
050629,000111: 
050630,000112:    5242           00110        FAKEPRET           ADRES    MPAC       -36D                       #  LOC(MPAC +6) - LOC(QPRET)
050631,000113: 
050632,000114:                                                                                                  #  LOCATE AN AVAILABLE VAC AREA.
050633,000115: 
050634,000116: 01,2626                                           BANK     01                                    
050635,000117: 01,2626                                           COUNT    01/EXEC                               
050636,000118: 
050637,000119: 01,2626           54061        FINDVAC2           TS       EXECTEM1                              #  (SAVE CALLER'S BANK FIRST.)
050638,000120: 01,2627           10400                           CCS      VAC1USE                               
050639,000121: 01,2630           12643                           TCF      VACFOUND                              
050640,000122: 01,2631           10454                           CCS      VAC2USE                               
050641,000123: 01,2632           12643                           TCF      VACFOUND                              
050642,000124: 01,2633           10530                           CCS      VAC3USE                               
050643,000125: 01,2634           12643                           TCF      VACFOUND                              
050644,000126: 01,2635           10604                           CCS      VAC4USE                               
050645,000127: 01,2636           12643                           TCF      VACFOUND                              
050646,000128: 01,2637           10660                           CCS      VAC5USE                               
050647,000129: 01,2640           12643                           TCF      VACFOUND                              
050648,000130: 01,2641           07755                           TC       BAILOUT                               
050649,000131: 01,2642           31201                           OCT      31201                                 #  NO VAC AREAS
050650,000132: 
050651,000133: 01,2643           65032        VACFOUND           AD       TWO                                   #  RESERVE THIS VAC AREA BY STORING A ZERO
050652,000134: 01,2644           22007                           ZL                                             #  IN ITS VAC USE REGISTER AND STORE THE
050653,000135: 01,2645           50000                           INDEX    A                                     #  ADDRESS OF THE FIRST WORD OF IT IN THE
050654,000136: 01,2646           21777                           LXCH     0          -1                         #  LOW NINE BITS OF THE PRIORITY WORD.
050655,000137: 01,2647           26063                           ADS      NEWPRIO                               
050656,000138: 
050657,000139: 01,2650           35035        NOVAC2             CAF      ZERO                                  #  NOVAC ENTERS HERE.  FIND A CORE SET.
050658,000140: 01,2651           54064                           TS       LOCCTR                                
050659,000141: 01,2652           32657                           CAF      NO.CORES                              #  SEVEN SETS OF ELEVEN REGISTERS EACH.
050660,000142: 01,2653           54062        NOVAC3             TS       EXECTEM2                              
050661,000143: 01,2654           50064                           INDEX    LOCCTR                                
050662,000144: 01,2655           10167                           CCS      PRIORITY                              #  EACH PRIORITY REGISTER CONTAINS -0 IF
050663,000145: 01,2656           12717                           TCF      NEXTCORE                              #  THE CORRESPONDING CORE SET IS AVAILABLE.
050664,000146: 01,2657           00006        NO.CORES           DEC      6          B-14                       
050665,000147: 01,2660           12717                           TCF      NEXTCORE                              #  AN ACTIVE JOB HAS A POSITIVE PRIORITY
050666,000148:                                                                                                  #  BUT A DORMANT JOB'S PRIORITY IS NEGATIVE
050667,000149: 
050668,000150: 01,2661           30063        CORFOUND           CA       NEWPRIO                               #  SET THE PRIORITY OF THIS JOB IN THE CORE
050669,000151: 01,2662           50064                           INDEX    LOCCTR                                #  SET'S PRIORITY REGISTER AND SET THE
050670,000152: 01,2663           54167                           TS       PRIORITY                              #  JOB'S PUSH-DOWN POINTER AT THE BEGINNING
050671,000153: 01,2664           75062                           MASK     LOW9                                  #  OF THE WORK AREA AND OVERFLOW INDICATOR
050672,000154: 01,2665           50064                           INDEX    LOCCTR                                
050673,000155: 01,2666           54166                           TS       PUSHLOC                               #  OFF TO PREPARE FOR INTERPRETIVE PROGRAMS
050674,000156: 
050675,000157: 01,2667           10064                           CCS      LOCCTR                                #  IF CORE SET ZERO IS BEING LOADED, SET UP
050676,000158: 01,2670           12704                           TCF      SETLOC                                #  OVFIND AND FIXLOC IMMEDIATELY.
050677,000159: 01,2671           54121                           TS       OVFIND                                
050678,000160: 01,2672           30166                           CA       PUSHLOC                               
050679,000161: 01,2673           54120                           TS       FIXLOC                                
050680,000162: 
050681,000163: 01,2674           10067        SPECTEST           CCS      NEWJOB                                #  SEE IF ANY ACTIVE JOBS WAITING (RARE).
050682,000164: 01,2675           12704                           TCF      SETLOC                                #  MUST BE AWAKENED BUT UNCHANGED JOB.
050683,000165: 01,2676           05753                           TC       CCSHOLE                               
050684,000166: 01,2677           05753                           TC       CCSHOLE                               
050685,000167: 01,2700           54067                           TS       NEWJOB                                #  +0 SHOWS ACTIVE JOB ALREADY SET.
050686,000168: 01,2701           52066                           DXCH     NEWLOC                                
050687,000169: 01,2702           52165                           DXCH     LOC                                   
050688,000170: 01,2703           15236                           TCF      ENDFIND                               
050689,000171: 
050690,000172: 01,2704           52066        SETLOC             DXCH     NEWLOC                                #  SET UP THE LOCATION REGISTERS FOR THIS
050691,000173: 01,2705           50064                           INDEX    LOCCTR                                
050692,000174: 01,2706           52165                           DXCH     LOC                                   
050693,000175: 01,2707           50067                           INDEX    NEWJOB                                #  THIS INDEX INSTRUCTION INSURES THAT THE
050694,000176: 01,2710           40167                           CS       PRIORITY                              #  HIGHEST ACTIVE PRIORITY WILL BE COMPARED
050695,000177: 01,2711           60063                           AD       NEWPRIO                               #  WITH THE NEW PRIORITY TO SEE IF NEWJOB
050696,000178: 01,2712           00006                           EXTEND                                         #  SHOULD BE SET TO SIGNAL A SWITCH.
050697,000179: 01,2713           65236                           BZMF     ENDFIND                               
050698,000180: 01,2714           30064                           CA       LOCCTR                                #  LOCCTR IS LEFT SET AT THIS CORE SET IF
050699,000181: 01,2715           54067                           TS       NEWJOB                                #  THE CALLER WANTS TO LOAD ANY MPAC
050700,000182: 01,2716           15236                           TCF      ENDFIND                               #  REGISTERS, ETC.
050701,000183: 
050702,000184: 01,2717           33054        NEXTCORE           CAF      COREINC                               
050703,000185: 01,2720           26064                           ADS      LOCCTR                                
050704,000186: 01,2721           10062                           CCS      EXECTEM2                              
050705,000187: 01,2722           12653                           TCF      NOVAC3                                
050706,000188: 01,2723           07755                           TC       BAILOUT                               #  NO CORE SETS.
050707,000189: 01,2724           31202                           OCT      31202                                 
050708,000190:                                                                                                  #  THE FOLLOWING ROUTINE SWAPS CORE SET 0 WITH THAT WHOSE RELATIVE ADDRESS IS IN NEWJOB.
050709,000191: 
050710,000192: 01,2725           22164                 -2        LXCH     LOC                                   
050711,000193: 01,2726           30165                 -1        CAE      BANKSET                               #  BANKSET, NOT BBANK, HAS RIGHT CONTENTS.
050712,000194: 01,2727           00004        CHANJOB            INHINT                                         
050713,000195: 01,2730           00006                           EXTEND                                         
050714,000196: 01,2731           04007                           ROR      SUPERBNK                              #  PICK UP CURRENT SBANK FOR BBCON
050715,000197: 01,2732           56001                           XCH      L                                     #  LOC IN A AND BBCON IN L.
050716,000198: 01,2733           50067                 +4        INDEX    NEWJOB                                #  SWAP LOC AND BANKSET.
050717,000199: 01,2734           52165                           DXCH     LOC                                   
050718,000200: 01,2735           52165                           DXCH     LOC                                   
050719,000201: 
050720,000202: 01,2736           30165                           CAE      BANKSET                               
050721,000203: 01,2737           00006                           EXTEND                                         
050722,000204: 01,2740           01007                           WRITE    SUPERBNK                              #  SET SBANK FOR NEW JOB.
050723,000205: 01,2741           52155                           DXCH     MPAC                                  #  SWAP MULTI-PURPOSE ACCUMULATOR AREAS.
050724,000206: 01,2742           50067                           INDEX    NEWJOB                                
050725,000207: 01,2743           52155                           DXCH     MPAC                                  
050726,000208: 01,2744           52155                           DXCH     MPAC                                  
050727,000209: 01,2745           52157                           DXCH     MPAC       +2                         
050728,000210: 01,2746           50067                           INDEX    NEWJOB                                
050729,000211: 01,2747           52157                           DXCH     MPAC       +2                         
050730,000212: 01,2750           52157                           DXCH     MPAC       +2                         
050731,000213: 01,2751           52161                           DXCH     MPAC       +4                         
050732,000214: 01,2752           50067                           INDEX    NEWJOB                                
050733,000215: 01,2753           52161                           DXCH     MPAC       +4                         
050734,000216: 01,2754           52161                           DXCH     MPAC       +4                         
050735,000217: 01,2755           52163                           DXCH     MPAC       +6                         
050736,000218: 01,2756           50067                           INDEX    NEWJOB                                
050737,000219: 01,2757           52163                           DXCH     MPAC       +6                         
050738,000220: 01,2760           52163                           DXCH     MPAC       +6                         
050739,000221: 
050740,000222: 01,2761           35035                           CAF      ZERO                                  
050741,000223: 01,2762           56121                           XCH      OVFIND                                #  MAKE PUSHLOC NEGATIVE IF OVFIND NZ.
050742,000224: 01,2763           00006                           EXTEND                                         
050743,000225: 01,2764           12767                           BZF      +3                                    
050744,000226: 01,2765           40166                           CS       PUSHLOC                               
050745,000227: 01,2766           54166                           TS       PUSHLOC                               
050746,000228: 
050747,000229: 01,2767           52167                           DXCH     PUSHLOC                               
050748,000230: 01,2770           50067                           INDEX    NEWJOB                                
050749,000231: 01,2771           52167                           DXCH     PUSHLOC                               
050750,000232: 01,2772           52167                           DXCH     PUSHLOC                               #  SWAPS PUSHLOC AND PRIORITY.
050751,000233: 01,2773           35062                           CAF      LOW9                                  #  SET FIXLOC TO BASE OF VAC AREA.
050752,000234: 01,2774           70167                           MASK     PRIORITY                              
050753,000235: 01,2775           54120                           TS       FIXLOC                                
050754,000236: 
050755,000237: 01,2776           10166                           CCS      PUSHLOC                               #  SET OVERFLOW INDICATOR ACCORDING TO
050756,000238: 01,2777           35035                           CAF      ZERO                                  
050757,000239: 01,3000           13005                           TCF      ENDPRCHG   -1                         
050758,000240: 
050759,000241: 01,3001           40166                           CS       PUSHLOC                               
050760,000242: 01,3002           54166                           TS       PUSHLOC                               
050761,000243: 01,3003           35033                           CAF      ONE                                   
050762,000244: 01,3004           56121                           XCH      OVFIND                                
050763,000245: 01,3005           54067                           TS       NEWJOB                                
050764,000246: 
050765,000247: 01,3006           00003        ENDPRCHG           RELINT                                         
050766,000248: 01,3007           52165                           DXCH     LOC                                   #  BASIC JOBS HAVE POSITIVE ADDRESSES, SO
050767,000249: 01,3010           00006                           EXTEND                                         #  DISPATCH WITH A DTCB.
050768,000250: 01,3011           63013                           BZMF     +2                                    #  IF INTERPRETIVE, SET UP EBANK, ETC.
050769,000251: 01,3012           52006                           DTCB                                           
050770,000252: 01,3013           40000                           COM                                            #  EPILOGUE TO JOB CHANGE FOR INTERPRETIVE
050771,000253: 01,3014           65033                           AD       ONE                                   
050772,000254: 01,3015           54164                           TS       LOC                                   #  RESUME.
050773,000255: 01,3016           16017                           TCF      INTRSM                                
050774,000256: 
050775,000257:                                                                                                  #  COMPLETE JOBSLEEP PREPARATIONS.
050776,000258: 
050777,000259: 01,3017           00004        JOBSLP1            INHINT                                         
050778,000260: 01,3020           40167                           CS       PRIORITY                              #  NNZ PRIORITY SHOWS JOB ASLEEP.
050779,000261: 01,3021           54167                           TS       PRIORITY                              
050780,000262: 01,3022           36043                           CAF      LOW7                                  
050781,000263: 01,3023           70006                           MASK     BBANK                                 
050782,000264: 01,3024           00006                           EXTEND                                         
050783,000265: 01,3025           04007                           ROR      SUPERBNK                              #  SAVE OLD SUPERBANK VALUE.
050784,000266: 01,3026           54165                           TS       BANKSET                               
050785,000267: 01,3027           45035                           CS       ZERO                                  
050786,000268: 01,3030           54131        JOBSLP2            TS       BUF        +1                         #  HOLDS - HIGHEST PRIORITY.
050787,000269: 01,3031           13141                           TCF      EJSCAN                                #  SCAN FOR HIGHEST PRIORITY ALA ENDOFJOB.
050788,000270: 
050789,000271: 01,3032           00004        NUCHANG2           INHINT                                         #  QUICK... DONT LET NEWJOB CHANGE TO +0.
050790,000272: 01,3033           10067                           CCS      NEWJOB                                
050791,000273: 01,3034           13037                           TCF      +3                                    #  NEWJOB STILL PNZ
050792,000274: 01,3035           00003                           RELINT                                         #  NEW JOB HAS CHANGED TO +0.  WAKE UP JOB
050793,000275: 01,3036           13233                           TCF      ADVAN      +2                         #  VIA NUDIRECT.  (VERY RARE CASE.)
050794,000276: 
050795,000277: 01,3037           35032                           CAF      TWO                                   
050796,000278: 01,3040           00006                           EXTEND                                         
050797,000279: 01,3041           05011                           WOR      DSALMOUT                              #  TURN ON ACTIVITY LIGHT
050798,000280: 01,3042           52165                           DXCH     LOC                                   #  AND SAVE ADDRESS INFO FOR BENEFIT OF
050799,000281: 01,3043           12733                           TCF      CHANJOB    +4                         #        POSSIBLE SLEEPING JOB.
050800,000282: 
050801,000283:                                                                                                  #  TO WAKE UP A JOB, EACH CORE SET IS FOUND TO LOCATE ALL JOBS WHICH ARE ASLEEP.  IF THE FCADR IN THE
050802,000284:                                                                                                  #  LOC REGISTER OF ANY SUCH JOB MATCHES THAT SUPPLIED BY THE CALLER, THAT JOB IS AWAKENED.  IF NO JOB IS FOUND,
050803,000285:                                                                                                  #  LOCCTR IS SET TO -1 AND NO FURTHER ACTION TAKES PLACE.
050804,000286: 
050805,000287: 01,3044           54061        JOBWAKE2           TS       EXECTEM1                              
050806,000288: 01,3045           35035                           CAF      ZERO                                  #  BEGIN CORE SET SCAN.
050807,000289: 01,3046           54064                           TS       LOCCTR                                
050808,000290: 01,3047           32657                           CAF      NO.CORES                              
050809,000291: 01,3050           54062        JOBWAKE4           TS       EXECTEM2                              
050810,000292: 01,3051           50064                           INDEX    LOCCTR                                
050811,000293: 01,3052           10167                           CCS      PRIORITY                              
050812,000294: 01,3053           13056                           TCF      JOBWAKE3                              #  ACTIVE JOB - CHECK NEXT CORE SET.
050813,000295: 01,3054           00014        COREINC            DEC      12         B-14                       #  12 REGISTERS PER CORE SET.
050814,000296: 01,3055           13065                           TCF      WAKETEST                              #  SLEEPING JOB - SEE IF CADR MATCHES.
050815,000297: 
050816,000298: 01,3056           33054        JOBWAKE3           CAF      COREINC                               
050817,000299: 01,3057           26064                           ADS      LOCCTR                                
050818,000300: 01,3060           10062                           CCS      EXECTEM2                              
050819,000301: 01,3061           13050                           TCF      JOBWAKE4                              
050820,000302: 01,3062           45033                           CS       ONE                                   #  EXIT IF SLEEPING JOB NOT FOUND.
050821,000303: 01,3063           54064                           TS       LOCCTR                                
050822,000304: 01,3064           15236                           TCF      ENDFIND                               
050823,000305: 
050824,000306: 01,3065           40065        WAKETEST           CS       NEWLOC                                
050825,000307: 01,3066           50064                           INDEX    LOCCTR                                
050826,000308: 01,3067           60164                           AD       LOC                                   
050827,000309: 01,3070           00006                           EXTEND                                         
050828,000310: 01,3071           13073                           BZF      +2                                    #  IF MATCH.
050829,000311: 01,3072           13056                           TCF      JOBWAKE3                              #  EXAMINE NEXT CORE SET IF NO MATCH.
050830,000312: 
050831,000313: 01,3073           50064                           INDEX    LOCCTR                                #  RE-COMPLEMENT PRIORITY TO SHOW JOB AWAKE
050832,000314: 01,3074           40167                           CS       PRIORITY                              
050833,000315: 01,3075           54063                           TS       NEWPRIO                               
050834,000316: 01,3076           50064                           INDEX    LOCCTR                                
050835,000317: 01,3077           54167                           TS       PRIORITY                              
050836,000318: 
050837,000319: 01,3100           44364                           CS       FBANKMSK                              #  MAKE UP THE 2CADR OF THE WAKE ADDRESS
050838,000320: 01,3101           70065                           MASK     NEWLOC                                #  USING THE CADR IN NEWLOC AND THE EBANK
050839,000321: 01,3102           65021                           AD       2K                                    #  HALF OF BBANK SAVED IN BANKSET.
050840,000322: 01,3103           56065                           XCH      NEWLOC                                
050841,000323: 01,3104           74364                           MASK     FBANKMSK                              
050842,000324: 01,3105           50064                           INDEX    LOCCTR                                
050843,000325: 01,3106           60165                           AD       BANKSET                               
050844,000326: 01,3107           54066                           TS       NEWLOC     +1                         
050845,000327: 
050846,000328: 01,3110           10064                           CCS      LOCCTR                                #  SPECIAL TREATMENT IF THIS JOB WAS
050847,000329: 01,3111           12704                           TCF      SETLOC                                #  ALREADY IN THE RUN (0) POSITION.
050848,000330: 01,3112           12674                           TCF      SPECTEST                              
050849,000331: 
050850,000332:                                                                                                  #  PRIORITY CHANGE.  CHANGE THE CONTENTS OF PRIORITY AND SCAN FOR THE JOB OF HIGHEST PRIORITY.
050851,000333: 
050852,000334: 01,3113           54164        PRIOCH2            TS       LOC                                   
050853,000335: 01,3114           35035                           CAF      ZERO                                  #  SET FLAG TO TELL ENDJOB SCANNER IF THIS
050854,000336: 01,3115           54130                           TS       BUF                                   #  JOB IS STILL HIGHEST PRIORITY.
050855,000337: 01,3116           35062                           CAF      LOW9                                  
050856,000338: 01,3117           70167                           MASK     PRIORITY                              
050857,000339: 01,3120           60063                           AD       NEWPRIO                               
050858,000340: 01,3121           54167                           TS       PRIORITY                              
050859,000341: 01,3122           40000                           COM                                            
050860,000342: 01,3123           13030                           TCF      JOBSLP2                               #  AND TO EJSCAN.
050861,000343: 
050862,000344:                                                                                                  #  RELEASE THIS CORE SET AND VAC AREA AND SCAN FOR THE JOB OF HIGHEST ACTIVE PRIORITY.
050863,000345: 
050864,000346: 01,3124           00004        ENDJOB1            INHINT                                         
050865,000347: 01,3125           45035                           CS       ZERO                                  
050866,000348: 01,3126           54131                           TS       BUF        +1                         
050867,000349: 01,3127           56167                           XCH      PRIORITY                              
050868,000350: 01,3130           75062                           MASK     LOW9                                  
050869,000351: 01,3131           54001                           TS       L                                     
050870,000352: 
050871,000353: 01,3132           45242                           CS       FAKEPRET                              
050872,000354: 01,3133           60001                           AD       L                                     
050873,000355: 
050874,000356: 01,3134           00006                           EXTEND                                         
050875,000357: 01,3135           63141                           BZMF     EJSCAN                                #  NOVAC ENDOFJOB
050876,000358: 
050877,000359: 01,3136           10001                           CCS      L                                     
050878,000360: 01,3137           50000                           INDEX    A                                     
050879,000361: 01,3140           54000                           TS       0                                     
050880,000362: 
050881,000363: 01,3141           10203        EJSCAN             CCS      PRIORITY   +12D                       
050882,000364: 01,3142           03206                           TC       EJ1                                   
050883,000365: 01,3143           05753                           TC       CCSHOLE                               
050884,000366: 01,3144           13145                           TCF      +1                                    
050885,000367: 
050886,000368: 01,3145           10217                           CCS      PRIORITY   +24D                       #  EXAMINE EACH PRIORITY REGISTER TO FIND
050887,000369: 01,3146           03206                           TC       EJ1                                   #  THE JOB OF HIGHEST ACTIVE PRIORITY.
050888,000370: 01,3147           05753                           TC       CCSHOLE                               
050889,000371: 01,3150           13151                           TCF      +1                                    
050890,000372: 
050891,000373: 01,3151           10233                           CCS      PRIORITY   +36D                       
050892,000374: 01,3152           03206                           TC       EJ1                                   
050893,000375: 01,3153           67610        -CCSPR             -CCS     PRIORITY                              
050894,000376: 01,3154           13155                           TCF      +1                                    
050895,000377: 
050896,000378: 01,3155           10247                           CCS      PRIORITY   +48D                       
050897,000379: 01,3156           03206                           TC       EJ1                                   
050898,000380: 01,3157           05753                           TC       CCSHOLE                               
050899,000381: 01,3160           13161                           TCF      +1                                    
050900,000382: 
050901,000383: 01,3161           10263                           CCS      PRIORITY   +60D                       
050902,000384: 01,3162           03206                           TC       EJ1                                   
050903,000385: 01,3163           05753                           TC       CCSHOLE                               
050904,000386: 01,3164           13165                           TCF      +1                                    
050905,000387: 
050906,000388: 01,3165           10277                           CCS      PRIORITY   +72D                       
050907,000389: 01,3166           03206                           TC       EJ1                                   
050908,000390: 01,3167           05753                           TC       CCSHOLE                               
050909,000391: 01,3170           13171                           TCF      +1                                    
050910,000392: 
050911,000393:                                                                                                  #  EVALUATE THE RESULTS OF THE SCAN.
050912,000394: 
050913,000395: 01,3171           10131                           CCS      BUF        +1                         #  SEE IF THERE ARE ANY ACTIVE JOBS WAITING
050914,000396: 01,3172           05753                           TC       CCSHOLE                               
050915,000397: 01,3173           05753                           TC       CCSHOLE                               
050916,000398: 
050917,000399: 01,3174           13176                           TCF      +2                                    
050918,000400: 01,3175           13223                           TCF      DUMMYJOB                              
050919,000401: 01,3176           10130                           CCS      BUF                                   #  BUF IS ZERO IF THIS IS A PRIOCHNG AND
050920,000402: 01,3177           13201                           TCF      +2                                    #  CHANGED PRIORITY IS STILL HIGHEST.
050921,000403: 01,3200           13005                           TCF      ENDPRCHG   -1                         
050922,000404: 
050923,000405: 01,3201           50000                           INDEX    A                                     #  OTHERWISE, SET NEWJOB TO THE RELATIVE
050924,000406: 01,3202           27777                           CAF      0          -1                         #  ADDRESS OF THE NEW JOB'S CORE SET.
050925,000407: 01,3203           63153                           AD       -CCSPR                                
050926,000408: 01,3204           54067                           TS       NEWJOB                                
050927,000409: 01,3205           12725                           TCF      CHANJOB    -2                         
050928,000410: 
050929,000411: 01,3206           54132        EJ1                TS       BUF        +2                         
050930,000412: 01,3207           60131                           AD       BUF        +1                         #  - OLD HIGH PRIORITY.
050931,000413: 01,3210           10000                           CCS      A                                     
050932,000414: 01,3211           40132                           CS       BUF        +2                         
050933,000415: 01,3212           13216                           TCF      EJ2                                   #  NEW HIGH PRIORITY.
050934,000416: 01,3213           13214                           NOOP                                           
050935,000417: 01,3214           50002                           INDEX    Q                                     
050936,000418: 01,3215           00002                           TC       2                                     #  PROCEED WITH SEARCH.
050937,000419: 
050938,000420: 01,3216           54131        EJ2                TS       BUF        +1                         
050939,000421: 01,3217           00006                           EXTEND                                         
050940,000422: 01,3220           22130                           QXCH     BUF                                   #  FOR LOCATING CCS PRIORITY + X INSTR.
050941,000423: 01,3221           50130                           INDEX    BUF                                   
050942,000424: 01,3222           00002                           TC       2                                     
050943,000425: 
050944,000426:                                                                                                  #  IDLING AND COMPUTER ACTIVITY (GREEN) LIGHT MAINTENANCE. THE IDLING ROUTINE IS NOT A JOB IN ITSELF,
050945,000427:                                                                                                  #  BUT RATHER A SUBROUTINE OF THE EXECUTIVE.
050946,000428: 
050947,000429: 01,3223     1361                                  EBANK=   SELFRET                               #  SELF-CHECK STORAGE IN EBANK.
050948,000430: 
050949,000431: 01,3223           45035        DUMMYJOB           CS       ZERO                                  #  SET NEWJOB TO -0 FOR IDLING.
050950,000432: 01,3224           54067                           TS       NEWJOB                                
050951,000433: 01,3225           00003                           RELINT                                         
050952,000434: 01,3226           45032                           CS       TWO                                   #  TURN OFF THE ACTIVITY LIGHT.
050953,000435: 01,3227           00006                           EXTEND                                         
050954,000436: 01,3230           03011                           WAND     DSALMOUT                              
050955,000437: 01,3231           10067        ADVAN              CCS      NEWJOB                                #  IS A NEWJOB ACTIVE?
050956,000438: 01,3232           13032                           TCF      NUCHANG2                              #  YES... ONE REQUIRING A CHANGE JOB.
050957,000439: 01,3233           35032                           CAF      TWO                                   #  NEW JOB ALREADY IN POSITION FOR
050958,000440: 01,3234           13242                           TCF      NUDIRECT                              #  EXECUTION.
050959,000441: 
050960,000442: 01,3235           31361                           CA       SELFRET                               
050961,000443: 01,3236           54001                           TS       L                                     #  PUT RETURN ADDRESS IN L.
050962,000444: 01,3237           33241                           CAF      SELFBANK                              
050963,000445: 01,3240           15244                           TCF      SUPDXCHZ   +1                         #  AND DISPATCH JOB.
050964,000446: 
050965,000447: 01,3241     1361                                  EBANK=   SELFRET                               
050966,000448: 01,3241           66102        SELFBANK           BBCON    SELFCHK                               
050967,000449: 
050968,000450: 01,3242           00006        NUDIRECT           EXTEND                                         #  TURN THE GREEN LIGHT BACK ON.
050969,000451: 01,3243           05011                           WOR      DSALMOUT                              
050970,000452: 01,3244           52165                           DXCH     LOC                                   #  JOBS STARTED IN THIS FASHION MUST BE
050971,000453: 01,3245           15243                           TCF      SUPDXCHZ                              
050972,000454: 
050973,000455:    5243                                           BLOCK    2                                     #  IN FIXED-FIXED SO OTHERS MAY USE.
050974,000456: 
050975,000457:    5243                                           COUNT    02/EXEC                               
050976,000458: 
050977,000459:                                                                                                  #  SUPDXCHZ - ROUTINE TO TRANSFER TO SUPERBANK.
050978,000460:                                                                                                  #  CALLING SEQUENCE
050979,000461:                                                                                                  #                TCF     SUPDXCHZ        WITH 2CADR OF DESIRED LOCATION IN A + L.
050980,000462: 
050981,000463:    5243           56001        SUPDXCHZ           XCH      L                                     #  BASIC.
050982,000464:    5244           00006                 +1        EXTEND                                         
050983,000465:    5245           01007                           WRITE    SUPERBNK                              
050984,000466:    5246           54006                           TS       BBANK                                 
050985,000467:    5247           00001                           TC       L                                     
050986,000468: 
050987,000469:    5250           77677        NEG100             OCT      77677                                 
050988,000470: 
050989,000471: 
050990,000472: 

End of include-file EXECUTIVE.agc.  Parent file is MAIN.agc