Source Code

This is the source-code for the Apollo 9 Command Module's Guidance Computer. These files were derived originally from the scan from MIT's Dibner Institute's now-discontinued website titled "History of Recent Science and Technology", which in turn was originally created by Gary Neff, though his high-quality scans were unfortunately reduced in legibility when presented online. The markings on the front of the printout imply that it was the original AGC developer Norm Brodeur's copy. A scan by Ron Burkey has superceded it, made from a more-legible copy from the collection of original AGC developer Fred Martin. The source code was transcribed from those images by Ron Burkey. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	ASSEMBLE REVISION 249 OF AGC PROGRAM COLOSSUS BY NASA 2021111-041
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

051587,000002:                                                                                                  ## Copyright:   Public domain.
051588,000003:                                                                                                  ## Filename:    EXECUTIVE.agc
051589,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus, build 249.
051590,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
051591,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 9.
051592,000007:                                                                                                  ## Assembler:   yaYUL
051593,000008:                                                                                                  ## Reference:   Starts on p. 1178
051594,000009:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
051595,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo.
051596,000011:                                                                                                  ## Mod history: 08/28/04   RSB  Adapted from correspoinding Luminary131 file.
051597,000012:                                                                                                  ##              2010-10-24 JL   Indentation fixes.
051598,000013:                                                                                                  ##              2011-05-07 JL   Removed workarounds.
051599,000014:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
051600,000015:                                                                                                  ##                              original harcopy, as opposed to the PDF page
051601,000016:                                                                                                  ##                              numbers in 1701.pdf.
051602,000017:                                                                                                  ##              2017-01-12 RSB  Proofed comment text with 3-way side-by-side 
051603,000018:                                                                                                  ##                              diff vs Colossus 237 and Comanche 55.  After
051604,000019:                                                                                                  ##                              errors were corrected, the three were identical.
051605,000020:                                                                                                  ##              2017-01-22 RSB  Back-ported comment error fixes detected in diff'ing
051606,000021:                                                                                                  ##                              Artemis 72 vs Comanche 55.
051607,000022:                                                                                                  ##
051608,000023:                                                                                                  ## The contents of the "Colossus249" files, in general, are transcribed 
051609,000024:                                                                                                  ## from a scanned copy of the program listing.  Notations on this
051610,000025:                                                                                                  ## document read, in part:
051611,000026:                                                                                                  ##
051612,000027:                                                                                                  ##      Assemble revision 249 of AGC program Colossus by NASA
051613,000028:                                                                                                  ##      2021111-041.  October 28, 1968.  
051614,000029:                                                                                                  ##
051615,000030:                                                                                                  ##      This AGC program shall also be referred to as
051616,000031:                                                                                                  ##                              Colossus 1A
051617,000032:                                                                                                  ##
051618,000033:                                                                                                  ##      Prepared by
051619,000034:                                                                                                  ##                      Massachusetts Institute of Technology
051620,000035:                                                                                                  ##                      75 Cambridge Parkway
051621,000036:                                                                                                  ##                      Cambridge, Massachusetts
051622,000037:                                                                                                  ##      under NASA contract NAS 9-4065.
051623,000038:                                                                                                  ##
051624,000039:                                                                                                  ## Refer directly to the online document mentioned above for further information.
051625,000040:                                                                                                  ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
051626,000041:                                                                                                  ##
051627,000042:                                                                                                  ## In some cases, where the source code for Luminary 131 overlaps that of 
051628,000043:                                                                                                  ## Colossus 249, this code is instead copied from the corresponding Luminary 131
051629,000044:                                                                                                  ## source file, and then is proofed to incorporate any changes.
051630,000045: 

Page 1178

051632,000047:    5027                                           BLOCK    02                                    
051633,000048: 
051634,000049:                                                                                                  #  TO ENTER A JOB REQUEST REQUIRING NO VAC AREA:
051635,000050: 
051636,000051:    5027                                           COUNT    02/EXEC                               
051637,000052: 
051638,000053:    5027           00004        NOVAC              INHINT                                         
051639,000054:    5030           65121                           AD       FAKEPRET                              #  LOC(MPAC +6) - LOC(QPRET)
051640,000055:    5031           54063                           TS       NEWPRIO                               #  PRIORITY OF NEW JOB + NOVAC C(FIXLOC)
051641,000056: 
051642,000057:    5032           00006                           EXTEND                                         
051643,000058:    5033           50002                           INDEX    Q                                     #  Q WILL BE UNDISTURBED THROUGHOUT.
051644,000059:    5034           30001                           DCA      0                                     #  2CADR OF JOB ENTERED.
051645,000060:    5035           52066                           DXCH     NEWLOC                                
051646,000061:    5036           35120                           CAF      EXECBANK                              
051647,000062:    5037           56004                           XCH      FBANK                                 
051648,000063:    5040           54061                           TS       EXECTEM1                              
051649,000064:    5041           12650                           TCF      NOVAC2                                #  ENTER EXECUTIVE BANK.
051650,000065: 
051651,000066:                                                                                                  #  TO ENTER A JOB REQUEST REQUIRING A VAC AREA - E.G., ALL (PARTIALLY) INTERPRETIVE JOBS.
051652,000067: 
051653,000068:    5042           00004        FINDVAC            INHINT                                         
051654,000069:    5043           54063                           TS       NEWPRIO                               
051655,000070:    5044           00006                           EXTEND                                         
051656,000071:    5045           50002                           INDEX    Q                                     
051657,000072:    5046           30001                           DCA      0                                     
051658,000073:    5047           52066        SPVACIN            DXCH     NEWLOC                                
051659,000074:    5050           35120                           CAF      EXECBANK                              
051660,000075:    5051           56004                           XCH      FBANK                                 
051661,000076:    5052           12626                           TCF      FINDVAC2                              #  OFF TO EXECUTIVE SWITCHED-BANK.
051662,000077: 
051663,000078:                                                                                                  #  TO ENTER A FINDVAC WITH THE PRIORITY IN NEWPRIO TO THE 2CADR ARRIVING IN A AND L:
051664,000079:                                                                                                  #  USERS OF SPVAC MUST INHINT BEFORE STORING IN NEWPRIO.
051665,000080: 
051666,000081:    5053           56002        SPVAC              XCH      Q                                     
051667,000082:    5054           67715                           AD       NEG2                                  
051668,000083:    5055           56002                           XCH      Q                                     
051669,000084:    5056           15047                           TCF      SPVACIN                               
051670,000085: 
051671,000086:                                                                                                  #  TO SUSPEND A BASIC JOB SO A HIGHER PRIORITY JOB MAY BE SERVICED:
051672,000087: 
051673,000088:    5057           22002        CHANG1             LXCH     Q                                     
051674,000089:    5060           35120                           CAF      EXECBANK                              
051675,000090:    5061           56006                           XCH      BBANK                                 
051676,000091:    5062           12727                           TCF      CHANJOB                               
051677,000092: 
051678,000093:                                                                                                  #  TO SUSPEND AN INTERPRETIVE JOB:
051679,000094: 
051680,000095:    5063           40164        CHANG2             CS       LOC                                   #  NEGATIVE LOC SHOWS JOB = INTERPRETIVE.
051681,000096: 
051682,000097:                                                                                                  #  ITRACE (4) REFERS TO "CHANG2".

Page 1179

051684,000099:    5064           54001                           TS       L                                     
051685,000100:    5065           35120                 +2        CAF      EXECBANK                              
051686,000101:    5066           54006                           TS       BBANK                                 
051687,000102:    5067           12726                           TCF      CHANJOB    -1                         
051688,000103: 

Page 1180

051690,000105:                                                                                                  #  TO VOLUNTARILY SUSPEND A JOB UNTIL THE COMPLETION OF SOME ANTICIPATED EVENT (I/O EVENT ETC.):
051691,000106: 
051692,000107:    5070           54164        JOBSLEEP           TS       LOC                                   
051693,000108:    5071           35120                           CAF      EXECBANK                              
051694,000109:    5072           54004                           TS       FBANK                                 
051695,000110:    5073           13017                           TCF      JOBSLP1                               
051696,000111: 
051697,000112:                                                                                                  #  TO AWAKEN A JOB PUT TO SLEEP IN THE ABOVE FASHION:
051698,000113: 
051699,000114:    5074           00004        JOBWAKE            INHINT                                         
051700,000115:    5075           54065                           TS       NEWLOC                                
051701,000116:    5076           44711                           CS       TWO                                   #  EXIT IS VIA FINDVAC/NOVAC PROCEDURES.
051702,000117:    5077           26002                           ADS      Q                                     
051703,000118:    5100           35120                           CAF      EXECBANK                              
051704,000119:    5101           56004                           XCH      FBANK                                 
051705,000120:    5102           13044                           TCF      JOBWAKE2                              
051706,000121: 
051707,000122:                                                                                                  #  TO CHANGE THE PRIORITY OF A JOB CURRENTLY UNDER EXECUTION:
051708,000123: 
051709,000124:    5103           00004        PRIOCHNG           INHINT                                         #  NEW PRIORITY ARRIVES IN A.  RETURNS TO
051710,000125:    5104           54063                           TS       NEWPRIO                               #  CALLER AS SOON AS NEW JOB PRIORITY IS
051711,000126:    5105           35120                           CAF      EXECBANK                              #  HIGHEST.  PREPARE FOR POSSIBLE BASIC-
051712,000127:    5106           56006                           XCH      BBANK                                 #  STYLE CHANGE-JOB.
051713,000128:    5107           54165                           TS       BANKSET                               
051714,000129:    5110           30002                           CA       Q                                     
051715,000130:    5111           13113                           TCF      PRIOCH2                               
051716,000131: 
051717,000132:                                                                                                  #  TO REMOVE A JOB FROM EXECUTIVE CONSIDERATIONS:
051718,000133: 
051719,000134:    5112           35120        ENDOFJOB           CAF      EXECBANK                              
051720,000135:    5113           54004                           TS       FBANK                                 
051721,000136:    5114           13124                           TCF      ENDJOB1                               
051722,000137: 
051723,000138:    5115           30061        ENDFIND            CA       EXECTEM1                              #  RETURN TO CALLER AFTER JOB ENTRY
051724,000139:    5116           54004                           TS       FBANK                                 #  COMPLETE.
051725,000140:    5117           16710                           TCF      Q+2                                   
051726,000141:    5120           02626        EXECBANK           CADR     FINDVAC2                              
051727,000142: 
051728,000143:    5121           00110        FAKEPRET           ADRES    MPAC       -36D                       #  LOC(MPAC +6) - LOC(QPRET)
051729,000144: 

Page 1181

051731,000146:                                                                                                  #  LOCATE AN AVAILABLE VAC AREA.
051732,000147: 
051733,000148: 01,2626                                           BANK     01                                    
051734,000149: 01,2626                                           COUNT    01/EXEC                               
051735,000150: 
051736,000151: 01,2626           54061        FINDVAC2           TS       EXECTEM1                              #  (SAVE CALLER'S BANK FIRST.)
051737,000152: 01,2627           10400                           CCS      VAC1USE                               
051738,000153: 01,2630           12643                           TCF      VACFOUND                              
051739,000154: 01,2631           10454                           CCS      VAC2USE                               
051740,000155: 01,2632           12643                           TCF      VACFOUND                              
051741,000156: 01,2633           10530                           CCS      VAC3USE                               
051742,000157: 01,2634           12643                           TCF      VACFOUND                              
051743,000158: 01,2635           10604                           CCS      VAC4USE                               
051744,000159: 01,2636           12643                           TCF      VACFOUND                              
051745,000160: 01,2637           10660                           CCS      VAC5USE                               
051746,000161: 01,2640           12643                           TCF      VACFOUND                              
051747,000162: 01,2641           05604                           TC       BAILOUT                               
051748,000163: 01,2642           01201                           OCT      1201                                  #  NO VAC AREAS.
051749,000164: 
051750,000165: 01,2643           64711        VACFOUND           AD       TWO                                   #  RESERVE THIS VAC AREA BY STORING A ZERO
051751,000166: 01,2644           22007                           ZL                                             #  IN ITS VAC USE REGISTER AND STORE THE
051752,000167: 01,2645           50000                           INDEX    A                                     #  ADDRESS OF THE FIRST WORD OF IT IN THE
051753,000168: 01,2646           21777                           LXCH     0          -1                         #  LOW NINE BITS OF THE PRIORITY WORD.
051754,000169: 01,2647           26063                           ADS      NEWPRIO                               
051755,000170: 
051756,000171: 01,2650           34714        NOVAC2             CAF      ZERO                                  #  NOVAC ENTERS HERE.  FIND A CORE SET.
051757,000172: 01,2651           54064                           TS       LOCCTR                                
051758,000173: 01,2652           32657                           CAF      NO.CORES                              #  SEVEN SETS OF ELEVEN REGISTERS EACH.
051759,000174: 01,2653           54062        NOVAC3             TS       EXECTEM2                              
051760,000175: 01,2654           50064                           INDEX    LOCCTR                                
051761,000176: 01,2655           10167                           CCS      PRIORITY                              #  EACH PRIORITY REGISTER CONTAINS -0 IF
051762,000177: 01,2656           12717                           TCF      NEXTCORE                              #  THE CORRESPONDING CORE SET IS AVAILABLE.
051763,000178: 01,2657           00006        NO.CORES           DEC      6          B-14                       
051764,000179: 01,2660           12717                           TCF      NEXTCORE                              #  AN ACTIVE JOB HAS A POSITIVE PRIORITY
051765,000180:                                                                                                  #  BUT A DORMANT JOB'S PRIORITY IS NEGATIVE
051766,000181: 

Page 1182

051768,000183: 01,2661           30063        CORFOUND           CA       NEWPRIO                               #  SET THE PRIORITY OF THIS JOB IN THE CORE
051769,000184: 01,2662           50064                           INDEX    LOCCTR                                #  SET'S PRIORITY REGISTER AND SET THE
051770,000185: 01,2663           54167                           TS       PRIORITY                              #  JOB'S PUSH-DOWN POINTER AT THE BEGINNING
051771,000186: 01,2664           74741                           MASK     LOW9                                  #  OF THE WORK AREA AND OVERFLOW INDICATOR
051772,000187: 01,2665           50064                           INDEX    LOCCTR                                
051773,000188: 01,2666           54166                           TS       PUSHLOC                               #  OFF TO PREPARE FOR INTERPRETIVE PROGRAMS
051774,000189: 
051775,000190: 01,2667           10064                           CCS      LOCCTR                                #  IF CORE SET ZERO IS BEING LOADED, SET UP
051776,000191: 01,2670           12704                           TCF      SETLOC                                #  OVFIND AND FIXLOC IMMEDIATELY.
051777,000192: 01,2671           54121                           TS       OVFIND                                
051778,000193: 01,2672           30166                           CA       PUSHLOC                               
051779,000194: 01,2673           54120                           TS       FIXLOC                                
051780,000195: 
051781,000196: 01,2674           10067        SPECTEST           CCS      NEWJOB                                #  SEE IF ANY ACTIVE JOBS WAITING (RARE).
051782,000197: 01,2675           12704                           TCF      SETLOC                                #  MUST BE AWAKENED BUT UNCHANGED JOB.
051783,000198: 01,2676           05640                           TC       CCSHOLE                               
051784,000199: 01,2677           05640                           TC       CCSHOLE                               
051785,000200: 01,2700           54067                           TS       NEWJOB                                #  +0 SHOWS ACTIVE JOB ALREADY SET.
051786,000201: 01,2701           52066                           DXCH     NEWLOC                                
051787,000202: 01,2702           52165                           DXCH     LOC                                   
051788,000203: 01,2703           15115                           TCF      ENDFIND                               
051789,000204: 
051790,000205: 01,2704           52066        SETLOC             DXCH     NEWLOC                                #  SET UP THE LOCATION REGISTERS FOR THIS
051791,000206: 01,2705           50064                           INDEX    LOCCTR                                
051792,000207: 01,2706           52165                           DXCH     LOC                                   
051793,000208: 01,2707           50067                           INDEX    NEWJOB                                #  THIS INDEX INSTRUCTION INSURES THAT THE
051794,000209: 01,2710           40167                           CS       PRIORITY                              #  HIGHEST ACTIVE PRIORITY WILL BE COMPARED
051795,000210: 01,2711           60063                           AD       NEWPRIO                               #  WITH THE NEW PRIORITY TO SEE IF NEWJOB
051796,000211: 01,2712           00006                           EXTEND                                         #  SHOULD BE SET TO SIGNAL A SWITCH.
051797,000212: 01,2713           65115                           BZMF     ENDFIND                               
051798,000213: 01,2714           30064                           CA       LOCCTR                                #  LOCCTR IS LEFT SET AT THIS CORE SET IF
051799,000214: 01,2715           54067                           TS       NEWJOB                                #  THE CALLER WANTS TO LOAD ANY MPAC
051800,000215: 01,2716           15115                           TCF      ENDFIND                               #  REGISTERS, ETC.
051801,000216: 
051802,000217: 01,2717           33054        NEXTCORE           CAF      COREINC                               
051803,000218: 01,2720           26064                           ADS      LOCCTR                                
051804,000219: 01,2721           10062                           CCS      EXECTEM2                              
051805,000220: 01,2722           12653                           TCF      NOVAC3                                
051806,000221: 01,2723           05604                           TC       BAILOUT                               #  NO CORE SETS.
051807,000222: 01,2724           01202                           OCT      1202                                  

Page 1183

051809,000224:                                                                                                  #  THE FOLLOWING ROUTINE SWAPS CORE SET 0 WITH THAT WHOSE RELATIVE ADDRESS IS IN NEWJOB.
051810,000225: 
051811,000226: 01,2725           22164                 -2        LXCH     LOC                                   
051812,000227: 01,2726           30165                 -1        CAE      BANKSET                               #  BANKSET, NOT BBANK, HAS RIGHT CONTENTS.
051813,000228: 01,2727           00004        CHANJOB            INHINT                                         
051814,000229: 01,2730           00006                           EXTEND                                         
051815,000230: 01,2731           04007                           ROR      SUPERBNK                              #  PICK UP CURRENT SBANK FOR BBCON
051816,000231: 01,2732           56001                           XCH      L                                     #  LOC IN A AND BBCON IN L.
051817,000232: 01,2733           50067                 +4        INDEX    NEWJOB                                #  SWAP LOC AND BANKSET.
051818,000233: 01,2734           52165                           DXCH     LOC                                   
051819,000234: 01,2735           52165                           DXCH     LOC                                   
051820,000235: 
051821,000236: 01,2736           30165                           CAE      BANKSET                               
051822,000237: 01,2737           00006                           EXTEND                                         
051823,000238: 01,2740           01007                           WRITE    SUPERBNK                              #  SET SBANK FOR NEW JOB.
051824,000239: 01,2741           52155                           DXCH     MPAC                                  #  SWAP MULTI-PURPOSE ACCUMULATOR AREAS.
051825,000240: 01,2742           50067                           INDEX    NEWJOB                                
051826,000241: 01,2743           52155                           DXCH     MPAC                                  
051827,000242: 01,2744           52155                           DXCH     MPAC                                  
051828,000243: 01,2745           52157                           DXCH     MPAC       +2                         
051829,000244: 01,2746           50067                           INDEX    NEWJOB                                
051830,000245: 01,2747           52157                           DXCH     MPAC       +2                         
051831,000246: 01,2750           52157                           DXCH     MPAC       +2                         
051832,000247: 01,2751           52161                           DXCH     MPAC       +4                         
051833,000248: 01,2752           50067                           INDEX    NEWJOB                                
051834,000249: 01,2753           52161                           DXCH     MPAC       +4                         
051835,000250: 01,2754           52161                           DXCH     MPAC       +4                         
051836,000251: 01,2755           52163                           DXCH     MPAC       +6                         
051837,000252: 01,2756           50067                           INDEX    NEWJOB                                
051838,000253: 01,2757           52163                           DXCH     MPAC       +6                         
051839,000254: 01,2760           52163                           DXCH     MPAC       +6                         
051840,000255: 
051841,000256: 01,2761           34714                           CAF      ZERO                                  
051842,000257: 01,2762           56121                           XCH      OVFIND                                #  MAKE PUSHLOC NEGATIVE IF OVFIND NZ.
051843,000258: 01,2763           00006                           EXTEND                                         
051844,000259: 01,2764           12767                           BZF      +3                                    
051845,000260: 01,2765           40166                           CS       PUSHLOC                               
051846,000261: 01,2766           54166                           TS       PUSHLOC                               
051847,000262: 
051848,000263: 01,2767           52167                           DXCH     PUSHLOC                               
051849,000264: 01,2770           50067                           INDEX    NEWJOB                                
051850,000265: 01,2771           52167                           DXCH     PUSHLOC                               
051851,000266: 01,2772           52167                           DXCH     PUSHLOC                               #  SWAPS PUSHLOC AND PRIORITY.
051852,000267: 01,2773           34741                           CAF      LOW9                                  #  SET FIXLOC TO BASE OF VAC AREA.
051853,000268: 01,2774           70167                           MASK     PRIORITY                              
051854,000269: 01,2775           54120                           TS       FIXLOC                                
051855,000270: 
051856,000271: 01,2776           10166                           CCS      PUSHLOC                               #  SET OVERFLOW INDICATOR ACCORDING TO
051857,000272: 01,2777           34714                           CAF      ZERO                                  
051858,000273: 01,3000           13005                           TCF      ENDPRCHG   -1                         
051859,000274: 

Page 1184

051861,000276: 01,3001           40166                           CS       PUSHLOC                               
051862,000277: 01,3002           54166                           TS       PUSHLOC                               
051863,000278: 01,3003           34712                           CAF      ONE                                   
051864,000279: 01,3004           56121                           XCH      OVFIND                                
051865,000280: 01,3005           54067                           TS       NEWJOB                                
051866,000281: 
051867,000282: 01,3006           00003        ENDPRCHG           RELINT                                         
051868,000283: 01,3007           52165                           DXCH     LOC                                   #  BASIC JOBS HAVE POSITIVE ADDRESSES, SO
051869,000284: 01,3010           00006                           EXTEND                                         #  DISPATCH WITH A DTCB.
051870,000285: 01,3011           63013                           BZMF     +2                                    #  IF INTERPRETIVE, SET UP EBANK, ETC.
051871,000286: 01,3012           52006                           DTCB                                           

Page 1185

051873,000288: 01,3013           40000                           COM                                            #  EPILOGUE TO JOB CHANGE FOR INTERPRETIVE
051874,000289: 01,3014           64712                           AD       ONE                                   
051875,000290: 01,3015           54164                           TS       LOC                                   #  RESUME.
051876,000291: 01,3016           16017                           TCF      INTRSM                                
051877,000292: 
051878,000293:                                                                                                  #  COMPLETE JOBSLEEP PREPARATIONS.
051879,000294: 
051880,000295: 01,3017           00004        JOBSLP1            INHINT                                         
051881,000296: 01,3020           40167                           CS       PRIORITY                              #  NNZ PRIORITY SHOWS JOB ASLEEP.
051882,000297: 01,3021           54167                           TS       PRIORITY                              
051883,000298: 01,3022           36043                           CAF      LOW7                                  
051884,000299: 01,3023           70006                           MASK     BBANK                                 
051885,000300: 01,3024           00006                           EXTEND                                         
051886,000301: 01,3025           04007                           ROR      SUPERBNK                              #  SAVE OLD SUPERBANK VALUE.
051887,000302: 01,3026           54165                           TS       BANKSET                               
051888,000303: 01,3027           44714                           CS       ZERO                                  
051889,000304: 01,3030           54131        JOBSLP2            TS       BUF        +1                         #  HOLDS - HIGHEST PRIORITY.
051890,000305: 01,3031           13141                           TCF      EJSCAN                                #  SCAN FOR HIGHEST PRIORITY ALA ENDOFJOB.
051891,000306: 
051892,000307: 01,3032           00004        NUCHANG2           INHINT                                         #  QUICK... DONT LET NEWJOB CHANGE TO +0.
051893,000308: 01,3033           10067                           CCS      NEWJOB                                
051894,000309: 01,3034           13037                           TCF      +3                                    #  NEWJOB STILL PNZ
051895,000310: 01,3035           00003                           RELINT                                         #  NEW JOB HAS CHANGED TO +0.  WAKE UP JOB
051896,000311: 01,3036           13233                           TCF      ADVAN      +2                         #  VIA NUDIRECT.  (VERY RARE CASE.)
051897,000312: 
051898,000313: 01,3037           34711                           CAF      TWO                                   
051899,000314: 01,3040           00006                           EXTEND                                         
051900,000315: 01,3041           05011                           WOR      DSALMOUT                              #  TURN ON ACTIVITY LIGHT
051901,000316: 01,3042           52165                           DXCH     LOC                                   #  AND SAVE ADDRESS INFO FOR BENEFIT OF
051902,000317: 01,3043           12733                           TCF      CHANJOB    +4                         #        POSSIBLE SLEEPING JOB.
051903,000318: 

Page 1186

051905,000320:                                                                                                  #  TO WAKE UP A JOB, EACH CORE SET IS FOUND TO LOCATE ALL JOBS WHICH ARE ASLEEP.  IF THE FCADR IN THE
051906,000321:                                                                                                  #  LOC REGISTER OF ANY SUCH JOB MATCHES THAT SUPPLIED BY THE CALLER, THAT JOB IS AWAKENED.  IF NO JOB IS FOUND,
051907,000322:                                                                                                  #  LOCCTR IS SET TO -1 AND NO FURTHER ACTION TAKES PLACE.
051908,000323: 
051909,000324: 01,3044           54061        JOBWAKE2           TS       EXECTEM1                              
051910,000325: 01,3045           34714                           CAF      ZERO                                  #  BEGIN CORE SET SCAN.
051911,000326: 01,3046           54064                           TS       LOCCTR                                
051912,000327: 01,3047           32657                           CAF      NO.CORES                              
051913,000328: 01,3050           54062        JOBWAKE4           TS       EXECTEM2                              
051914,000329: 01,3051           50064                           INDEX    LOCCTR                                
051915,000330: 01,3052           10167                           CCS      PRIORITY                              
051916,000331: 01,3053           13056                           TCF      JOBWAKE3                              #  ACTIVE JOB - CHECK NEXT CORE SET.
051917,000332: 01,3054           00014        COREINC            DEC      12         B-14                       #  12 REGISTERS PER CORE SET.
051918,000333: 01,3055           13065                           TCF      WAKETEST                              #  SLEEPING JOB - SEE IF CADR MATCHES.
051919,000334: 
051920,000335: 01,3056           33054        JOBWAKE3           CAF      COREINC                               
051921,000336: 01,3057           26064                           ADS      LOCCTR                                
051922,000337: 01,3060           10062                           CCS      EXECTEM2                              
051923,000338: 01,3061           13050                           TCF      JOBWAKE4                              
051924,000339: 01,3062           44712                           CS       ONE                                   #  EXIT IF SLEEPING JOB NOT FOUND.
051925,000340: 01,3063           54064                           TS       LOCCTR                                
051926,000341: 01,3064           15115                           TCF      ENDFIND                               
051927,000342: 
051928,000343: 01,3065           40065        WAKETEST           CS       NEWLOC                                
051929,000344: 01,3066           50064                           INDEX    LOCCTR                                
051930,000345: 01,3067           60164                           AD       LOC                                   
051931,000346: 01,3070           00006                           EXTEND                                         
051932,000347: 01,3071           13073                           BZF      +2                                    #  IF MATCH.
051933,000348: 01,3072           13056                           TCF      JOBWAKE3                              #  EXAMINE NEXT CORE SET IF NO MATCH.
051934,000349: 
051935,000350: 01,3073           50064                           INDEX    LOCCTR                                #  RE-COMPLEMENT PRIORITY TO SHOW JOB AWAKE
051936,000351: 01,3074           40167                           CS       PRIORITY                              
051937,000352: 01,3075           54063                           TS       NEWPRIO                               
051938,000353: 01,3076           50064                           INDEX    LOCCTR                                
051939,000354: 01,3077           54167                           TS       PRIORITY                              
051940,000355: 
051941,000356: 01,3100           44364                           CS       FBANKMSK                              #  MAKE UP THE 2CADR OF THE WAKE ADDRESS
051942,000357: 01,3101           70065                           MASK     NEWLOC                                #  USING THE CADR IN NEWLOC AND THE EBANK
051943,000358: 01,3102           64700                           AD       2K                                    #  HALF OF BBANK SAVED IN BANKSET.
051944,000359: 01,3103           56065                           XCH      NEWLOC                                
051945,000360: 01,3104           74364                           MASK     FBANKMSK                              
051946,000361: 01,3105           50064                           INDEX    LOCCTR                                
051947,000362: 01,3106           60165                           AD       BANKSET                               
051948,000363: 01,3107           54066                           TS       NEWLOC     +1                         
051949,000364: 
051950,000365: 01,3110           10064                           CCS      LOCCTR                                #  SPECIAL TREATMENT IF THIS JOB WAS
051951,000366: 01,3111           12704                           TCF      SETLOC                                #  ALREADY IN THE RUN (0) POSITION.
051952,000367: 01,3112           12674                           TCF      SPECTEST                              
051953,000368: 

Page 1187

051955,000370:                                                                                                  #  PRIORITY CHANGE.  CHANGE THE CONTENTS OF PRIORITY AND SCAN FOR THE JOB OF HIGHEST PRIORITY.
051956,000371: 
051957,000372: 01,3113           54164        PRIOCH2            TS       LOC                                   
051958,000373: 01,3114           34714                           CAF      ZERO                                  #  SET FLAG TO TELL ENDJOB SCANNER IF THIS
051959,000374: 01,3115           54130                           TS       BUF                                   #  JOB IS STILL HIGHEST PRIORITY.
051960,000375: 01,3116           34741                           CAF      LOW9                                  
051961,000376: 01,3117           70167                           MASK     PRIORITY                              
051962,000377: 01,3120           60063                           AD       NEWPRIO                               
051963,000378: 01,3121           54167                           TS       PRIORITY                              
051964,000379: 01,3122           40000                           COM                                            
051965,000380: 01,3123           13030                           TCF      JOBSLP2                               #  AND TO EJSCAN.
051966,000381: 

Page 1188

051968,000383:                                                                                                  #  RELEASE THIS CORE SET AND VAC AREA AND SCAN FOR THE JOB OF HIGHEST ACTIVE PRIORITY.
051969,000384: 
051970,000385: 01,3124           00004        ENDJOB1            INHINT                                         
051971,000386: 01,3125           44714                           CS       ZERO                                  
051972,000387: 01,3126           54131                           TS       BUF        +1                         
051973,000388: 01,3127           56167                           XCH      PRIORITY                              
051974,000389: 01,3130           74741                           MASK     LOW9                                  
051975,000390: 01,3131           54001                           TS       L                                     
051976,000391: 
051977,000392: 01,3132           45121                           CS       FAKEPRET                              
051978,000393: 01,3133           60001                           AD       L                                     
051979,000394: 
051980,000395: 01,3134           00006                           EXTEND                                         
051981,000396: 01,3135           63141                           BZMF     EJSCAN                                #  NOVAC ENDOFJOB
051982,000397: 
051983,000398: 01,3136           10001                           CCS      L                                     
051984,000399: 01,3137           50000                           INDEX    A                                     
051985,000400: 01,3140           54000                           TS       0                                     
051986,000401: 
051987,000402: 01,3141           10203        EJSCAN             CCS      PRIORITY   +12D                       
051988,000403: 01,3142           03206                           TC       EJ1                                   
051989,000404: 01,3143           05640                           TC       CCSHOLE                               
051990,000405: 01,3144           13145                           TCF      +1                                    
051991,000406: 
051992,000407: 01,3145           10217                           CCS      PRIORITY   +24D                       #  EXAMINE EACH PRIORITY REGISTER TO FIND
051993,000408: 01,3146           03206                           TC       EJ1                                   #  THE JOB OF HIGHEST ACTIVE PRIORITY.
051994,000409: 01,3147           05640                           TC       CCSHOLE                               
051995,000410: 01,3150           13151                           TCF      +1                                    
051996,000411: 
051997,000412: 01,3151           10233                           CCS      PRIORITY   +36D                       
051998,000413: 01,3152           03206                           TC       EJ1                                   
051999,000414: 01,3153           67610        -CCSPR             -CCS     PRIORITY                              
052000,000415: 01,3154           13155                           TCF      +1                                    
052001,000416: 
052002,000417: 01,3155           10247                           CCS      PRIORITY   +48D                       
052003,000418: 01,3156           03206                           TC       EJ1                                   
052004,000419: 01,3157           05640                           TC       CCSHOLE                               
052005,000420: 01,3160           13161                           TCF      +1                                    
052006,000421: 
052007,000422: 01,3161           10263                           CCS      PRIORITY   +60D                       
052008,000423: 01,3162           03206                           TC       EJ1                                   
052009,000424: 01,3163           05640                           TC       CCSHOLE                               
052010,000425: 01,3164           13165                           TCF      +1                                    
052011,000426: 
052012,000427: 01,3165           10277                           CCS      PRIORITY   +72D                       
052013,000428: 01,3166           03206                           TC       EJ1                                   
052014,000429: 01,3167           05640                           TC       CCSHOLE                               
052015,000430: 01,3170           13171                           TCF      +1                                    
052016,000431: 

Page 1189

052018,000433:                                                                                                  #  EVALUATE THE RESULTS OF THE SCAN.
052019,000434: 
052020,000435: 01,3171           10131                           CCS      BUF        +1                         #  SEE IF THERE ARE ANY ACTIVE JOBS WAITING
052021,000436: 01,3172           05640                           TC       CCSHOLE                               
052022,000437: 01,3173           05640                           TC       CCSHOLE                               
052023,000438: 
052024,000439: 01,3174           13176                           TCF      +2                                    
052025,000440: 01,3175           13223                           TCF      DUMMYJOB                              
052026,000441: 01,3176           10130                           CCS      BUF                                   #  BUF IS ZERO IF THIS IS A PRIOCHNG AND
052027,000442: 01,3177           13201                           TCF      +2                                    #  CHANGED PRIORITY IS STILL HIGHEST.
052028,000443: 01,3200           13005                           TCF      ENDPRCHG   -1                         
052029,000444: 
052030,000445: 01,3201           50000                           INDEX    A                                     #  OTHERWISE, SET NEWJOB TO THE RELATIVE
052031,000446: 01,3202           27777                           CAF      0          -1                         #  ADDRESS OF THE NEW JOB'S CORE SET.
052032,000447: 01,3203           63153                           AD       -CCSPR                                
052033,000448: 01,3204           54067                           TS       NEWJOB                                
052034,000449: 01,3205           12725                           TCF      CHANJOB    -2                         
052035,000450: 
052036,000451: 01,3206           54132        EJ1                TS       BUF        +2                         
052037,000452: 01,3207           60131                           AD       BUF        +1                         #  - OLD HIGH PRIORITY.
052038,000453: 01,3210           10000                           CCS      A                                     
052039,000454: 01,3211           40132                           CS       BUF        +2                         
052040,000455: 01,3212           13216                           TCF      EJ2                                   #  NEW HIGH PRIORITY.
052041,000456: 01,3213           13214                           NOOP                                           
052042,000457: 01,3214           50002                           INDEX    Q                                     
052043,000458: 01,3215           00002                           TC       2                                     #  PROCEED WITH SEARCH.
052044,000459: 
052045,000460: 01,3216           54131        EJ2                TS       BUF        +1                         
052046,000461: 01,3217           00006                           EXTEND                                         
052047,000462: 01,3220           22130                           QXCH     BUF                                   #  FOR LOCATING CCS PRIORITY + X INSTR.
052048,000463: 01,3221           50130                           INDEX    BUF                                   
052049,000464: 01,3222           00002                           TC       2                                     
052050,000465: 

Page 1190

052052,000467:                                                                                                  #  IDLING AND COMPUTER ACTIVITY (GREEN) LIGHT MAINTENANCE. THE IDLING ROUTINE IS NOT A JOB IN ITSELF,
052053,000468:                                                                                                  #  BUT RATHER A SUBROUTINE OF THE EXECUTIVE.
052054,000469: 
052055,000470: 01,3223     1361                                  EBANK=   SELFRET                               #  SELF-CHECK STORAGE IN EBANK.
052056,000471: 
052057,000472: 01,3223           44714        DUMMYJOB           CS       ZERO                                  #  SET NEWJOB TO -0 FOR IDLING.
052058,000473: 01,3224           54067                           TS       NEWJOB                                
052059,000474: 01,3225           00003                           RELINT                                         
052060,000475: 01,3226           44711                           CS       TWO                                   #  TURN OFF THE ACTIVITY LIGHT.
052061,000476: 01,3227           00006                           EXTEND                                         
052062,000477: 01,3230           03011                           WAND     DSALMOUT                              
052063,000478: 01,3231           10067        ADVAN              CCS      NEWJOB                                #  IS A NEWJOB ACTIVE?
052064,000479: 01,3232           13032                           TCF      NUCHANG2                              #  YES... ONE REQUIRING A CHANGE JOB.
052065,000480: 01,3233           34711                           CAF      TWO                                   #  NEW JOB ALREADY IN POSITION FOR
052066,000481: 01,3234           13242                           TCF      NUDIRECT                              #  EXECUTION.
052067,000482: 
052068,000483: 01,3235           31361                           CA       SELFRET                               
052069,000484: 01,3236           54001                           TS       L                                     #  PUT RETURN ADDRESS IN L.
052070,000485: 01,3237           33241                           CAF      SELFBANK                              
052071,000486: 01,3240           15123                           TCF      SUPDXCHZ   +1                         #  AND DISPATCH JOB.
052072,000487: 
052073,000488: 01,3241     1361                                  EBANK=   SELFRET                               
052074,000489: 01,3241           66102        SELFBANK           BBCON    SELFCHK                               
052075,000490: 
052076,000491: 01,3242           00006        NUDIRECT           EXTEND                                         #  TURN THE GREEN LIGHT BACK ON.
052077,000492: 01,3243           05011                           WOR      DSALMOUT                              
052078,000493: 01,3244           52165                           DXCH     LOC                                   #  JOBS STARTED IN THIS FASHION MUST BE
052079,000494: 01,3245           15122                           TCF      SUPDXCHZ                              
052080,000495: 
052081,000496:    5122                                           BLOCK    2                                     #  IN FIXED-FIXED SO OTHERS MAY USE.
052082,000497: 
052083,000498:    5122                                           COUNT    02/EXEC                               
052084,000499: 
052085,000500:                                                                                                  #  SUPDXCHZ - ROUTINE TO TRANSFER TO SUPERBANK.
052086,000501:                                                                                                  #  CALLING SEQUENCE
052087,000502:                                                                                                  #                TCF     SUPDXCHZ        WITH 2CADR OF DESIRED LOCATION IN A + L.
052088,000503: 
052089,000504:    5122           56001        SUPDXCHZ           XCH      L                                     #  BASIC.
052090,000505:    5123           00006                 +1        EXTEND                                         
052091,000506:    5124           01007                           WRITE    SUPERBNK                              
052092,000507:    5125           54006                           TS       BBANK                                 
052093,000508:    5126           00001                           TC       L                                     
052094,000509: 
052095,000510:    5127           77677        NEG100             OCT      77677                                 

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