Source Code

These source-code files are part of a reconstructed copy of Artemis 071, the first release of the Apollo 15 through 17 Command Module (CM) Apollo Guidance Computer (AGC) software.

The reconstruction began with source code of Artemis 072 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes between the two versions. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021154-. Note that page numbers in the reconstructed code match those on the Artemis 072 printout, although the changed code would likely have changed page numbers for a real Artemis 071 listing.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

051698,000002:                                                                                                  ## Copyright:   Public domain.
051699,000003:                                                                                                  ## Filename:    EXECUTIVE.agc
051700,000004:                                                                                                  ## Purpose:     A section of Artemis revision 071.
051701,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
051702,000006:                                                                                                  ##              release of the flight software for the Command Module's
051703,000007:                                                                                                  ##              (CM) Apollo Guidance Computer (AGC) for Apollo 15 through
051704,000008:                                                                                                  ##              17. The code has been recreated from a copy of Artemis 072.
051705,000009:                                                                                                  ##              It has been adapted such that the resulting bugger words
051706,000010:                                                                                                  ##              exactly match those specified for Artemis 071 in NASA
051707,000011:                                                                                                  ##              drawing 2021154-, which gives relatively high confidence
051708,000012:                                                                                                  ##              that the reconstruction is correct.
051709,000013:                                                                                                  ## Reference:   1208
051710,000014:                                                                                                  ## Assembler:   yaYUL
051711,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
051712,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
051713,000017:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Artemis 072.
051714,000018: 

Page 1208

051716,000020: 
051717,000021:    4000                                           SETLOC   EXECF2                                
051718,000022:    4000                                           BANK                                           
051719,000023: 
051720,000024:                                                                                                  #  TO ENTER A JOB REQUEST REQUIRING NO VAC AREA:
051721,000025: 
051722,000026:    5120                                           COUNT*   $$/EXEC                               
051723,000027:    5120           34346        NOVAC30            CAF      PRIO30                                
051724,000028:    5121           00004        NOVAC              INHINT                                         
051725,000029:    5122           65213                           AD       FAKEPRET                              #  LOC(MPAC +6) - LOC(QPRET)
051726,000030:    5123           54063                           TS       NEWPRIO                               #  PRIORITY OF NEW JOB + NOVAC C(FIXLOC)
051727,000031: 
051728,000032:    5124           00006                           EXTEND                                         
051729,000033:    5125           50002                           INDEX    Q                                     #  Q WILL BE UNDISTURBED THROUGHOUT.
051730,000034:    5126           30001                           DCA      0                                     #  2CADR OF JOB ENTERED.
051731,000035:    5127           52066                           DXCH     NEWLOC                                
051732,000036:    5130           34756                           CAF      EXECBANK                              
051733,000037:    5131           56004                           XCH      FBANK                                 
051734,000038:    5132           54061                           TS       EXECTEM1                              
051735,000039:    5133           12620                           TCF      NOVAC2                                #  ENTER EXECUTIVE BANK.
051736,000040: 
051737,000041:                                                                                                  #  TO ENTER A JOB REQUEST REQUIRING A VAC AREA - E.G., ALL (PARTIALLY) INTERPRETIVE JOBS.
051738,000042: 
051739,000043:    5134           34753        FINVAC20           CAF      PRIO20                                
051740,000044:    5135           00004        FINDVAC            INHINT                                         
051741,000045:    5136           54063                           TS       NEWPRIO                               
051742,000046:    5137           00006                           EXTEND                                         
051743,000047:    5140           50002                           INDEX    Q                                     
051744,000048:    5141           30001                           DCA      0                                     
051745,000049:    5142           52066        SPVACIN            DXCH     NEWLOC                                
051746,000050:    5143           34756                           CAF      EXECBANK                              
051747,000051:    5144           56004                           XCH      FBANK                                 
051748,000052:    5145           12576                           TCF      FINDVAC2                              #  OFF TO EXECUTIVE SWITCHED-BANK.
051749,000053: 
051750,000054:                                                                                                  #  TO ENTER A FINDVAC WITH THE PRIORITY IN NEWPRIO TO THE 2CADR ARRIVING IN A AND L:
051751,000055: 
051752,000056:                                                                                                  #  USERS OF SPVAC MUST INHINT BEFORE STORING IN NEWPRIO.
051753,000057: 
051754,000058:    5146           56002        SPVAC              XCH      Q                                     
051755,000059:    5147           67701                           AD       NEG2                                  
051756,000060:    5150           56002                           XCH      Q                                     
051757,000061:    5151           15142                           TCF      SPVACIN                               
051758,000062: 
051759,000063:                                                                                                  #  TO SUSPEND A BASIC JOB SO A HIGHER PRIORITY JOB MAY BE SERVICED:
051760,000064: 
051761,000065:    5152           22002        CHANG1             LXCH     Q                                     
051762,000066:    5153           34756                           CAF      EXECBANK                              
051763,000067:    5154           56006                           XCH      BBANK                                 
051764,000068:    5155           12677                           TCF      CHANJOB                               
051765,000069: 
051766,000070:                                                                                                  #  TO SUSPEND AN INTERPRETIVE JOB:
051767,000071: 

Page 1209

051769,000073:    5156           40164        CHANG2             CS       LOC                                   #  NEGATIVE LOC SHOWS JOB = INTERPRETIVE.
051770,000074:                                                                                                  #  ITRACE (4) REFERS TO "CHANG2".
051771,000075:    5157           54001                           TS       L                                     
051772,000076:    5160           34756                 +2        CAF      EXECBANK                              
051773,000077:    5161           54006                           TS       BBANK                                 
051774,000078:    5162           12676                           TCF      CHANJOB    -1                         
051775,000079: 

Page 1210

051777,000081:                                                                                                  #  TO VOLUNTARILY SUSPEND A JOB UNTIL THE COMPLETION OF SOME ANTICIPATED EVENT (I/O EVENT ETC.):
051778,000082: 
051779,000083:    5163           54164        JOBSLEEP           TS       LOC                                   
051780,000084:    5164           34756                           CAF      EXECBANK                              
051781,000085:    5165           54004                           TS       FBANK                                 
051782,000086:    5166           12767                           TCF      JOBSLP1                               
051783,000087: 
051784,000088:                                                                                                  #  TO AWAKEN A JOB PUT TO SLEEP IN THE ABOVE FASHION:
051785,000089: 
051786,000090:    5167           00004        JOBWAKE            INHINT                                         
051787,000091:    5170           54065                           TS       NEWLOC                                
051788,000092:    5171           44767                           CS       TWO                                   #  EXIT IS VIA FINDVAC/NOVAC PROCEDURES.
051789,000093:    5172           26002                           ADS      Q                                     
051790,000094:    5173           34756                           CAF      EXECBANK                              
051791,000095:    5174           56004                           XCH      FBANK                                 
051792,000096:    5175           13014                           TCF      JOBWAKE2                              
051793,000097: 
051794,000098:                                                                                                  #  TO CHANGE THE PRIORITY OF A JOB CURRENTLY UNDER EXECUTION:
051795,000099: 
051796,000100:    5176           00004        PRIOCHNG           INHINT                                         #  NEW PRIORITY ARRIVES IN A. RETURNS TO
051797,000101:    5177           54063                           TS       NEWPRIO                               #  CALLER AS SOON AS NEW JOB PRIORITY IS
051798,000102:    5200           34756                           CAF      EXECBANK                              #  HIGHEST. PREPARE FOR POSSIBLE BASIC-
051799,000103:    5201           56006                           XCH      BBANK                                 #  STYLE CHANGE-JOB.
051800,000104:    5202           54165                           TS       BANKSET                               
051801,000105:    5203           30002                           CA       Q                                     
051802,000106:    5204           13063                           TCF      PRIOCH2                               
051803,000107: 
051804,000108:                                                                                                  #  TO REMOVE A JOB FROM EXECUTIVE CONSIDERATIONS:
051805,000109: 
051806,000110:    5205           34756        ENDOFJOB           CAF      EXECBANK                              
051807,000111:    5206           54004                           TS       FBANK                                 
051808,000112:    5207           13074                           TCF      ENDJOB1                               
051809,000113: 
051810,000114:    5210           30061        ENDFIND            CA       EXECTEM1                              #  RETURN TO CALLER AFTER JOB ENTRY
051811,000115:    5211           54004                           TS       FBANK                                 #  COMPLETE.
051812,000116:    5212           16710                           TCF      Q+2                                   
051813,000117:    5213     4756               EXECBANK           EQUALS   BIT11                                 #  THIS IS TRUE IF FINDVAC2 STAYS IN BANK 01
051814,000118: 
051815,000119:    5213           00110        FAKEPRET           ADRES    MPAC       -36D                       #  LOC(MPAC +6) - LOC(QPRET)
051816,000120: 

Page 1211

051818,000122:                                                                                                  #  LOCATE AN AVAILABLE VAC AREA.
051819,000123: 
051820,000124: 01,2000                                           SETLOC   EXECB1                                
051821,000125: 01,2000                                           BANK                                           
051822,000126: 
051823,000127: 01,2576                                           COUNT*   $$/EXEC                               
051824,000128:                                                                                                  #       ******** IF THE  EXECUTIVE IS 
051825,000129:                                                                                                  #                MOVED   OUT OF BANK 01
051826,000130:                                                                                                  #                DONT    FORGET TO CHANGE
051827,000131:                                                                                                  #                THE     VALUE OF
051828,000132:                                                                                                  #                ******  EXECBANK ****
051829,000133: 01,2576           54061        FINDVAC2           TS       EXECTEM1                              #  (SAVE CALLER'S BANK FIRST.)
051830,000134: 01,2577           10400                           CCS      VAC1USE                               
051831,000135: 01,2600           12613                           TCF      VACFOUND                              
051832,000136: 01,2601           10454                           CCS      VAC2USE                               
051833,000137: 01,2602           12613                           TCF      VACFOUND                              
051834,000138: 01,2603           10530                           CCS      VAC3USE                               
051835,000139: 01,2604           12613                           TCF      VACFOUND                              
051836,000140: 01,2605           10604                           CCS      VAC4USE                               
051837,000141: 01,2606           12613                           TCF      VACFOUND                              
051838,000142: 01,2607           10660                           CCS      VAC5USE                               
051839,000143: 01,2610           12613                           TCF      VACFOUND                              
051840,000144: 01,2611           07706                           TC       BAILOUT                               
051841,000145: 01,2612           31201                           OCT      31201                                 #  NO VAC AREAS
051842,000146: 
051843,000147: 01,2613           64767        VACFOUND           AD       TWO                                   #  RESERVE THIS VAC AREA BY STORING A ZERO
051844,000148: 01,2614           22007                           ZL                                             #  IN ITS VAC USE REGISTER AND STORE THE
051845,000149: 01,2615           50000                           INDEX    A                                     #  ADDRESS OF THE FIRST WORD OF IT IN THE
051846,000150: 01,2616           21777                           LXCH     0          -1                         #  LOW NINE BITS OF THE PRIORITY WORD.
051847,000151: 01,2617           26063                           ADS      NEWPRIO                               
051848,000152: 
051849,000153: 01,2620           34772        NOVAC2             CAF      ZERO                                  #  NOVAC ENTERS HERE. FIND A CORE SET.
051850,000154: 01,2621           54064                           TS       LOCCTR                                
051851,000155: 01,2622           32627                           CAF      NO.CORES                              #  SEVEN SETS OF ELEVEN REGISTERS EACH.
051852,000156: 01,2623           54062        NOVAC3             TS       EXECTEM2                              
051853,000157: 01,2624           50064                           INDEX    LOCCTR                                
051854,000158: 01,2625           10167                           CCS      PRIORITY                              #  EACH PRIORITY REGISTER CONTAINS -0 IF
051855,000159: 01,2626           12667                           TCF      NEXTCORE                              #  THE CORRESPONDING CORE SET IS AVAILABLE.
051856,000160: 01,2627           00006        NO.CORES           DEC      6          B-14                       
051857,000161: 01,2630           12667                           TCF      NEXTCORE                              #  AN ACTIVE JOB HAS A POSITIVE PRIORITY
051858,000162:                                                                                                  #  BUT A DORMANT JOB'S PRIORITY IS NEGATIVE
051859,000163: 

Page 1212

051861,000165: 01,2631           30063        CORFOUND           CA       NEWPRIO                               #  SET THE PRIORITY OF THIS JOB IN THE CORE
051862,000166: 01,2632           50064                           INDEX    LOCCTR                                #  SET'S PRIORITY REGISTER AND SET THE
051863,000167: 01,2633           54167                           TS       PRIORITY                              #  JOB'S PUSH-DOWN POINTER AT THE BEGINNING
051864,000168: 01,2634           75021                           MASK     LOW9                                  #  OF THE WORK AREA AND OVERFLOW INDICATOR
051865,000169: 01,2635           50064                           INDEX    LOCCTR                                
051866,000170: 01,2636           54166                           TS       PUSHLOC                               #  OFF TO PREPARE FOR INTERPRETIVE PROGRAMS
051867,000171: 
051868,000172: 01,2637           10064                           CCS      LOCCTR                                #  IF CORE SET ZERO IS BEING LOADED, SET UP
051869,000173: 01,2640           12654                           TCF      SETLOC                                #  OVFIND AND FIXLOC IMMEDIATELY.
051870,000174: 01,2641           54121                           TS       OVFIND                                
051871,000175: 01,2642           30166                           CA       PUSHLOC                               
051872,000176: 01,2643           54120                           TS       FIXLOC                                
051873,000177: 
051874,000178: 01,2644           10067        SPECTEST           CCS      NEWJOB                                #  SEE IF ANY ACTIVE JOBS WAITING (RARE).
051875,000179: 01,2645           12654                           TCF      SETLOC                                #  MUST BE AWAKENED BUT UNCHANGED JOB.
051876,000180: 01,2646           12647                           NOOP                                           #  CANNOT GET HERE
051877,000181: 01,2647           12650                           NOOP                                           #  CANNOT GET HERE
051878,000182: 01,2650           54067                           TS       NEWJOB                                #  +0 SHOWS ACTIVE JOB ALREADY SET.
051879,000183: 01,2651           52066                           DXCH     NEWLOC                                
051880,000184: 01,2652           52165                           DXCH     LOC                                   
051881,000185: 01,2653           15210                           TCF      ENDFIND                               
051882,000186: 
051883,000187: 01,2654           52066        SETLOC             DXCH     NEWLOC                                #  SET UP THE LOCATION REGISTERS FOR THIS
051884,000188: 01,2655           50064                           INDEX    LOCCTR                                
051885,000189: 01,2656           52165                           DXCH     LOC                                   
051886,000190: 01,2657           50067                           INDEX    NEWJOB                                #  THIS INDEX INSTRUCTION INSURES THAT THE
051887,000191: 01,2660           40167                           CS       PRIORITY                              #  HIGHEST ACTIVE PRIORITY WILL BE COMPARED
051888,000192: 01,2661           60063                           AD       NEWPRIO                               #  WITH THE NEW PRIORITY TO SEE IF NEWJOB
051889,000193: 01,2662           00006                           EXTEND                                         #  SHOULD BE SET TO SIGNAL A SWITCH.
051890,000194: 01,2663           65210                           BZMF     ENDFIND                               
051891,000195: 01,2664           30064                           CA       LOCCTR                                #  LOCCTR IS LEFT SET AT THIS CORE SET IF
051892,000196: 01,2665           54067                           TS       NEWJOB                                #  THE CALLER WANTS TO LOAD ANY MPAC
051893,000197: 01,2666           15210                           TCF      ENDFIND                               #  REGISTERS, ETC.
051894,000198: 
051895,000199: 01,2667           33024        NEXTCORE           CAF      COREINC                               
051896,000200: 01,2670           26064                           ADS      LOCCTR                                
051897,000201: 01,2671           10062                           CCS      EXECTEM2                              
051898,000202: 01,2672           12623                           TCF      NOVAC3                                
051899,000203: 01,2673           07706                           TC       BAILOUT                               #  NO CORE SETS.
051900,000204: 01,2674           31202                           OCT      31202                                 
051901,000205: 

Page 1213

051903,000207:                                                                                                  #  THE FOLLOWING ROUTINE SWAPS CORE SET 0 WITH THAT WHOSE RELATIVE ADDRESS IS IN NEWJOB.
051904,000208: 
051905,000209: 01,2675           22164                 -2        LXCH     LOC                                   
051906,000210: 01,2676           30165                 -1        CAE      BANKSET                               #  BANKSET, NOT BBANK, HAS RIGHT CONTENTS.
051907,000211: 01,2677           00004        CHANJOB            INHINT                                         
051908,000212: 01,2700           00006                           EXTEND                                         
051909,000213: 01,2701           04007                           ROR      SUPERBNK                              #  PICK UP CURRENT SBANK FOR BBCON
051910,000214: 01,2702           56001                           XCH      L                                     #  LOC IN A AND BBCON IN L.
051911,000215: 01,2703           50067                 +4        INDEX    NEWJOB                                #  SWAP LOC AND BANKSET.
051912,000216: 01,2704           52165                           DXCH     LOC                                   
051913,000217: 01,2705           52165                           DXCH     LOC                                   
051914,000218: 
051915,000219: 01,2706           30165                           CAE      BANKSET                               
051916,000220: 01,2707           00006                           EXTEND                                         
051917,000221: 01,2710           01007                           WRITE    SUPERBNK                              #  SET SBANK FOR NEW JOB.
051918,000222: 01,2711           52155                           DXCH     MPAC                                  #  SWAP MULTI-PURPOSE ACCUMULATOR AREAS.
051919,000223: 01,2712           50067                           INDEX    NEWJOB                                
051920,000224: 01,2713           52155                           DXCH     MPAC                                  
051921,000225: 01,2714           52155                           DXCH     MPAC                                  
051922,000226: 01,2715           52157                           DXCH     MPAC       +2                         
051923,000227: 01,2716           50067                           INDEX    NEWJOB                                
051924,000228: 01,2717           52157                           DXCH     MPAC       +2                         
051925,000229: 01,2720           52157                           DXCH     MPAC       +2                         
051926,000230: 01,2721           52161                           DXCH     MPAC       +4                         
051927,000231: 01,2722           50067                           INDEX    NEWJOB                                
051928,000232: 01,2723           52161                           DXCH     MPAC       +4                         
051929,000233: 01,2724           52161                           DXCH     MPAC       +4                         
051930,000234: 01,2725           52163                           DXCH     MPAC       +6                         
051931,000235: 01,2726           50067                           INDEX    NEWJOB                                
051932,000236: 01,2727           52163                           DXCH     MPAC       +6                         
051933,000237: 01,2730           52163                           DXCH     MPAC       +6                         
051934,000238: 
051935,000239: 01,2731           34772                           CAF      ZERO                                  
051936,000240: 01,2732           56121                           XCH      OVFIND                                #  MAKE PUSHLOC NEGATIVE IF OVFIND NZ.
051937,000241: 01,2733           00006                           EXTEND                                         
051938,000242: 01,2734           12737                           BZF      +3                                    
051939,000243: 01,2735           40166                           CS       PUSHLOC                               
051940,000244: 01,2736           54166                           TS       PUSHLOC                               
051941,000245: 
051942,000246: 01,2737           52167                           DXCH     PUSHLOC                               
051943,000247: 01,2740           50067                           INDEX    NEWJOB                                
051944,000248: 01,2741           52167                           DXCH     PUSHLOC                               
051945,000249: 01,2742           52167                           DXCH     PUSHLOC                               #  SWAPS PUSHLOC AND PRIORITY.
051946,000250: 01,2743           35021                           CAF      LOW9                                  #  SET FIXLOC TO BASE OF VAC AREA.
051947,000251: 01,2744           70167                           MASK     PRIORITY                              
051948,000252: 01,2745           54120                           TS       FIXLOC                                
051949,000253: 
051950,000254: 01,2746           10166                           CCS      PUSHLOC                               #  SET OVERFLOW INDICATOR ACCORDING TO
051951,000255: 01,2747           34772                           CAF      ZERO                                  
051952,000256: 01,2750           12755                           TCF      ENDPRCHG   -1                         

Page 1214

051954,000258: 01,2751           40166                           CS       PUSHLOC                               
051955,000259: 01,2752           54166                           TS       PUSHLOC                               
051956,000260: 01,2753           34770                           CAF      ONE                                   
051957,000261: 01,2754           56121                           XCH      OVFIND                                
051958,000262: 01,2755           54067                 -1        TS       NEWJOB                                
051959,000263: 01,2756           00003        ENDPRCHG           RELINT                                         
051960,000264: 01,2757           52165                           DXCH     LOC                                   #  BASIC JOBS HAVE POSITIVE ADDRESSES, SO
051961,000265: 01,2760           00006                           EXTEND                                         #  DISPATCH WITH A DTCB.
051962,000266: 01,2761           62763                           BZMF     +2                                    #  IF INTERPRETIVE, SET UP EBANK, ETC.
051963,000267: 01,2762           52006                           DTCB                                           
051964,000268: 

Page 1215

051966,000270: 
051967,000271: 01,2763           40000                           COM                                            #  EPILOGUE TO JOB CHANGE FOR INTERPRETIVE
051968,000272: 01,2764           64770                           AD       ONE                                   
051969,000273: 01,2765           54164                           TS       LOC                                   #  RESUME.
051970,000274: 01,2766           16017                           TCF      INTRSM                                
051971,000275: 
051972,000276:                                                                                                  #  COMPLETE JOBSLEEP PREPARATIONS.
051973,000277: 
051974,000278: 01,2767           00004        JOBSLP1            INHINT                                         
051975,000279: 01,2770           40167                           CS       PRIORITY                              #  NNZ PRIORITY SHOWS JOB ASLEEP.
051976,000280: 01,2771           54167                           TS       PRIORITY                              
051977,000281: 01,2772           36043                           CAF      LOW7                                  
051978,000282: 01,2773           70006                           MASK     BBANK                                 
051979,000283: 01,2774           00006                           EXTEND                                         
051980,000284: 01,2775           04007                           ROR      SUPERBNK                              #  SAVE OLD SUPERBANK VALUE.
051981,000285: 01,2776           54165                           TS       BANKSET                               
051982,000286: 01,2777           44772                           CS       ZERO                                  
051983,000287: 01,3000           54131        JOBSLP2            TS       BUF        +1                         #  HOLDS - HIGHEST PRIORITY.
051984,000288: 01,3001           13111                           TCF      EJSCAN                                #  SCAN FOR HIGHEST PRIORITY ALA ENDOFJOB.
051985,000289: 
051986,000290: 01,3002           00004        NUCHANG2           INHINT                                         #  QUICK... DONT LET NEWJOB CHANGE TO +0.
051987,000291: 01,3003           10067                           CCS      NEWJOB                                
051988,000292: 01,3004           13007                           TCF      +3                                    #  NEWJOB STILL PNZ
051989,000293: 01,3005           00003                           RELINT                                         #  NEW JOB HAS CHANGED TO +0. WAKE UP JOB
051990,000294: 01,3006           13201                           TCF      ADVAN      +2                         #  VIA NUDIRECT. (VERY RARE CASE.)
051991,000295: 
051992,000296: 01,3007           34767                           CAF      TWO                                   
051993,000297: 01,3010           00006                           EXTEND                                         
051994,000298: 01,3011           05011                           WOR      DSALMOUT                              #  TURN ON ACTIVITY LIGHT
051995,000299: 01,3012           52165                           DXCH     LOC                                   #  AND SAVE ADDRESS INFO FOR BENEFIT OF
051996,000300: 01,3013           12703                           TCF      CHANJOB    +4                         #   POSSIBLE SLEEPING JOB.
051997,000301: 

Page 1216

051999,000303:                                                                                                  #  TO WAKE UP A JOB, EACH CORE SET IS FOUND TO LOCATE ALL JOBS WHICH ARE ASLEEP. IF THE FCADR IN THE
052000,000304:                                                                                                  #  LOC REGISTER OF ANY SUCH JOB MATCHES THAT SUPPLIED BY THE CALLER, THAT JOB IS AWAKENED. IF NO JOB IS FOUND,
052001,000305:                                                                                                  #  LOCCTR IS SET TO -1 AND NO FURTHER ACTION TAKES PLACE.
052002,000306: 
052003,000307: 01,3014           54061        JOBWAKE2           TS       EXECTEM1                              
052004,000308: 01,3015           34772                           CAF      ZERO                                  #  BEGIN CORE SET SCAN.
052005,000309: 01,3016           54064                           TS       LOCCTR                                
052006,000310: 01,3017           32627                           CAF      NO.CORES                              
052007,000311: 01,3020           54062        JOBWAKE4           TS       EXECTEM2                              
052008,000312: 01,3021           50064                           INDEX    LOCCTR                                
052009,000313: 01,3022           10167                           CCS      PRIORITY                              
052010,000314: 01,3023           13026                           TCF      JOBWAKE3                              #  ACTIVE JOB - CHECK NEXT CORE SET.
052011,000315: 01,3024           00014        COREINC            DEC      12         B-14                       #  12 REGISTERS PER CORE SET.
052012,000316: 01,3025           13035                           TCF      WAKETEST                              #  SLEEPING JOB - SEE IF CADR MATCHES.
052013,000317: 
052014,000318: 01,3026           33024        JOBWAKE3           CAF      COREINC                               
052015,000319: 01,3027           26064                           ADS      LOCCTR                                
052016,000320: 01,3030           10062                           CCS      EXECTEM2                              
052017,000321: 01,3031           13020                           TCF      JOBWAKE4                              
052018,000322: 01,3032           44770                           CS       ONE                                   #  EXIT IF SLEEPING JOB NOT FOUND.
052019,000323: 01,3033           54064                           TS       LOCCTR                                
052020,000324: 01,3034           15210                           TCF      ENDFIND                               
052021,000325: 
052022,000326: 01,3035           40065        WAKETEST           CS       NEWLOC                                
052023,000327: 01,3036           50064                           INDEX    LOCCTR                                
052024,000328: 01,3037           60164                           AD       LOC                                   
052025,000329: 01,3040           00006                           EXTEND                                         
052026,000330: 01,3041           13043                           BZF      +2                                    #  IF MATCH.
052027,000331: 01,3042           13026                           TCF      JOBWAKE3                              #  EXAMINE NEXT CORE SET IF NO MATCH.
052028,000332: 
052029,000333: 01,3043           50064                           INDEX    LOCCTR                                #  RE-COMPLEMENT PRIORITY TO SHOW JOB AWAKE
052030,000334: 01,3044           40167                           CS       PRIORITY                              
052031,000335: 01,3045           54063                           TS       NEWPRIO                               
052032,000336: 01,3046           50064                           INDEX    LOCCTR                                
052033,000337: 01,3047           54167                           TS       PRIORITY                              
052034,000338: 
052035,000339: 01,3050           44344                           CS       FBANKMSK                              #  MAKE UP THE 2CADR OF THE WAKE ADDRESS
052036,000340: 01,3051           70065                           MASK     NEWLOC                                #  USING THE CADR IN NEWLOC AND THE EBANK
052037,000341: 01,3052           64756                           AD       2K                                    #  HALF OF BBANK SAVED IN BANKSET.
052038,000342: 01,3053           56065                           XCH      NEWLOC                                
052039,000343: 01,3054           74344                           MASK     FBANKMSK                              
052040,000344: 01,3055           50064                           INDEX    LOCCTR                                
052041,000345: 01,3056           60165                           AD       BANKSET                               
052042,000346: 01,3057           54066                           TS       NEWLOC     +1                         
052043,000347: 
052044,000348: 01,3060           10064                           CCS      LOCCTR                                #  SPECIAL TREATMENT IF THIS JOB WAS
052045,000349: 01,3061           12654                           TCF      SETLOC                                #  ALREADY IN THE RUN (0) POSITION.
052046,000350: 01,3062           12644                           TCF      SPECTEST                              
052047,000351: 

Page 1217

052049,000353:                                                                                                  #  PRIORITY CHANGE. CHANGE THE CONTENTS OF PRIORITY AND SCAN FOR THE JOB OF HIGHEST PRIORITY.
052050,000354: 
052051,000355: 01,3063           54164        PRIOCH2            TS       LOC                                   
052052,000356: 01,3064           34772                           CAF      ZERO                                  #  SET FLAG TO TELL ENDJOB SCANNER IF THIS
052053,000357: 01,3065           54130                           TS       BUF                                   #  JOB IS STILL HIGHEST PRIORITY.
052054,000358: 01,3066           35021                           CAF      LOW9                                  
052055,000359: 01,3067           70167                           MASK     PRIORITY                              
052056,000360: 01,3070           60063                           AD       NEWPRIO                               
052057,000361: 01,3071           54167                           TS       PRIORITY                              
052058,000362: 01,3072           40000                           COM                                            
052059,000363: 01,3073           13000                           TCF      JOBSLP2                               #  AND TO EJSCAN.
052060,000364: 

Page 1218

052062,000366:                                                                                                  #  RELEASE THIS CORE SET AND VAC AREA AND SCAN FOR THE JOB OF HIGHEST ACTIVE PRIORITY.
052063,000367: 
052064,000368: 01,3074           00004        ENDJOB1            INHINT                                         
052065,000369: 01,3075           44772                           CS       ZERO                                  
052066,000370: 01,3076           54131                           TS       BUF        +1                         
052067,000371: 01,3077           56167                           XCH      PRIORITY                              
052068,000372: 01,3100           75021                           MASK     LOW9                                  
052069,000373: 01,3101           54001                           TS       L                                     
052070,000374: 
052071,000375: 01,3102           45213                           CS       FAKEPRET                              
052072,000376: 01,3103           60001                           AD       L                                     
052073,000377: 
052074,000378: 01,3104           00006                           EXTEND                                         
052075,000379: 01,3105           63111                           BZMF     EJSCAN                                #  NOVAC ENDOFJOB
052076,000380: 
052077,000381: 01,3106           10001                           CCS      L                                     
052078,000382: 01,3107           50000                           INDEX    A                                     
052079,000383: 01,3110           54000                           TS       0                                     
052080,000384: 
052081,000385: 01,3111           10203        EJSCAN             CCS      PRIORITY   +12D                       
052082,000386: 01,3112           03156                           TC       EJ1                                   
052083,000387: 01,3113     1361                                  EBANK=   SELFRET                               
052084,000388: 01,3113           66102        SELFBANK           BBCON    SELFCHK                               #  CANNOT GET HERE
052085,000389: 01,3114           13115                           TCF      +1                                    
052086,000390: 
052087,000391: 01,3115           10217                           CCS      PRIORITY   +24D                       #  EXAMINE EACH PRIORITY REGISTER TO FIND
052088,000392: 01,3116           03156                           TC       EJ1                                   #  THE JOB OF HIGHEST ACTIVE PRIORITY.
052089,000393: 01,3117           40201        OCT40201           OCT      40201                                 #  CANNOT GET HERE
052090,000394: 01,3120           13121                           TCF      +1                                    
052091,000395: 
052092,000396: 01,3121           10233                           CCS      PRIORITY   +36D                       
052093,000397: 01,3122           03156                           TC       EJ1                                   
052094,000398: 01,3123           67610        -CCSPR             -CCS     PRIORITY                              
052095,000399: 01,3124           13125                           TCF      +1                                    
052096,000400: 
052097,000401: 01,3125           10247                           CCS      PRIORITY   +48D                       
052098,000402: 01,3126           03156                           TC       EJ1                                   
052099,000403: 01,3127           03724        PHS2CADR           GENADR   PHSPART2                              #  CANNOT GET HERE
052100,000404: 01,3130           13131                           TCF      +1                                    
052101,000405: 
052102,000406: 01,3131           10263                           CCS      PRIORITY   +60D                       
052103,000407: 01,3132           03156                           TC       EJ1                                   
052104,000408: 01,3133           03502        PRT2CADR           GENADR   GETPART2                              #  CANNOT GET HERE
052105,000409: 01,3134           13135                           TCF      +1                                    
052106,000410: 
052107,000411: 01,3135           10277                           CCS      PRIORITY   +72D                       
052108,000412: 01,3136           03156                           TC       EJ1                                   
052109,000413: 01,3137           05332        LGCLCADR           GENADR   LONGCALL                              #  CANNOT GET HERE
052110,000414: 01,3140           13141                           TCF      +1                                    
052111,000415: 

Page 1219

052113,000417:                                                                                                  #  EVALUATE THE RESULTS OF THE SCAN.
052114,000418: 
052115,000419: 01,3141           10131                           CCS      BUF        +1                         #  SEE IF THERE ARE ANY ACTIVE JOBS WAITING
052116,000420: 
052117,000421: 01,3142           53301        GETCADR            DXCH     LONGCADR                              #  CANNOT GET HERE
052118,000422: 01,3143           05214                           TC       SUPDXCHZ                              
052119,000423: 01,3144           13146                           TCF      +2                                    
052120,000424: 01,3145           13171                           TCF      DUMMYJOB                              
052121,000425: 01,3146           10130                           CCS      BUF                                   #  BUF IS ZERO IF THIS IS A PRIOCHNG AND
052122,000426: 01,3147           13151                           TCF      +2                                    #  CHANGED PRIORITY IS STILL HIGHEST.
052123,000427: 01,3150           12755                           TCF      ENDPRCHG   -1                         
052124,000428: 
052125,000429: 01,3151           50000                           INDEX    A                                     #  OTHERWISE, SET NEWJOB TO THE RELATIVE
052126,000430: 01,3152           27777                           CAF      0          -1                         #  ADDRESS OF THE NEW JOB'S CORE SET.
052127,000431: 01,3153           63123                           AD       -CCSPR                                
052128,000432: 01,3154           54067                           TS       NEWJOB                                
052129,000433: 01,3155           12675                           TCF      CHANJOB    -2                         
052130,000434: 
052131,000435: 01,3156           54132        EJ1                TS       BUF        +2                         
052132,000436: 01,3157           60131                           AD       BUF        +1                         #  - OLD HIGH PRIORITY.
052133,000437: 01,3160           10000                           CCS      A                                     
052134,000438: 01,3161           40132                           CS       BUF        +2                         
052135,000439: 01,3162           13165                           TCF      EJ2                                   #  NEW HIGH PRIORITY.
052136,000440: 01,3163           13164                           NOOP                                           
052137,000441: 01,3164           16710                           TCF      Q+2                                   
052138,000442: 
052139,000443: 01,3165           54131        EJ2                TS       BUF        +1                         
052140,000444: 01,3166           30002                           CA       Q                                     
052141,000445: 01,3167           54130                           TS       BUF                                   #  FOR LOCATING CCS PRIORITY + X INSTR.
052142,000446: 01,3170           16710                           TCF      Q+2                                   
052143,000447: 

Page 1220

052145,000449:                                                                                                  #  IDLING AND COMPUTER ACTIVITY (GREEN) LIGHT MAINTENANCE. THE IDLING ROUTINE IS NOT A JOB IN ITSELF,
052146,000450:                                                                                                  #  BUT RATHER A SUBROUTINE OF THE EXECUTIVE.
052147,000451: 
052148,000452: 01,3171     1361                                  EBANK=   SELFRET                               #  SELF-CHECK STORAGE IN EBANK.
052149,000453: 
052150,000454: 01,3171           44772        DUMMYJOB           CS       ZERO                                  #  SET NEWJOB TO -0 FOR IDLING.
052151,000455: 01,3172           54067                           TS       NEWJOB                                
052152,000456: 01,3173           00003                 +2        RELINT                                         
052153,000457: 01,3174           44767                           CS       TWO                                   #  TURN OFF THE ACTIVITY LIGHT.
052154,000458: 01,3175           00006                           EXTEND                                         
052155,000459: 01,3176           03011                           WAND     DSALMOUT                              
052156,000460: 01,3177           10067        ADVAN              CCS      NEWJOB                                #  IS A NEWJOB ACTIVE ?
052157,000461: 01,3200           13002                           TCF      NUCHANG2                              #  YES... ONE REQUIRING A CHANGE JOB.
052158,000462: 01,3201           34767                 +2        CAF      TWO                                   #  NEW JOB ALREADY IN POSITION FOR
052159,000463: 01,3202           13207                           TCF      NUDIRECT                              #  EXECUTION.
052160,000464: 
052161,000465: 01,3203           31361                           CA       SELFRET                               
052162,000466: 01,3204           54001                           TS       L                                     #  PUT RETURN ADDRESS IN L.
052163,000467: 01,3205           33113                           CAF      SELFBANK                              
052164,000468: 01,3206           15215                           TCF      SUPDXCHZ   +1                         #   AND DISPATCH JOB.
052165,000469: 
052166,000470: 01,3207           00006        NUDIRECT           EXTEND                                         #  TURN THE GREEN LIGHT BACK ON.
052167,000471: 01,3210           05011                           WOR      DSALMOUT                              
052168,000472: 01,3211           52165                           DXCH     LOC                                   #  JOBS STARTED IN THIS FASHION MUST BE
052169,000473: 01,3212           15214                           TCF      SUPDXCHZ                              
052170,000474: 
052171,000475:    4000                                           SETLOC   EXECF2                                
052172,000476:    4000                                           BANK                                           
052173,000477: 
052174,000478:    5214                                           COUNT*   $$/EXEC                               
052175,000479: 
052176,000480:                                                                                                  #  SUPDXCHZ - ROUTINE TO TRANSFER TO SUPERBANK.
052177,000481:                                                                                                  #  CALLING SEQUENCE
052178,000482:                                                                                                  #                TCF     SUPDXCHZ        WITH 2CADR OF DESIRED LOCATION IN A + L.
052179,000483: 
052180,000484:    5214           56001        SUPDXCHZ           XCH      L                                     #  BASIC.
052181,000485:    5215           00006                 +1        EXTEND                                         
052182,000486:    5216           01007                           WRITE    SUPERBNK                              
052183,000487:    5217           54006                           TS       BBANK                                 
052184,000488:    5220           00001                           TC       L                                     
052185,000489: 
052186,000490:    5221           77677        NEG100             OCT      77677                                 

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