Source Code

These source-code files are part of a reconstructed copy of Comanche 72, the first release of the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 13.

They have been adapted from sources files created from a listing of Comanche 55. These source files were updated to match binary dumps of a set of Comanche 67 rope modules. They were then further modified by applying known changes between Comanche 67 and Comanche 72. A binary dump of module B2 of Comanche 72, part number 2010802-021, was also used to validate changes made to banks 05-13. 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 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.

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

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