Source Code

These source-code files are part of a reconstructed copy of Corona 261, the final, flown release of the Block I Command Module (CM) Apollo Guidance Computer (AGC) software for the AS-202 mission.

They have been created via disassembly of binary dumps of the original core rope memory modules actually flown on the mission, part numbers 1003733-171, 1003733-241, 1003733-191, 1003733-211, 1003733-221, and 1003733-241. The source code for the Apollo 4 and 6 software, Solarium 55, was used as a starting point, since it was directly derived from Corona and (at least in theory) only minimally modified.

Since only binary dumps (rather than listings) of Corona 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.

003690,000002:                                                                                                  ## Copyright:   Public domain.
003691,000003:                                                                                                  ## Filename:    EXECUTIVE.agc
003692,000004:                                                                                                  ## Purpose:     A section of Corona revision 261.
003693,000005:                                                                                                  ##              It is part of the source code for the Apollo Guidance Computer
003694,000006:                                                                                                  ##              (AGC) for AS-202. No original listings of this software are
003695,000007:                                                                                                  ##              available; instead, this file was created via disassembly of
003696,000008:                                                                                                  ##              the core rope modules actually flown on the mission.
003697,000009:                                                                                                  ## Assembler:   yaYUL
003698,000010:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
003699,000011:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
003700,000012:                                                                                                  ## Mod history: 2023-05-27 MAS  Created from Solarium 55.
003701,000013: 
003702,000014: 
003703,000015:                                                                                                  #  EXECUTIVE PROGRAMS
003704,000016:                                                                                                  #  --------- --------
003705,000017: 
003706,000018: 
003707,000019: 
003708,000020:    2046                                           BANK     1                                     
003709,000021:    2046           50577        FINDVAC            TS       NEWPRIO                               #  PROGRAM TO FIND AN AVAILABLE VAC
003710,000022:    2047           30001                           XCH      Q                                     
003711,000023:    2050           02065                           TC       EXECCOM                               #  COMMON FF EXECUTIVE SUBROUTINE.
003712,000024:    2051           06004                           TC       FINDVAC2                              #  OFF TO EXECUTIVE BANK.
003713,000025: 
003714,000026:    2052           50577        NOVAC              TS       NEWPRIO                               #  ENTRY EXCLUSIVELY FOR BASIC JOBS NOT
003715,000027:    2053           30001                           XCH      Q                                     #  REQUIRING A VAC AREA.
003716,000028:    2054           02065                           TC       EXECCOM                               #  COMMON FF EXECUTIVE SUBROUTINE.
003717,000029:    2055           35501                           CAF      ZERO                                  #  ZERO PD FIELD IN PUSHLOC.
003718,000030:    2056           50574                           TS       EXECTEM3                              
003719,000031:    2057           06027                           TC       NOVAC2                                
003720,000032: 
003721,000033:    2060           50573        JOBWAKE            TS       EXECTEM2                              #  ENTRY HERE TO RE-ACTIVATE A SLEEPING JOB
003722,000034:    2061           10001                           CCS      Q                                     #  RETURN ADDRESS - 1 TO WTEXIT.
003723,000035:    2062           50600                           TS       WTEXIT                                #  SHARES FINAL PORTION OF FINDVAC, NOVAC.
003724,000036:    2063           02071                           TC       EXECSW                                #  COMMON EXEC BANK-SWITCH SUBROUTINE.
003725,000037:    2064           06110                           TC       JOBWAKE2                              
003726,000038: 
003727,000039:    2065           50600        EXECCOM            TS       WTEXIT                                #  EXIT ADDRESS
003728,000040:    2066           20000                           INDEX    A                                     #  PICK UP JOB OR TASK ADDRESS.
003729,000041:    2067           30000                           CAF      0                                     #    (USED BY FINDVAC, NOVAC, AND WAITLIST)
003730,000042:    2070           50573                           TS       EXECTEM2                              
003731,000043: 
003732,000044:    2071           32075        EXECSW             CAF      EXECBANK                              
003733,000045:    2072           30015                           XCH      BANKREG                               #  CALL IN EXEC BANK, SAVING RETURN.
003734,000046:    2073           50572                           TS       EXECTEM1                              
003735,000047:    2074           00001                           TC       Q                                     
003736,000048: 
003737,000049:    2075           10004        EXECBANK           CADR     FINDVAC2                              
003738,000050: 
003739,000051:    2076           50015        FOUNDVAC           TS       BANKREG                               #  COMES HERE TO RETURN FROM FINDVAC,
003740,000052:    2077           20600                           INDEX    WTEXIT                                #  NOVAC, OR JOBWAKE.
003741,000053:    2100           00001                           TC       1                                     
003742,000054: 
003743,000055: 
003744,000056:                                                                                                  #                CALLS TO FINDVAC BEGIN HERE, SNATCHING AN AVAILABLE VAC AREA.
003745,000057: 
003746,000058: 04,6000                                           SETLOC   10000                                 #  EXEC/WAITLIST BANK.
003747,000059: 
003748,000060: 04,6000           06705        SLAPB              TC       SLAP1                                 
003749,000061: 
003750,000062: 04,6001           07347        KEYRUPTC           TC       KEYRUPT1                              #  STANDARD LOC, DONT MOVE
003751,000063: 
003752,000064: 04,6002           06653        MODROUTB           TC       MODROUT                               #  STANDARD LOC, DONT MOVE
003753,000065: 
003754,000066: 04,6003           06525        SVCT3              TC       SVCT3X                                #  STANDARD LOC.
003755,000067: 
003756,000068: 04,6004           10216        FINDVAC2           CCS      VAC1USE                               #  C(VAC1USE) =  TC VAC1USE  IF VAC1 IS
003757,000069: 04,6005           06020                           TC       FV1                                   #  AVAILABLE, OR +0 IF IT IS IN USE.
003758,000070: 04,6006           10272                           CCS      VAC2USE                               
003759,000071: 04,6007           06020                           TC       FV1                                   #  THE FIRST CCS WITH +0 JUMPS TO THE
003760,000072: 04,6010           10346                           CCS      VAC3USE                               #    CORRESPONDING TC ORDER.
003761,000073: 04,6011           06020                           TC       FV1                                   
003762,000074: 04,6012           10422                           CCS      VAC4USE                               
003763,000075: 04,6013           06020                           TC       FV1                                   
003764,000076: 04,6014           10476                           CCS      VAC5USE                               
003765,000077: 04,6015           06020                           TC       FV1                                   
003766,000078: 
003767,000079: 04,6016           03052                           TC       ABORT                                 #  NO VAC AREAS AVAILABLE.
003768,000080: 04,6017           01201                           OCT      01201                                 
003769,000081: 
003770,000082: 04,6020           65503        FV1                AD       TWO                                   #  TO FORM ADDRESS OF ASSIGNED VAC AREA.
003771,000083: 04,6021           50574                           TS       EXECTEM3                              
003772,000084: 04,6022           60577                           AD       NEWPRIO                               #  )  STORE ADDRESS OF VAC1 IN LOW-ORDER
003773,000085: 04,6023           50577                           TS       NEWPRIO                               #  )    9 BITS OF NEWPRIO.
003774,000086: 
003775,000087: 04,6024           35501                           CAF      ZERO                                  #  )
003776,000088: 04,6025           20574                           INDEX    EXECTEM3                              #  )  STORE +0 IN VAC1USE, INDICATING USE.
003777,000089: 04,6026           47777                           TS       0          -1                         #  )
003778,000090: 
003779,000091: 04,6027           36042        NOVAC2             CAF      LASTADR                               #  RELATIVE ADDRESS OF LAST REGISTER SET.
003780,000092: 04,6030           50601                           TS       LOCCTR                                
003781,000093: 04,6031           10000                           CCS      A                                     
003782,000094: 04,6032           06037                           TC       +5                                    #  PNZ AND -0 ONLY.
003783,000095: 
003784,000096: 04,6033           40573        12BITSOK           CS       EXECTEM2                              #  COMES HERE IF JOB ADDRESS LESS THAN 6K.
003785,000097: 04,6034           06067                           TC       LOCSET                                
003786,000098: 
003787,000099: 04,6035           03052                           TC       ABORT                                 #  NO REGISTER SETS AVAILABLE.
003788,000100: 04,6036           01202                           OCT      01202                                 
003789,000101: 
003790,000102: 04,6037           20601                 +5        INDEX    LOCCTR                                #  THIS LOOP FINDS THE FIRST AVAILABLE
003791,000103: 04,6040           10124                           CCS      PRIORITY                              #    STORAGE AREA FOR CORE REGISTERS FOR
003792,000104: 04,6041           06105                           TC       NOVAC3                                #  THE NEW JOB.
003793,000105: 04,6042           00070        LASTADR            DEC      56         B-14                       #  EIGHT SETS OF EIGHT REGISTERS.
003794,000106: 04,6043           06105                           TC       NOVAC3                                #  NNZ MEANS JOB ASLEEP HERE.
003795,000107: 
003796,000108: 
003797,000109:                                                                                                  #        NOW THAT REGISTER SETS HAVE BEEN FOUND FOR THE NEW JOB, INITIALIZE THEM AND SET NEWJOB IF CALLED FOR.
003798,000110: 
003799,000111: 04,6044           20601        CORSW              INDEX    LOCCTR                                #  (COMES HERE WITH C(A) = 0). TURN OFF OVF
003800,000112: 04,6045           50122                           TS       OVFIND                                
003801,000113: 
003802,000114: 04,6046           60577                           AD       NEWPRIO                               #  SET UP PRIORITY FOR NEW JOB.
003803,000115: 04,6047           20601        JOBWAKE4           INDEX    LOCCTR                                #  JOB WAKING ENTERS HERE TO FINISH UP.
003804,000116: 04,6050           50124                           TS       PRIORITY                              #  STORE NEW PRIORITY
003805,000117: 04,6051           32261                           CAF      BANKMASK                              
003806,000118: 04,6052           70573                           MASK     EXECTEM2                              
003807,000119: 04,6053           60574                           AD       EXECTEM3                              #  PUSHLOC
003808,000120: 04,6054           20601                           INDEX    LOCCTR                                
003809,000121: 04,6055           50123                           TS       PUSHLOC                               
003810,000122: 
003811,000123: 04,6056           36316                           CAF      EXEC70K                               #  CREATE PROPER 12 BIT ADDRESS.
003812,000124: 04,6057           70573                           MASK     EXECTEM2                              #  SEE IF HIGH THREE BITS ZERO.
003813,000125: 04,6060           10000                           CCS      A                                     
003814,000126: 04,6061           06063                           TC       +2                                    #  NEEDS SPECIAL TREATMENT IF C(A) NOT ZERO
003815,000127: 04,6062           06033                           TC       12BITSOK                              
003816,000128: 
003817,000129: 04,6063           30573                           XCH      EXECTEM2                              
003818,000130: 04,6064           74606                           MASK     LOW10                                 
003819,000131: 04,6065           64373                           AD       6K                                    
003820,000132: 04,6066           40000                           COM                                            
003821,000133: 04,6067           20601        LOCSET             INDEX    LOCCTR                                
003822,000134: 04,6070           50120                           TS       LOC                                   
003823,000135: 
003824,000136: 04,6071           20215                           INDEX    NEWJOB                                
003825,000137: 04,6072           40124                           CS       PRIORITY                              #  TEST WHETHER NEW JOB HAS HIGHER
003826,000138: 04,6073           60577                           AD       NEWPRIO                               #  PRIORITY THAN PREVIOUS HIGHEST
003827,000139: 04,6074           10000                           CCS      A                                     
003828,000140: 04,6075           40601                           CS       LOCCTR                                #  NEW JOB HAS HIGHER PRIORITY.
003829,000141: 04,6076           06102                           TC       NEWHIGH                               #  SET NEWJOB, LEAVING LOCCTR UNCHANGED.
003830,000142: 
003831,000143: 04,6077           06100                           TC       +1                                    #  -0 IF PRIORITIES = AND BOTH ARE NOVACS.
003832,000144: 04,6100           30572        NOWAKE2            XCH      EXECTEM1                              
003833,000145: 04,6101           02076        ENDFIND            TC       FOUNDVAC                              
003834,000146: 
003835,000147: 04,6102           40000        NEWHIGH            COM                                            #  SET NEWJOB AND RETURN TO CALLER.
003836,000148: 04,6103           50215                           TS       NEWJOB                                
003837,000149: 04,6104           06100                           TC       ENDFIND    -1                         
003838,000150: 
003839,000151: 04,6105           44513        NOVAC3             CS       EIGHT                                 #  COMES HERE TO EXAMINE NEXT REGISTER SET.
003840,000152: 04,6106           60601                           AD       LOCCTR                                
003841,000153: 04,6107           06030                           TC       NOVAC2     +1                         
003842,000154: 
003843,000155: 
003844,000156:                                                                                                  #        THE  JOBWAKE  ROUTINE REACTIVES A SLEEPING JOB, SETTING IT TO BEGIN AT THE GIVEN WAKE ADDRESS.
003845,000157: 
003846,000158: 04,6110           36042        JOBWAKE2           CAF      LASTADR                               #  BEGIN SEARCH FOR REGISTER SET CONTAINING
003847,000159: 04,6111           50601                           TS       LOCCTR                                #  SLEEPING JOB. WAKE ADDRESS IS IN  LOC IN
003848,000160: 04,6112           10000                           CCS      A                                     #  CADR FORM, AS PLACED THERE BY  JOBSLEEP.
003849,000161: 04,6113           20601                           INDEX    LOCCTR                                #  PNZ AND -0 ONLY. SEE IF THIS JOB ASLEEP.
003850,000162: 04,6114           10124                           CCS      PRIORITY                              #  THIS CCS CANT GO TO  TC NOWAKE  .
003851,000163: 04,6115           06140                           TC       JOBWAKE3                              #  PNZ - ACTIVE JOB PRESENT. +0 IMPOSSIBLE.
003852,000164: 
003853,000165: 04,6116           06143                           TC       NOWAKE                                #  ALARM - SLEEPING JOB NOT FOUND.
003854,000166: 
003855,000167: 04,6117           06121                           TC       +2                                    #  INACTIVE JOB FOUND.
003856,000168: 04,6120           06140                           TC       JOBWAKE3                              #  -0 - NOT IN USE.
003857,000169: 
003858,000170: 04,6121           40573                 +2        CS       EXECTEM2                              #  SEE IF THIS IS THE DESIRED SLEEPING JOB.
003859,000171: 04,6122           20601                           INDEX    LOCCTR                                
003860,000172: 04,6123           60120                           AD       LOC                                   
003861,000173: 04,6124           10000                           CCS      A                                     
003862,000174: 04,6125           06140                           TC       JOBWAKE3                              #  SEARCH NEXT SET IF NOT AT END.
003863,000175: 04,6126           03070                           TC       CCSHOLE                               
003864,000176: 04,6127           06140                           TC       JOBWAKE3                              
003865,000177: 
003866,000178: 04,6130           34606                           CAF      LOW10                                 #  SET UP EXECTEM3 AND PRIORITY SO WE CAN
003867,000179: 04,6131           20601                           INDEX    LOCCTR                                #  FINISH AT STANDARD  CORSW  .
003868,000180: 04,6132           70123                           MASK     PUSHLOC                               #  PROTECT PD SETTING.
003869,000181: 04,6133           50574                           TS       EXECTEM3                              
003870,000182: 
003871,000183: 04,6134           20601                           INDEX    LOCCTR                                #  RE-COMPLEMENT PRIORITY AND FINISH UP.
003872,000184: 04,6135           40124                           CS       PRIORITY                              
003873,000185: 04,6136           50577                           TS       NEWPRIO                               
003874,000186: 04,6137           06047                           TC       JOBWAKE4                              
003875,000187: 
003876,000188: 04,6140           44513        JOBWAKE3           CS       EIGHT                                 #  ADVANCE TO NEXT REGISTER SET.
003877,000189: 04,6141           60601                           AD       LOCCTR                                
003878,000190: 04,6142           06111                           TC       JOBWAKE2   +1                         
003879,000191: 
003880,000192: 04,6143           50601        NOWAKE             TS       LOCCTR                                #  SET LOCCTR = +0 TO SHOW NO JOB WAS
003881,000193: 04,6144           06100                           TC       NOWAKE2                               #   AWAKENED.
003882,000194: 
003883,000195: 
003884,000196:                                                                                                  #  A NEW JOB, OF HIGHER PRIORITY THAN THE PRESENT ONE, CAUSES THE RELA-
003885,000197:                                                                                                  #  TIVE ADDRESS (9, 18, ..., 63) OF THE NEW JOB CORE REGISTERS TO BE
003886,000198:                                                                                                  #  PLACED IN REGISTER  NEWJOB , WHERE IT IS TESTED BY THE INTERPRETER.
003887,000199:                                                                                                  #  THE RESULTING BRANCH TO CHANJOB, BELOW, CAUSES A TRADE BETWEEN THE
003888,000200:                                                                                                  #  CORE REGISTERS OF THE PRESENT AND NEW JOBS.
003889,000201: 
003890,000202:    2101                                           SETLOC   FOUNDVAC   +3                         
003891,000203: 
003892,000204:    2101           20017        CHANG1             INHINT                                         #  BASIC JOBS COME HERE WHEN C(NEWJOB)
003893,000205:    2102           32075                           CAF      EXECBANK                              #  NON-ZERO. START BY CALLING IN EXECUTIVE
003894,000206:    2103           30015                           XCH      BANKREG                               #  BANK AND SAVING RETURN BANK CODE.
003895,000207:    2104           40000                           COM                                            
003896,000208:    2105           50061                           TS       BANKSET                               
003897,000209:    2106           30123                           XCH      PUSHLOC                               #  BLANK OUT THE HIGH-ORDER 4 BITS IN
003898,000210:    2107           74606                           MASK     LOW10                                 #  PUSHLOC SO THE BANK BITS CAN BE PACKED
003899,000211:    2110           50123                           TS       PUSHLOC                               #  WITH IT
003900,000212:    2111           40001                           CS       Q                                     #  FOR RETURN, SHOWING THIS WAS A BASIC JOB
003901,000213:    2112           06145                           TC       CHANJOB                               #  OFF TO BANK 0
003902,000214: 
003903,000215:    2113           10066        CHANG2             CCS      NEWEQIND                              #  INTERPRETIVE INTERRUPTS START HERE, 
003904,000216:    2114           00001                           TC       Q                                     #  PROVIDED THE LOAD INDICATOR ISNT ON
003905,000217: 
003906,000218:    2115           20017                           INHINT                                         
003907,000219:    2116           32075                           CAF      EXECBANK                              #  CALL IN EXECUTIVE BANK.
003908,000220:    2117           50015                           TS       BANKREG                               
003909,000221:    2120           30120                           XCH      LOC                                   
003910,000222:    2121           06145                           TC       CHANJOB                               #  WITH C(A) PNZ, SHOWING WE WERE IN INTERP
003911,000223:                                                                                                  #  RETER
003912,000224: 04,6145                                           SETLOC   NOWAKE     +2                         
003913,000225: 04,6145           20215        CHANJOB            INDEX    NEWJOB                                #  TO BEGIN SWAP OF CORE REGISTERS
003914,000226: 04,6146           30120                           XCH      LOC                                   
003915,000227: 04,6147           50120                           TS       LOC                                   #  SAVE PROPER 12 BIT ADDRESS
003916,000228: 
003917,000229: 04,6150           30124                           XCH      PRIORITY                              
003918,000230: 04,6151           20215                           INDEX    NEWJOB                                
003919,000231: 04,6152           30124                           XCH      PRIORITY                              
003920,000232: 04,6153           50124                           TS       PRIORITY                              
003921,000233: 04,6154           74607                           MASK     LOW9                                  #  TO GET FIXLOC
003922,000234: 04,6155           50067                           TS       FIXLOC                                
003923,000235: 04,6156           64511                           AD       BIT6                                  #  SET UP VACLOC ( = FIXLOC + 32D )
003924,000236: 04,6157           50070                           TS       VACLOC                                
003925,000237: 
003926,000238: 04,6160           40061                           CS       BANKSET                               #  SAVE BANK
003927,000239: 04,6161           60123                           AD       PUSHLOC                               #  AND PUSHLOC IN SAME WORD
003928,000240: 04,6162           20215                           INDEX    NEWJOB                                
003929,000241: 04,6163           30123                           XCH      PUSHLOC                               
003930,000242: 04,6164           50123                           TS       PUSHLOC                               
003931,000243: 04,6165           74606                           MASK     LOW10                                 
003932,000244: 04,6166           30123                           XCH      PUSHLOC                               
003933,000245: 04,6167           40000                           COM                                            
003934,000246: 04,6170           60123                           AD       PUSHLOC                               #  WE NOW HAVE COMPLEMNT OF BANK BITS
003935,000247: 04,6171           50061                           TS       BANKSET                               
003936,000248: 
003937,000249: 04,6172           40121                           CS       ADRLOC                                #  SAVE MODE AND COMPLEMENT OF ADRLOC IN
003938,000250: 04,6173           60000                           DOUBLE                                         #  SAME WORD. ADRLOC MUST BE SHIFTED 2
003939,000251: 04,6174           60000                           DOUBLE                                         #  PLACES TO MAKE ROOM FOR MODE
003940,000252: 04,6175           60065                           AD       MODE                                  #  -0, -1, OR -2
003941,000253: 04,6176           20215                           INDEX    NEWJOB                                
003942,000254: 04,6177           30121                           XCH      ADRLOC                                
003943,000255: 04,6200           50021                           TS       SR                                    
003944,000256: 04,6201           74473                           MASK     THREE                                 #  SAVE LOW 2 BITS
003945,000257: 04,6202           64341                           AD       NEG3                                  #  THIS RESULTS IN EITHER -0, -1, OR -2
003946,000258: 04,6203           50065                           TS       MODE                                  
003947,000259: 04,6204           40021                           CS       SR                                    
003948,000260: 04,6205           40021                           CS       SR                                    
003949,000261: 04,6206           50121                           TS       ADRLOC                                
003950,000262: 
003951,000263: 04,6207           10122                           CCS      OVFIND                                #  SAVE C(ORDER) POSITIVE IF C(OVFIND) = 0
003952,000264: 04,6210           06212                           TC       +2                                    #  AND NEGATIVE OTHERWISE
003953,000265: 04,6211           06214                           TC       +3                                    
003954,000266: 04,6212           40063                           CS       ORDER                                 
003955,000267: 04,6213           06215                           TC       +2                                    
003956,000268: 04,6214           30063                           XCH      ORDER                                 
003957,000269: 04,6215           20215                           INDEX    NEWJOB                                
003958,000270: 04,6216           30122                           XCH      OVFIND                                
003959,000271: 04,6217           50063                           TS       ORDER                                 
003960,000272: 04,6220           10000                           CCS      A                                     #  DETERMINE NEW SETTING OF OVFIND
003961,000273: 04,6221           35501                           CAF      ZERO                                  #  TO ZERO
003962,000274: 04,6222           06226                           TC       OVFSET                                
003963,000275: 04,6223           40063                           CS       ORDER                                 #  ORDER WAS NEGATIVE, MAKE IT POSITIVE
003964,000276: 04,6224           50063                           TS       ORDER                                 
003965,000277: 04,6225           34516                           CAF      ONE                                   #  TO SET OVFIND
003966,000278: 04,6226           50122        OVFSET             TS       OVFIND                                
003967,000279: 
003968,000280: 04,6227           30115                           XCH      MPAC                                  #  TRADE C(MPAC TO MPAC+2)
003969,000281: 04,6230           20215                           INDEX    NEWJOB                                
003970,000282: 04,6231           30115                           XCH      MPAC                                  
003971,000283: 04,6232           50115                           TS       MPAC                                  
003972,000284: 04,6233           30116                           XCH      MPAC       +1                         
003973,000285: 04,6234           20215                           INDEX    NEWJOB                                
003974,000286: 04,6235           30116                           XCH      MPAC       +1                         
003975,000287: 04,6236           50116                           TS       MPAC       +1                         
003976,000288: 04,6237           30117                           XCH      MPAC       +2                         
003977,000289: 04,6240           20215                           INDEX    NEWJOB                                
003978,000290: 04,6241           30117                           XCH      MPAC       +2                         
003979,000291: 04,6242           50117                           TS       MPAC       +2                         
003980,000292: 
003981,000293: 04,6243           35501                           CAF      ZERO                                  
003982,000294: 04,6244           50066                           TS       NEWEQIND                              #  MAKE SURE LOAD INDICATOR OFF.
003983,000295: 04,6245           50215        SETNJ              TS       NEWJOB                                
003984,000296: 04,6246           20016                           RELINT                                         #  ENABLE INTERRUPT
003985,000297: 04,6247           10120                           CCS      LOC                                   #  C(LOC) PNZ FOR INTERPRETIVE JOBS.
003986,000298: 04,6250           35501                           CAF      ZERO                                  
003987,000299: 04,6251           04026                           TC       DANZIG     +2                         #  RETURN TO INTERPRETER
003988,000300: 04,6252           64516                           AD       ONE                                   #  GET ABS(LOC) AND RETURN TO BASIC
003989,000301: 04,6253           50062                           TS       ADDRWD                                
003990,000302: 04,6254           40061                           CS       BANKSET                               #  GET DESIRED BANKBITS
003991,000303: 04,6255           02122        ENDCHANG           TC       BASICALL                              
003992,000304: 
003993,000305:    2122                                           SETLOC   CHANG2     +7D                        #  TAKE UP WHERE WE LEFT OFF IN FIXED-FIXED
003994,000306: 
003995,000307:    2122           50015        BASICALL           TS       BANKREG                               
003996,000308:    2123           00062                           TC       ADDRWD                                
003997,000309: 
003998,000310:    2124           32075        ENDOFJOB           CAF      EXECBANK                              #  NORMAL ENDJOB ENTRY.
003999,000311:    2125           50015                           TS       BANKREG                               
004000,000312:    2126           06256                           TC       ENDJOB1                               
004001,000313: 
004002,000314:    2127           50120        JOBSLEEP           TS       LOC                                   #  ENTRY HERE TO DE-ACTIVE THIS JOB.
004003,000315:    2130           32075                           CAF      EXECBANK                              #  LOC IS SET TO THE AWAKENING ADDRESS
004004,000316:    2131           50015                           TS       BANKREG                               #  SO THE SUBSEQUENT JOBWAKE CAN FIND
004005,000317:    2132           06267                           TC       JOBSLP1                               #  THE PROPER REGISTER SET.
004006,000318: 
004007,000319: 04,6256                                           SETLOC   ENDCHANG   +1                         
004008,000320: 
004009,000321: 04,6256           20017        ENDJOB1            INHINT                                         #  INTERPRETIVE JOBS FINISH WITH RTB
004010,000322: 04,6257           45501                           CS       ZERO                                  #  TO ENDJOB1
004011,000323: 04,6260           50100                           TS       BUF        +1                         #  ENDJOB USES BUF, BUF +1, AND BUF +2.
004012,000324: 04,6261           30124                           XCH      PRIORITY                              
004013,000325: 04,6262           74607                           MASK     LOW9                                  #  RESTORE AVAILABILITY OF VAC1 BY SETTING
004014,000326: 04,6263           10000                           CCS      A                                     #  C(VAC1USE) NON-ZERO
004015,000327: 04,6264           20000                           INDEX    A                                     
004016,000328: 04,6265           50000                           TS       0                                     
004017,000329: 
004018,000330: 04,6266           06274                           TC       EJSCAN                                #  ENDJOB NEED NOT EXAMINE FIRST REG. SET.
004019,000331: 
004020,000332: 04,6267           20017        JOBSLP1            INHINT                                         #  FINISH JOB SLEEP AND START ENDJOB-TYPE
004021,000333: 04,6270           40124                           CS       PRIORITY                              #  SCAN. COMPLEMENTED PRIORITY REGISTER
004022,000334: 04,6271           50124                           TS       PRIORITY                              #  SHOWS JOB IS ASLEEP.
004023,000335: 04,6272           45501                           CS       ZERO                                  #  INITIALIZE SEARCH FOR HIGHEST PRIORITY. 
004024,000336: 04,6273           50100                           TS       BUF        +1                         
004025,000337: 
004026,000338: 
004027,000339:                                                                                                  #        SCAN FOR THE ACTIVE JOB OF HIGHEST PRIORITY.
004028,000340: 
004029,000341: 04,6274           10134        EJSCAN             CCS      PRIORITY   +8D                        #  EACH PRIORITY REGISTER (PRIORITY +8N)
004030,000342: 04,6275           06341                           TC       EJ1                                   #  IS SCANNED. ITS CONTENTS ARE EITHER
004031,000343: 04,6276           03070                           TC       CCSHOLE                               
004032,000344: 04,6277           06300                           TC       +1                                    #     2. NNZ - AN INACTIVE PRIORITY NUMBER.
004033,000345: 
004034,000346: 04,6300           10144                           CCS      PRIORITY   +16D                       #  OR 3. -0 - NOT IN USE.
004035,000347: 04,6301           06341                           TC       EJ1                                   #  IF PNZ, CONTROL IS TRANSFERRED TO EJ1
004036,000348: 04,6302           03070                           TC       CCSHOLE                               
004037,000349: 04,6303           06304                           TC       +1                                    #  PARED WITH THE PREVIOUS HIGHEST
004038,000350: 
004039,000351: 04,6304           10154                           CCS      PRIORITY   +24D                       #  PRIORITY FOUND. THE CONTENTS OF Q
004040,000352: 04,6305           06341                           TC       EJ1                                   #  SERVE TO LOCATE THE CCS WHICH WAS
004041,000353: 04,6306           03070                           TC       CCSHOLE                               
004042,000354: 04,6307           06310                           TC       +1                                    #  NEWJOB IS SET TO THE RELATIVE ADDRESS
004043,000355: 
004044,000356: 04,6310           10164                           CCS      PRIORITY   +32D                       #  OF THE REGISTER SET WITH THE HIGHTEST 
004045,000357: 04,6311           06341                           TC       EJ1                                   #  ACTIVE PRIORITY AT THE END OF THE SCAN.
004046,000358: 04,6312           03070                           TC       CCSHOLE                               
004047,000359: 04,6313           06314                           TC       +1                                    
004048,000360: 
004049,000361: 04,6314           10174                           CCS      PRIORITY   +40D                       
004050,000362: 04,6315           06341                           TC       EJ1                                   
004051,000363: 04,6316           70000        EXEC70K            OCT      70000                                 
004052,000364: 04,6317           06320                           TC       +1                                    
004053,000365: 
004054,000366: 04,6320           10204                           CCS      PRIORITY   +48D                       
004055,000367: 04,6321           06341                           TC       EJ1                                   
004056,000368: 04,6322           67653        -CCSPR            -CCS      PRIORITY                              
004057,000369: 04,6323           06324                           TC       +1                                    
004058,000370: 
004059,000371: 04,6324           10214                           CCS      PRIORITY   +56D                       
004060,000372: 04,6325           06341                           TC       EJ1                                   
004061,000373: 04,6326           03070                           TC       CCSHOLE                               
004062,000374: 04,6327           06330                           TC       +1                                    
004063,000375: 04,6330           10077                           CCS      BUF                                   #  IF BUF = 0, THE SCAN WAS PART OF
004064,000376: 04,6331           06333                           TC       +2                                    #  A PRIORITY CHANGE IN WHICH THE NEW
004065,000377: 04,6332           06245                           TC       SETNJ                                 #  PRIORITY IS HIGHEST. GO SET NEWJOB = 0.
004066,000378: 
004067,000379: 04,6333           20000                           INDEX    A                                     #  PICK UP CCS INSTRUCTION TO GET NEWJOB
004068,000380: 04,6334           27777                           CAF      0          -1                         #  SELECT CCS INSTRUCTION.
004069,000381: 04,6335           66322                           AD       -CCSPR                                
004070,000382: 04,6336           50215                           TS       NEWJOB                                #  RELATIVE ADDRESS ONLY.
004071,000383: 04,6337           30120                           XCH      LOC                                   #  (NO MEANING FOR ENDOFJOB).
004072,000384: 04,6340           06145                           TC       CHANJOB                               
004073,000385: 
004074,000386: 
004075,000387: 
004076,000388: 04,6341           50101        EJ1                TS       BUF        +2                         #  STORE NEW PRIORITY
004077,000389: 04,6342           60100                           AD       BUF        +1                         #  - OLD PRIORITY
004078,000390: 04,6343           10000                           CCS      A                                     
004079,000391: 04,6344           30001                           XCH      Q                                     #  IF NEW PRIORITY IS LARGER
004080,000392: 04,6345           06351                           TC       EJ2                                   
004081,000393: 04,6346           30000                           NOOP                                           #  IF OLD PRIORITY IS LARGER
004082,000394: 04,6347           20001                           INDEX    Q                                     #    OR EQUAL
004083,000395: 04,6350           00002                           TC       2                                     
004084,000396: 
004085,000397: 04,6351           50077        EJ2                TS       BUF                                   #  SAVE C(Q) TO LOCATE HIGHEST PRIORITY
004086,000398: 04,6352           40101                           CS       BUF        +2                         #    JOB AT END OF SCAN.
004087,000399: 04,6353           50100                           TS       BUF        +1                         
004088,000400: 04,6354           20077                           INDEX    BUF                                   
004089,000401: 04,6355           00002                           TC       2                                     
004090,000402: 
004091,000403: 
004092,000404:                                                                                                  #        THE FOLLOWING ROUTINE IS AVAILABLE TO CHANGE THE PRIORITY OF A JOB WHILE IT IS RUNNING UNDER EXECUTIVE
004093,000405:                                                                                                  #  CONTROL (IE, IN CORE SET 0). CALLING SEQUENCE IS AS FOLLOWS (NO INHINT NECESSARY):
004094,000406: 
004095,000407:                                                                                                  #                CAF     NEWPRIO         PRIORITY IN BITS 10-14 - ZERO ELSEWHERE.
004096,000408:                                                                                                  #        L       TC      PRIOCHNG
004097,000409: 
004098,000410:                                                                                                  #  RETURN IS TO L+1 IMMEDIATELY UNLESS A JOB OF STILL HIGHER PRIORITY IS PRESENT, IN WHICH CASE IT GOES TO CHANJOB
004099,000411:                                                                                                  #  BEFORE RETURNING.
004100,000412: 
004101,000413: 
004102,000414: 
004103,000415:    2133                                           SETLOC   JOBSLEEP   +4                         
004104,000416: 
004105,000417:    2133           20017        PRIOCHNG           INHINT                                         #  PREPARE Q, BANK, AND PUSHLOC (ALA
004106,000418:    2134           50577                           TS       NEWPRIO                               #  CHANG1) IN CASE WE HAVE TO CHANGE JOBS.
004107,000419:    2135           40001                           CS       Q                                     
004108,000420:    2136           50120                           TS       LOC                                   
004109,000421:    2137           32075                           CAF      EXECBANK                              
004110,000422:    2140           30015                           XCH      BANKREG                               
004111,000423:    2141           06356                           TC       PRIOCH2                               #  OFF TO EXECUTIVE BANK.
004112,000424: 
004113,000425: 04,6356                                           SETLOC   EJ2        +5                         
004114,000426: 
004115,000427: 04,6356           40000        PRIOCH2            COM                                            
004116,000428: 04,6357           50061                           TS       BANKSET                               
004117,000429: 04,6360           30123                           XCH      PUSHLOC                               
004118,000430: 04,6361           74606                           MASK     LOW10                                 
004119,000431: 04,6362           50123                           TS       PUSHLOC                               
004120,000432: 
004121,000433: 04,6363           34607                           CAF      LOW9                                  #  MAKE UP NEW PRIORITY WORD, LEAVING
004122,000434: 04,6364           70124                           MASK     PRIORITY                              #  POSSIBLE VAC ADDRESS INTACT.
004123,000435: 04,6365           60577                           AD       NEWPRIO                               
004124,000436: 04,6366           50124                           TS       PRIORITY                              
004125,000437: 04,6367           40000                           COM                                            #  INITIALIZE BUF +1 TO - THIS PRIORITY FOR
004126,000438: 04,6370           50100                           TS       BUF        +1                         #  SEARCH FOR HIGHEST PRIORITY.
004127,000439: 
004128,000440: 04,6371           35501                           CAF      ZERO                                  #  SET BUF TO ZERO AS A FLAG FOR END OF
004129,000441: 04,6372           50077                           TS       BUF                                   #  SCAN.
004130,000442: 04,6373           06274                           TC       EJSCAN                                #  SCAN FOR HIGHEST PRIORITY.
004131,000443: 
004132,000444: 
004133,000445:                                                                                                  #  LIST OF PROGRAM PRIORITIES
004134,000446: 
004135,000447:    2142                                           SETLOC   PRIOCHNG   +7                         
004136,000448: 
004137,000449:    2142     4505               PRIO1              EQUALS   BIT10                                 
004138,000450:    2142     4504               PRIO2              EQUALS   BIT11                                 
004139,000451:    2142           03000        PRIO3              OCT      03000                                 
004140,000452:    2143     4503               PRIO4              EQUALS   BIT12                                 
004141,000453:    2143           05000        PRIO5              OCT      05000                                 
004142,000454:    2144     2143               OCT05000           EQUALS   PRIO5                                 
004143,000455:    2144     4373               PRIO6              EQUALS   6K                                    
004144,000456:    2144           07000        PRIO7              OCT      07000                                 
004145,000457:    2145     4502               PRIO10             EQUALS   BIT13                                 
004146,000458:    2145           11000        PRIO11             OCT      11000                                 
004147,000459:    2146           12000        PRIO12             OCT      12000                                 
004148,000460:    2147           13000        PRIO13             OCT      13000                                 
004149,000461:    2150           14000        PRIO14             OCT      14000                                 
004150,000462:    2151           15000        PRIO15             OCT      15000                                 
004151,000463:    2152           16000        PRIO16             OCT      16000                                 
004152,000464:    2153           17000        PRIO17             OCT      17000                                 
004153,000465:    2154     4501               PRIO20             EQUALS   BIT14                                 
004154,000466:    2154           21000        PRIO21             OCT      21000                                 
004155,000467:    2155           22000        PRIO22             OCT      22000                                 
004156,000468:    2156           23000        PRIO23             OCT      23000                                 
004157,000469:    2157           24000        PRIO24             OCT      24000                                 
004158,000470:    2160           25000        PRIO25             OCT      25000                                 
004159,000471:    2161           26000        PRIO26             OCT      26000                                 
004160,000472:    2162           27000        PRIO27             OCT      27000                                 
004161,000473:    2163           30000        PRIO30             OCT      30000                                 
004162,000474:    2164           31000        PRIO31             OCT      31000                                 
004163,000475:    2165           32000        PRIO32             OCT      32000                                 
004164,000476:    2166           33000        PRIO33             OCT      33000                                 
004165,000477:    2167           34000        PRIO34             OCT      34000                                 
004166,000478:    2170           35000        PRIO35             OCT      35000                                 
004167,000479:    2171           36000        PRIO36             OCT      36000                                 
004168,000480:    2172           37000        PRIO37             OCT      37000                                 

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