Source Code

This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the third release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 96 and 97. A bug (which had been around since at least Apollo 10, Luminary 69) was discovered in Rev 0 shortly before the Apollo 11 flight, resulting in a last minute revision into Rev 1, which is what actually flew rather than the Rev 0 presented here. A hardcopy of Rev 0 is known to exist — it belonged to AGC developer Allan Klumpp for many years — but unfortunately the Virtual AGC Project has not had access to that hardcopy. Thus the code you see here had been reconstructed (we believe accurately) rather than transcribed. The first step of the reconstruction of the Rev 0 source code was the transcription of the Rev 1 source code from a hardcopy in the MIT Museum collection. The process of reverting the active portion of the source code (i.e., other than program comments) from Rev 1 to Rev 0 was very minor, consisting only of moving the position of the STARTSB1 label in FRESH START AND RESTART. Allan had previously given us the checksums of the memory banks of Rev 0, and we have verified the program presented here has checksums identical to all banks of Allan's listing of Rev 0. The notations on Allan's Rev 0 program listing read, in part:

	GAP:  ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-051

A single program comment is known to differ between Rev 0 and Rev 1, but these are harder to reconstruct and verify than changes to the active portion of the code. Thus it is possible that there are additional differences between the program comments in Rev 0 and Rev 1 that are unknown to us, and therefore are not reflected in the code presented here.

048109,000002:                                                                                                  ## Copyright:   Public domain.
048110,000003:                                                                                                  ## Filename:    EXECUTIVE.agc
048111,000004:                                                                                                  ## Purpose:     Part of the reconstructed source code for LMY99 Rev 0,
048112,000005:                                                                                                  ##              otherwise known as Luminary Rev 99, the third release
048113,000006:                                                                                                  ##              of the Apollo Guidance Computer (AGC) software for Apollo 11.
048114,000007:                                                                                                  ##              It differs from LMY99 Rev 1 (the flown version) only in the
048115,000008:                                                                                                  ##              placement of a single label. The corrections shown here have
048116,000009:                                                                                                  ##              been verified to have the same bank checksums as AGC developer
048117,000010:                                                                                                  ##              Allan Klumpp's copy of Luminary Rev 99, and so are believed
048118,000011:                                                                                                  ##              to be accurate. This file is intended to be a faithful 
048119,000012:                                                                                                  ##              recreation, except that the code format has been changed to 
048120,000013:                                                                                                  ##              conform to the requirements of the yaYUL assembler rather than 
048121,000014:                                                                                                  ##              the original YUL assembler.
048122,000015:                                                                                                  ##
048123,000016:                                                                                                  ## Assembler:   yaYUL
048124,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
048125,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo.
048126,000019:                                                                                                  ## Pages:       1103-1114
048127,000020:                                                                                                  ## Mod history: 2009-05-25 RSB  Adapted from the corresponding 
048128,000021:                                                                                                  ##                              Luminary131 file, using page 
048129,000022:                                                                                                  ##                              images from Luminary 1A.
048130,000023:                                                                                                  ##              2011-01-06 JL   Fixed pseudo-label indentation.
048131,000024:                                                                                                  ##              2011-05-08 JL   Removed workaround.
048132,000025:                                                                                                  ##              2016-12-17 RSB  Proofed text comments with octopus/ProoferComments
048133,000026:                                                                                                  ##                              and corrected the errors found.
048134,000027:                                                                                                  ##              2017-03-15 RSB  Comment-text fixes identified in 5-way
048135,000028:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
048136,000029:                                                                                                  ##              2017-08-01 MAS  Created from LMY99 Rev 1.
048137,000030: 
048138,000031:                                                                                                  ## This source code has been transcribed or otherwise adapted from
048139,000032:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
048140,000033:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
048141,000034:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
048142,000035:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
048143,000036:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
048144,000037:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
048145,000038:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
048146,000039:                                                                                                  ## actually created.
048147,000040:                                                                                                  ##
048148,000041:                                                                                                  ## The code has been modified to match LMY99 Revision 0, otherwise
048149,000042:                                                                                                  ## known as Luminary Revision 99, the Apollo 11 software release preceeding
048150,000043:                                                                                                  ## the listing from which it was transcribed. It has been verified to
048151,000044:                                                                                                  ## contain the same bank checksums as AGC developer Allan Klumpp's listing
048152,000045:                                                                                                  ## of Luminary Revision 99 (for which we do not have scans).
048153,000046:                                                                                                  ##
048154,000047:                                                                                                  ## Notations on Allan Klumpp's listing read, in part:
048155,000048:                                                                                                  ##
048156,000049:                                                                                                  ##      ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
048157,000050: 

Page 1103

048159,000052:    5072                                           BLOCK    02                                    
048160,000053: 
048161,000054:                                                                                                  #  TO ENTER A JOB REQUEST REQUIRING NO VAC AREA:
048162,000055: 
048163,000056:    5072                                           COUNT*   $$/EXEC                               
048164,000057:    5072           00004        NOVAC              INHINT                                         
048165,000058:    5073           65164                           AD       FAKEPRET                              #  LOC(MPAC +6) - LOC(QPRET)
048166,000059:    5074           54063                           TS       NEWPRIO                               #  PRIORITY OF NEW JOB + NOVAC C(FIXLOC)
048167,000060: 
048168,000061:    5075           00006                           EXTEND                                         
048169,000062:    5076           50002                           INDEX    Q                                     #  Q WILL BE UNDISTURBED THROUGHOUT.
048170,000063:    5077           30001                           DCA      0                                     #  2CADR OF JOB ENTERED.
048171,000064:    5100           52066                           DXCH     NEWLOC                                
048172,000065:    5101           35163                           CAF      EXECBANK                              
048173,000066:    5102           56004                           XCH      FBANK                                 
048174,000067:    5103           54061                           TS       EXECTEM1                              
048175,000068:    5104           12625                           TCF      NOVAC2                                #  ENTER EXECUTIVE BANK.
048176,000069: 
048177,000070:                                                                                                  #  TO ENTER A JOB REQUEST REQUIRING A VAC AREA - E.G., ALL (PARTIALLY) INTERPRETIVE JOBS.
048178,000071: 
048179,000072:    5105           00004        FINDVAC            INHINT                                         
048180,000073:    5106           54063                           TS       NEWPRIO                               
048181,000074:    5107           00006                           EXTEND                                         
048182,000075:    5110           50002                           INDEX    Q                                     
048183,000076:    5111           30001                           DCA      0                                     
048184,000077:    5112           52066        SPVACIN            DXCH     NEWLOC                                
048185,000078:    5113           35163                           CAF      EXECBANK                              
048186,000079:    5114           56004                           XCH      FBANK                                 
048187,000080:    5115           12601                           TCF      FINDVAC2                              #  OFF TO EXECUTIVE SWITCHED-BANK.
048188,000081: 
048189,000082:                                                                                                  #  TO ENTER A FINDVAC WITH THE PRIORITY IN NEWPRIO TO THE 2CADR ARRIVING IN A AND L:
048190,000083:                                                                                                  #  USERS OF SPVAC MUST INHINT BEFORE STORING IN NEWPRIO.
048191,000084: 
048192,000085:    5116           56002        SPVAC              XCH      Q                                     
048193,000086:    5117           67746                           AD       NEG2                                  
048194,000087:    5120           56002                           XCH      Q                                     
048195,000088:    5121           15112                           TCF      SPVACIN                               
048196,000089: 
048197,000090:                                                                                                  #  TO SUSPEND A BASIC JOB SO A HIGHER PRIORITY JOB MAY BE SERVICED:
048198,000091: 
048199,000092:    5122           22002        CHANG1             LXCH     Q                                     
048200,000093:    5123           35163                           CAF      EXECBANK                              
048201,000094:    5124           56006                           XCH      BBANK                                 
048202,000095:    5125           12706                           TCF      CHANJOB                               
048203,000096: 
048204,000097:                                                                                                  #  TO SUSPEND AN INTERPRETIVE JOB:
048205,000098: 
048206,000099:    5126           40164        CHANG2             CS       LOC                                   #  NEGATIVE LOC SHOWS JOB = INTERPRETIVE.
048207,000100:                                                                                                  #  ITRACE (4) REFERS TO "CHANG2".
048208,000101:    5127           54001                           TS       L                                     

Page 1104

048210,000103:    5130           35163                 +2        CAF      EXECBANK                              
048211,000104:    5131           54006                           TS       BBANK                                 
048212,000105:    5132           12705                           TCF      CHANJOB    -1                         
048213,000106: 

Page 1105

048215,000108:                                                                                                  #  TO VOLUNTARILY SUSPEND A JOB UNTIL THE COMPLETION OF SOME ANTICIPATED EVENT (I/O EVENT ETC.):
048216,000109: 
048217,000110:    5133           54164        JOBSLEEP           TS       LOC                                   
048218,000111:    5134           35163                           CAF      EXECBANK                              
048219,000112:    5135           54004                           TS       FBANK                                 
048220,000113:    5136           12776                           TCF      JOBSLP1                               
048221,000114: 
048222,000115:                                                                                                  #  TO AWAKEN A JOB PUT TO SLEEP IN THE ABOVE FASHION:
048223,000116: 
048224,000117:    5137           00004        JOBWAKE            INHINT                                         
048225,000118:    5140           54065                           TS       NEWLOC                                
048226,000119:    5141           44752                           CS       TWO                                   #  EXIT IS VIA FINDVAC/NOVAC PROCEDURES.
048227,000120:    5142           26002                           ADS      Q                                     
048228,000121:    5143           35163                           CAF      EXECBANK                              
048229,000122:    5144           56004                           XCH      FBANK                                 
048230,000123:    5145           13023                           TCF      JOBWAKE2                              
048231,000124: 
048232,000125:                                                                                                  #  TO CHANGE THE PRIORITY OF A JOB CURRENTLY UNDER EXECUTION:
048233,000126: 
048234,000127:    5146           00004        PRIOCHNG           INHINT                                         #  NEW PRIORITY ARRIVES IN A.  RETURNS TO
048235,000128:    5147           54063                           TS       NEWPRIO                               #  CALLER AS SOON AS NEW JOB PRIORITY IS
048236,000129:    5150           35163                           CAF      EXECBANK                              #  HIGHEST.  PREPARE FOR POSSIBLE BASIC-
048237,000130:    5151           56006                           XCH      BBANK                                 #  STYLE CHANGE-JOB.
048238,000131:    5152           54165                           TS       BANKSET                               
048239,000132:    5153           30002                           CA       Q                                     
048240,000133:    5154           13072                           TCF      PRIOCH2                               
048241,000134: 
048242,000135:                                                                                                  #  TO REMOVE A JOB FROM EXECUTIVE CONSIDERATIONS:
048243,000136: 
048244,000137:    5155           35163        ENDOFJOB           CAF      EXECBANK                              
048245,000138:    5156           54004                           TS       FBANK                                 
048246,000139:    5157           13103                           TCF      ENDJOB1                               
048247,000140: 
048248,000141:    5160           30061        ENDFIND            CA       EXECTEM1                              #  RETURN TO CALLER AFTER JOB ENTRY
048249,000142:    5161           54004                           TS       FBANK                                 #  COMPLETE.
048250,000143:    5162           16741                           TCF      Q+2                                   
048251,000144:    5163           02601        EXECBANK           CADR     FINDVAC2                              
048252,000145: 
048253,000146:    5164           00110        FAKEPRET           ADRES    MPAC       -36D                       #  LOC(MPAC +6) - LOC(QPRET)
048254,000147: 

Page 1106

048256,000149:                                                                                                  #  LOCATE AN AVAILABLE VAC AREA.
048257,000150: 
048258,000151: 01,2601                                           BANK     01                                    
048259,000152: 01,2601                                           COUNT*   $$/EXEC                               
048260,000153: 01,2601           54061        FINDVAC2           TS       EXECTEM1                              #  (SAVE CALLER'S BANK FIRST.)
048261,000154: 01,2602           10400                           CCS      VAC1USE                               
048262,000155: 01,2603           12620                           TCF      VACFOUND                              
048263,000156: 01,2604           10454                           CCS      VAC2USE                               
048264,000157: 01,2605           12620                           TCF      VACFOUND                              
048265,000158: 01,2606           10530                           CCS      VAC3USE                               
048266,000159: 01,2607           12620                           TCF      VACFOUND                              
048267,000160: 01,2610           10604                           CCS      VAC4USE                               
048268,000161: 01,2611           12620                           TCF      VACFOUND                              
048269,000162: 01,2612           10660                           CCS      VAC5USE                               
048270,000163: 01,2613           12620                           TCF      VACFOUND                              
048271,000164: 01,2614           22061                           LXCH     EXECTEM1                              
048272,000165: 01,2615           30002                           CA       Q                                     
048273,000166: 01,2616           05716                           TC       BAILOUT1                              
048274,000167: 01,2617           01201                           OCT      1201                                  #  NO VAC AREAS.
048275,000168: 
048276,000169: 01,2620           64752        VACFOUND           AD       TWO                                   #  RESERVE THIS VAC AREA BY STORING A ZERO
048277,000170: 01,2621           22007                           ZL                                             #  IN ITS VAC USE REGISTER AND STORE THE
048278,000171: 01,2622           50000                           INDEX    A                                     #  ADDRESS OF THE FIRST WORD OF IT IN THE
048279,000172: 01,2623           21777                           LXCH     0          -1                         #  LOW NINE BITS OF THE PRIORITY WORD.
048280,000173: 01,2624           26063                           ADS      NEWPRIO                               
048281,000174: 
048282,000175: 01,2625           34755        NOVAC2             CAF      ZERO                                  #  NOVAC ENTERS HERE.  FIND A CORE SET.
048283,000176: 01,2626           54064                           TS       LOCCTR                                
048284,000177: 01,2627           32634                           CAF      NO.CORES                              #  SEVEN SETS OF ELEVEN REGISTERS EACH.
048285,000178: 01,2630           54062        NOVAC3             TS       EXECTEM2                              
048286,000179: 01,2631           50064                           INDEX    LOCCTR                                
048287,000180: 01,2632           10167                           CCS      PRIORITY                              #  EACH PRIORITY REGISTER CONTAINS -0 IF
048288,000181: 01,2633           12674                           TCF      NEXTCORE                              #  THE CORRESPONDING CORE SET IS AVAILABLE.
048289,000182: 01,2634           00007        NO.CORES           DEC      7          B-14                       
048290,000183: 01,2635           12674                           TCF      NEXTCORE                              #  AN ACTIVE JOB HAS A POSITIVE PRIORITY
048291,000184:                                                                                                  #  BUT A DORMANT JOB'S PRIORITY IS NEGATIVE
048292,000185: 

Page 1107

048294,000187: 01,2636           30063        CORFOUND           CA       NEWPRIO                               #  SET THE PRIORITY OF THIS JOB IN THE CORE
048295,000188: 01,2637           50064                           INDEX    LOCCTR                                #  SET'S PRIORITY REGISTER AND SET THE
048296,000189: 01,2640           54167                           TS       PRIORITY                              #  JOB'S PUSH-DOWN POINTER AT THE BEGINNING
048297,000190: 01,2641           75004                           MASK     LOW9                                  #  OF THE WORK AREA AND OVERFLOW INDICATOR
048298,000191: 01,2642           50064                           INDEX    LOCCTR                                
048299,000192: 01,2643           54166                           TS       PUSHLOC                               #  OFF TO PREPARE FOR INTERPRETIVE PROGRAMS
048300,000193: 
048301,000194: 01,2644           10064                           CCS      LOCCTR                                #  IF CORE SET ZERO IS BEING LOADED, SET UP
048302,000195: 01,2645           12661                           TCF      SETLOC                                #  OVFIND AND FIXLOC IMMEDIATELY.
048303,000196: 01,2646           54121                           TS       OVFIND                                
048304,000197: 01,2647           30166                           CA       PUSHLOC                               
048305,000198: 01,2650           54120                           TS       FIXLOC                                
048306,000199: 
048307,000200: 01,2651           10067        SPECTEST           CCS      NEWJOB                                #  SEE IF ANY ACTIVE JOBS WAITING (RARE).
048308,000201: 01,2652           12661                           TCF      SETLOC                                #  MUST BE AWAKENED BUT UNCHANGED JOB.
048309,000202: 01,2653           05705                           TC       CCSHOLE                               
048310,000203: 01,2654           05705                           TC       CCSHOLE                               
048311,000204: 01,2655           54067                           TS       NEWJOB                                #  +0 SHOWS ACTIVE JOB ALREADY SET.
048312,000205: 01,2656           52066                           DXCH     NEWLOC                                
048313,000206: 01,2657           52165                           DXCH     LOC                                   
048314,000207: 01,2660           15160                           TCF      ENDFIND                               
048315,000208: 
048316,000209: 01,2661           52066        SETLOC             DXCH     NEWLOC                                #  SET UP THE LOCATION REGISTERS FOR THIS
048317,000210: 01,2662           50064                           INDEX    LOCCTR                                
048318,000211: 01,2663           52165                           DXCH     LOC                                   
048319,000212: 01,2664           50067                           INDEX    NEWJOB                                #  THIS INDEX INSTRUCTION INSURES THAT THE
048320,000213: 01,2665           40167                           CS       PRIORITY                              #  HIGHEST ACTIVE PRIORITY WILL BE COMPARED
048321,000214: 01,2666           60063                           AD       NEWPRIO                               #  WITH THE NEW PRIORITY TO SEE IF NEWJOB
048322,000215: 01,2667           00006                           EXTEND                                         #  SHOULD BE SET TO SIGNAL A SWITCH.
048323,000216: 01,2670           65160                           BZMF     ENDFIND                               
048324,000217: 01,2671           30064                           CA       LOCCTR                                #  LOCCTR IS LEFT SET AT THIS CORE SET IF
048325,000218: 01,2672           54067                           TS       NEWJOB                                #  THE CALLER WANTS TO LOAD ANY MPAC
048326,000219: 01,2673           15160                           TCF      ENDFIND                               #  REGISTERS, ETC.
048327,000220: 
048328,000221: 01,2674           33033        NEXTCORE           CAF      COREINC                               
048329,000222: 01,2675           26064                           ADS      LOCCTR                                
048330,000223: 01,2676           10062                           CCS      EXECTEM2                              
048331,000224: 01,2677           12630                           TCF      NOVAC3                                
048332,000225: 01,2700           22061                           LXCH     EXECTEM1                              
048333,000226: 01,2701           30002                           CA       Q                                     
048334,000227: 01,2702           05716                           TC       BAILOUT1                              #  NO CORE SETS AVAILABLE.
048335,000228: 01,2703           01202                           OCT      1202                                  

Page 1108

048337,000230:                                                                                                  #  THE FOLLOWING ROUTINE SWAPS CORE SET 0 WITH THAT WHOSE RELATIVE ADDRESS IS IN NEWJOB.
048338,000231: 
048339,000232: 01,2704           22164                 -2        LXCH     LOC                                   
048340,000233: 01,2705           30165                 -1        CAE      BANKSET                               #  BANKSET, NOT BBANK, HAS RIGHT CONTENTS.
048341,000234: 01,2706           00004        CHANJOB            INHINT                                         
048342,000235: 01,2707           00006                           EXTEND                                         
048343,000236: 01,2710           04007                           ROR      SUPERBNK                              #  PICK UP CURRENT SBANK FOR BBCON
048344,000237: 01,2711           56001                           XCH      L                                     #  LOC IN A AND BBCON IN L.
048345,000238: 01,2712           50067                 +4        INDEX    NEWJOB                                #  SWAP LOC AND BANKSET.
048346,000239: 01,2713           52165                           DXCH     LOC                                   
048347,000240: 01,2714           52165                           DXCH     LOC                                   
048348,000241: 
048349,000242: 01,2715           30165                           CAE      BANKSET                               
048350,000243: 01,2716           00006                           EXTEND                                         
048351,000244: 01,2717           01007                           WRITE    SUPERBNK                              #  SET SBANK FOR NEW JOB.
048352,000245: 01,2720           52155                           DXCH     MPAC                                  #  SWAP MULTI-PURPOSE ACCUMULATOR AREAS.
048353,000246: 01,2721           50067                           INDEX    NEWJOB                                
048354,000247: 01,2722           52155                           DXCH     MPAC                                  
048355,000248: 01,2723           52155                           DXCH     MPAC                                  
048356,000249: 01,2724           52157                           DXCH     MPAC       +2                         
048357,000250: 01,2725           50067                           INDEX    NEWJOB                                
048358,000251: 01,2726           52157                           DXCH     MPAC       +2                         
048359,000252: 01,2727           52157                           DXCH     MPAC       +2                         
048360,000253: 01,2730           52161                           DXCH     MPAC       +4                         
048361,000254: 01,2731           50067                           INDEX    NEWJOB                                
048362,000255: 01,2732           52161                           DXCH     MPAC       +4                         
048363,000256: 01,2733           52161                           DXCH     MPAC       +4                         
048364,000257: 01,2734           52163                           DXCH     MPAC       +6                         
048365,000258: 01,2735           50067                           INDEX    NEWJOB                                
048366,000259: 01,2736           52163                           DXCH     MPAC       +6                         
048367,000260: 01,2737           52163                           DXCH     MPAC       +6                         
048368,000261: 
048369,000262: 01,2740           34755                           CAF      ZERO                                  
048370,000263: 01,2741           56121                           XCH      OVFIND                                #  MAKE PUSHLOC NEGATIVE IF OVFIND NZ.
048371,000264: 01,2742           00006                           EXTEND                                         
048372,000265: 01,2743           12746                           BZF      +3                                    
048373,000266: 01,2744           40166                           CS       PUSHLOC                               
048374,000267: 01,2745           54166                           TS       PUSHLOC                               
048375,000268: 
048376,000269: 01,2746           52167                           DXCH     PUSHLOC                               
048377,000270: 01,2747           50067                           INDEX    NEWJOB                                
048378,000271: 01,2750           52167                           DXCH     PUSHLOC                               
048379,000272: 01,2751           52167                           DXCH     PUSHLOC                               #  SWAPS PUSHLOC AND PRIORITY.
048380,000273: 01,2752           35004                           CAF      LOW9                                  #  SET FIXLOC TO BASE OF VAC AREA.
048381,000274: 01,2753           70167                           MASK     PRIORITY                              
048382,000275: 01,2754           54120                           TS       FIXLOC                                
048383,000276: 
048384,000277: 01,2755           10166                           CCS      PUSHLOC                               #  SET OVERFLOW INDICATOR ACCORDING TO
048385,000278: 01,2756           34755                           CAF      ZERO                                  
048386,000279: 01,2757           12764                           TCF      ENDPRCHG   -1                         
048387,000280: 

Page 1109

048389,000282: 01,2760           40166                           CS       PUSHLOC                               
048390,000283: 01,2761           54166                           TS       PUSHLOC                               
048391,000284: 01,2762           34753                           CAF      ONE                                   
048392,000285: 01,2763           56121                           XCH      OVFIND                                
048393,000286: 01,2764           54067                           TS       NEWJOB                                
048394,000287: 
048395,000288: 01,2765           00003        ENDPRCHG           RELINT                                         
048396,000289: 01,2766           52165                           DXCH     LOC                                   #  BASIC JOBS HAVE POSITIVE ADDRESSES, SO
048397,000290: 01,2767           00006                           EXTEND                                         #  DISPATCH WITH A DTCB.
048398,000291: 01,2770           62772                           BZMF     +2                                    #  IF INTERPRETIVE, SET UP EBANK, ETC.
048399,000292: 01,2771           52006                           DTCB                                           

Page 1110

048401,000294: 01,2772           40000                           COM                                            #  EPILOGUE TO JOB CHANGE FOR INTERPRETIVE
048402,000295: 01,2773           64753                           AD       ONE                                   
048403,000296: 01,2774           54164                           TS       LOC                                   #  RESUME.
048404,000297: 01,2775           16050                           TCF      INTRSM                                
048405,000298: 
048406,000299:                                                                                                  #  COMPLETE JOBSLEEP PREPARATIONS.
048407,000300: 
048408,000301: 01,2776           00004        JOBSLP1            INHINT                                         
048409,000302: 01,2777           40167                           CS       PRIORITY                              #  NNZ PRIORITY SHOWS JOB ASLEEP.
048410,000303: 01,3000           54167                           TS       PRIORITY                              
048411,000304: 01,3001           36074                           CAF      LOW7                                  
048412,000305: 01,3002           70006                           MASK     BBANK                                 
048413,000306: 01,3003           00006                           EXTEND                                         
048414,000307: 01,3004           04007                           ROR      SUPERBNK                              #  SAVE OLD SUPERBANK VALUE.
048415,000308: 01,3005           54165                           TS       BANKSET                               
048416,000309: 01,3006           44755                           CS       ZERO                                  
048417,000310: 01,3007           54131        JOBSLP2            TS       BUF        +1                         #  HOLDS - HIGHEST PRIORITY.
048418,000311: 01,3010           13120                           TCF      EJSCAN                                #  SCAN FOR HIGHEST PRIORITY ALA ENDOFJOB.
048419,000312: 
048420,000313: 01,3011           00004        NUCHANG2           INHINT                                         #  QUICK... DONT LET NEWJOB CHANGE TO +0.
048421,000314: 01,3012           10067                           CCS      NEWJOB                                
048422,000315: 01,3013           13016                           TCF      +3                                    #  NEWJOB STILL PNZ
048423,000316: 01,3014           00003                           RELINT                                         #  NEW JOB HAS CHANGED TO +0.  WAKE UP JOB
048424,000317: 01,3015           13216                           TCF      ADVAN      +2                         #  VIA NUDIRECT.  (VERY RARE CASE.)
048425,000318: 
048426,000319: 01,3016           34752                           CAF      TWO                                   
048427,000320: 01,3017           00006                           EXTEND                                         
048428,000321: 01,3020           05011                           WOR      DSALMOUT                              #  TURN ON ACTIVITY LIGHT
048429,000322: 01,3021           52165                           DXCH     LOC                                   #  AND SAVE ADDRESS INFO FOR BENEFIT OF
048430,000323: 01,3022           12712                           TCF      CHANJOB    +4                         #        POSSIBLE SLEEPING JOB.
048431,000324: 

Page 1111

048433,000326:                                                                                                  #  TO WAKE UP A JOB, EACH CORE SET IS FOUND TO LOCATE ALL JOBS WHICH ARE ASLEEP.  IF THE FCADR IN THE
048434,000327:                                                                                                  #  LOC REGISTER OF ANY SUCH JOB MATCHES THAT SUPPLIED BY THE CALLER, THAT JOB IS AWAKENED.  IF NO JOB IS FOUND,
048435,000328:                                                                                                  #  LOCCTR IS SET TO -1 AND NO FURTHER ACTION TAKES PLACE.
048436,000329: 
048437,000330: 01,3023           54061        JOBWAKE2           TS       EXECTEM1                              
048438,000331: 01,3024           34755                           CAF      ZERO                                  #  BEGIN CORE SET SCAN.
048439,000332: 01,3025           54064                           TS       LOCCTR                                
048440,000333: 01,3026           32634                           CAF      NO.CORES                              
048441,000334: 01,3027           54062        JOBWAKE4           TS       EXECTEM2                              
048442,000335: 01,3030           50064                           INDEX    LOCCTR                                
048443,000336: 01,3031           10167                           CCS      PRIORITY                              
048444,000337: 01,3032           13035                           TCF      JOBWAKE3                              #  ACTIVE JOB - CHECK NEXT CORE SET.
048445,000338: 01,3033           00014        COREINC            DEC      12         B-14                       #  12 REGISTERS PER CORE SET.
048446,000339: 01,3034           13044                           TCF      WAKETEST                              #  SLEEPING JOB - SEE IF CADR MATCHES.
048447,000340: 
048448,000341: 01,3035           33033        JOBWAKE3           CAF      COREINC                               
048449,000342: 01,3036           26064                           ADS      LOCCTR                                
048450,000343: 01,3037           10062                           CCS      EXECTEM2                              
048451,000344: 01,3040           13027                           TCF      JOBWAKE4                              
048452,000345: 01,3041           44753                           CS       ONE                                   #  EXIT IF SLEEPING JOB NOT FOUND.
048453,000346: 01,3042           54064                           TS       LOCCTR                                
048454,000347: 01,3043           15160                           TCF      ENDFIND                               
048455,000348: 
048456,000349: 01,3044           40065        WAKETEST           CS       NEWLOC                                
048457,000350: 01,3045           50064                           INDEX    LOCCTR                                
048458,000351: 01,3046           60164                           AD       LOC                                   
048459,000352: 01,3047           00006                           EXTEND                                         
048460,000353: 01,3050           13052                           BZF      +2                                    #  IF MATCH.
048461,000354: 01,3051           13035                           TCF      JOBWAKE3                              #  EXAMINE NEXT CORE SET IF NO MATCH.
048462,000355: 
048463,000356: 01,3052           50064                           INDEX    LOCCTR                                #  RE-COMPLEMENT PRIORITY TO SHOW JOB AWAKE
048464,000357: 01,3053           40167                           CS       PRIORITY                              
048465,000358: 01,3054           54063                           TS       NEWPRIO                               
048466,000359: 01,3055           50064                           INDEX    LOCCTR                                
048467,000360: 01,3056           54167                           TS       PRIORITY                              
048468,000361: 
048469,000362: 01,3057           44350                           CS       FBANKMSK                              #  MAKE UP THE 2CADR OF THE WAKE ADDRESS
048470,000363: 01,3060           70065                           MASK     NEWLOC                                #  USING THE CADR IN NEWLOC AND THE EBANK
048471,000364: 01,3061           64741                           AD       2K                                    #  HALF OF BBANK SAVED IN BANKSET.
048472,000365: 01,3062           56065                           XCH      NEWLOC                                
048473,000366: 01,3063           74350                           MASK     FBANKMSK                              
048474,000367: 01,3064           50064                           INDEX    LOCCTR                                
048475,000368: 01,3065           60165                           AD       BANKSET                               
048476,000369: 01,3066           54066                           TS       NEWLOC     +1                         
048477,000370: 
048478,000371: 01,3067           10064                           CCS      LOCCTR                                #  SPECIAL TREATMENT IF THIS JOB WAS
048479,000372: 01,3070           12661                           TCF      SETLOC                                #  ALREADY IN THE RUN (0) POSITION.
048480,000373: 01,3071           12651                           TCF      SPECTEST                              
048481,000374: 

Page 1112

048483,000376:                                                                                                  #  PRIORITY CHANGE.  CHANGE THE CONTENTS OF PRIORITY AND SCAN FOR THE JOB OF HIGHEST PRIORITY.
048484,000377: 
048485,000378: 01,3072           54164        PRIOCH2            TS       LOC                                   
048486,000379: 01,3073           34755                           CAF      ZERO                                  #  SET FLAG TO TELL ENDJOB SCANNER IF THIS
048487,000380: 01,3074           54130                           TS       BUF                                   #  JOB IS STILL HIGHEST PRIORITY.
048488,000381: 01,3075           35004                           CAF      LOW9                                  
048489,000382: 01,3076           70167                           MASK     PRIORITY                              
048490,000383: 01,3077           60063                           AD       NEWPRIO                               
048491,000384: 01,3100           54167                           TS       PRIORITY                              
048492,000385: 01,3101           40000                           COM                                            
048493,000386: 01,3102           13007                           TCF      JOBSLP2                               #  AND TO EJSCAN.
048494,000387: 

Page 1113

048496,000389:                                                                                                  #  RELEASE THIS CORE SET AND VAC AREA AND SCAN FOR THE JOB OF HIGHEST ACTIVE PRIORITY.
048497,000390: 
048498,000391: 01,3103           00004        ENDJOB1            INHINT                                         
048499,000392: 01,3104           44755                           CS       ZERO                                  
048500,000393: 01,3105           54131                           TS       BUF        +1                         
048501,000394: 01,3106           56167                           XCH      PRIORITY                              
048502,000395: 01,3107           75004                           MASK     LOW9                                  
048503,000396: 01,3110           54001                           TS       L                                     
048504,000397: 
048505,000398: 01,3111           45164                           CS       FAKEPRET                              
048506,000399: 01,3112           60001                           AD       L                                     
048507,000400: 
048508,000401: 01,3113           00006                           EXTEND                                         
048509,000402: 01,3114           63120                           BZMF     EJSCAN                                #  NOVAC ENDOFJOB
048510,000403: 
048511,000404: 01,3115           10001                           CCS      L                                     
048512,000405: 01,3116           50000                           INDEX    A                                     
048513,000406: 01,3117           54000                           TS       0                                     
048514,000407: 
048515,000408: 01,3120           10203        EJSCAN             CCS      PRIORITY   +12D                       
048516,000409: 01,3121           03171                           TC       EJ1                                   
048517,000410: 01,3122           05705                           TC       CCSHOLE                               
048518,000411: 01,3123           13124                           TCF      +1                                    
048519,000412: 
048520,000413: 01,3124           10217                           CCS      PRIORITY   +24D                       #  EXAMINE EACH PRIORITY REGISTER TO FIND
048521,000414: 01,3125           03171                           TC       EJ1                                   #  THE JOB OF HIGHEST ACTIVE PRIORITY.
048522,000415: 01,3126           05705                           TC       CCSHOLE                               
048523,000416: 01,3127           13130                           TCF      +1                                    
048524,000417: 
048525,000418: 01,3130           10233                           CCS      PRIORITY   +36D                       
048526,000419: 01,3131           03171                           TC       EJ1                                   
048527,000420: 01,3132           67610        -CCSPR             -CCS     PRIORITY                              
048528,000421: 01,3133           13134                           TCF      +1                                    
048529,000422: 
048530,000423: 01,3134           10247                           CCS      PRIORITY   +48D                       
048531,000424: 01,3135           03171                           TC       EJ1                                   
048532,000425: 01,3136           05705                           TC       CCSHOLE                               
048533,000426: 01,3137           13140                           TCF      +1                                    
048534,000427: 
048535,000428: 01,3140           10263                           CCS      PRIORITY   +60D                       
048536,000429: 01,3141           03171                           TC       EJ1                                   
048537,000430: 01,3142           05705                           TC       CCSHOLE                               
048538,000431: 01,3143           13144                           TCF      +1                                    
048539,000432: 
048540,000433: 01,3144           10277                           CCS      PRIORITY   +72D                       
048541,000434: 01,3145           03171                           TC       EJ1                                   
048542,000435: 01,3146           05705                           TC       CCSHOLE                               
048543,000436: 01,3147           13150                           TCF      +1                                    
048544,000437: 
048545,000438: 01,3150           10313                           CCS      PRIORITY   +84D                       

Page 1114

048547,000440: 01,3151           03171                           TC       EJ1                                   
048548,000441: 01,3152           05705                           TC       CCSHOLE                               
048549,000442: 01,3153           13154                           TCF      +1                                    
048550,000443: 

Page 1115

048552,000445:                                                                                                  #  EVALUATE THE RESULTS OF THE SCAN.
048553,000446: 
048554,000447: 01,3154           10131                           CCS      BUF        +1                         #  SEE IF THERE ARE ANY ACTIVE JOBS WAITING
048555,000448: 01,3155           05705                           TC       CCSHOLE                               
048556,000449: 01,3156           05705                           TC       CCSHOLE                               
048557,000450: 
048558,000451: 01,3157           13161                           TCF      +2                                    
048559,000452: 01,3160           13206                           TCF      DUMMYJOB                              
048560,000453: 01,3161           10130                           CCS      BUF                                   #  BUF IS ZERO IF THIS IS A PRIOCHNG AND
048561,000454: 01,3162           13164                           TCF      +2                                    #  CHANGED PRIORITY IS STILL HIGHEST.
048562,000455: 01,3163           12764                           TCF      ENDPRCHG   -1                         
048563,000456: 
048564,000457: 01,3164           50000                           INDEX    A                                     #  OTHERWISE, SET NEWJOB TO THE RELATIVE
048565,000458: 01,3165           27777                           CAF      0          -1                         #  ADDRESS OF THE NEW JOB'S CORE SET.
048566,000459: 01,3166           63132                           AD       -CCSPR                                
048567,000460: 01,3167           54067                           TS       NEWJOB                                
048568,000461: 01,3170           12704                           TCF      CHANJOB    -2                         
048569,000462: 
048570,000463: 01,3171           54132        EJ1                TS       BUF        +2                         
048571,000464: 01,3172           60131                           AD       BUF        +1                         #  - OLD HIGH PRIORITY.
048572,000465: 01,3173           10000                           CCS      A                                     
048573,000466: 01,3174           40132                           CS       BUF        +2                         
048574,000467: 01,3175           13201                           TCF      EJ2                                   #  NEW HIGH PRIORITY.
048575,000468: 01,3176           13177                           NOOP                                           
048576,000469: 01,3177           50002                           INDEX    Q                                     
048577,000470: 01,3200           00002                           TC       2                                     #  PROCEED WITH SEARCH.
048578,000471: 
048579,000472: 01,3201           54131        EJ2                TS       BUF        +1                         
048580,000473: 01,3202           00006                           EXTEND                                         
048581,000474: 01,3203           22130                           QXCH     BUF                                   #  FOR LOCATING CCS PRIORITY + X INSTR.
048582,000475: 01,3204           50130                           INDEX    BUF                                   
048583,000476: 01,3205           00002                           TC       2                                     
048584,000477: 

Page 1116

048586,000479:                                                                                                  #  IDLING AND COMPUTER ACTIVITY (GREEN) LIGHT MAINTENANCE. THE IDLING ROUTINE IS NOT A JOB IN ITSELF,
048587,000480:                                                                                                  #  BUT RATHER A SUBROUTINE OF THE EXECUTIVE.
048588,000481: 
048589,000482: 01,3206     1361                                  EBANK=   SELFRET                               #  SELF-CHECK STORAGE IN EBANK.
048590,000483: 
048591,000484: 01,3206           44755        DUMMYJOB           CS       ZERO                                  #  SET NEWJOB TO -0 FOR IDLING.
048592,000485: 01,3207           54067                           TS       NEWJOB                                
048593,000486: 01,3210           00003                           RELINT                                         
048594,000487: 01,3211           44752                           CS       TWO                                   #  TURN OFF THE ACTIVITY LIGHT.
048595,000488: 01,3212           00006                           EXTEND                                         
048596,000489: 01,3213           03011                           WAND     DSALMOUT                              
048597,000490: 01,3214           10067        ADVAN              CCS      NEWJOB                                #  IS A NEWJOB ACTIVE?
048598,000491: 01,3215           13011                           TCF      NUCHANG2                              #  YES... ONE REQUIRING A CHANGE JOB.
048599,000492: 01,3216           34752                           CAF      TWO                                   #  NEW JOB ALREADY IN POSITION FOR
048600,000493: 01,3217           13225                           TCF      NUDIRECT                              #  EXECUTION.
048601,000494: 
048602,000495: 01,3220           31361                           CA       SELFRET                               
048603,000496: 01,3221           54001                           TS       L                                     #  PUT RETURN ADDRESS IN L.
048604,000497: 01,3222           33224                           CAF      SELFBANK                              
048605,000498: 01,3223           15166                           TCF      SUPDXCHZ   +1                         #  AND DISPATCH JOB.
048606,000499: 
048607,000500: 01,3224     1361                                  EBANK=   SELFRET                               
048608,000501: 01,3224           66102        SELFBANK           BBCON    SELFCHK                               
048609,000502: 
048610,000503: 01,3225           00006        NUDIRECT           EXTEND                                         #  TURN THE GREEN LIGHT BACK ON.
048611,000504: 01,3226           05011                           WOR      DSALMOUT                              
048612,000505: 01,3227           52165                           DXCH     LOC                                   #  JOBS STARTED IN THIS FASHION MUST BE
048613,000506: 01,3230           15165                           TCF      SUPDXCHZ                              
048614,000507: 
048615,000508:    5165                                           BLOCK    2                                     #  IN FIXED-FIXED SO OTHERS MAY USE.
048616,000509: 
048617,000510:    5165                                           COUNT*   $$/EXEC                               
048618,000511: 
048619,000512:                                                                                                  #  SUPDXCHZ - ROUTINE TO TRANSFER TO SUPERBANK.
048620,000513:                                                                                                  #  CALLING SEQUENCE
048621,000514:                                                                                                  #                TCF     SUPDXCHZ        WITH 2CADR OF DESIRED LOCATION IN A + L.
048622,000515: 
048623,000516:    5165           56001        SUPDXCHZ           XCH      L                                     #  BASIC.
048624,000517:    5166           00006                 +1        EXTEND                                         
048625,000518:    5167           01007                           WRITE    SUPERBNK                              
048626,000519:    5170           54006                           TS       BBANK                                 
048627,000520:    5171           00001                           TC       L                                     
048628,000521: 
048629,000522:    5172           77677        NEG100             OCT      77677                                 
048630,000523: 

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