Source Code

This is a reconstruction of the AGC program Luminary 99 Rev 0. It was the second release of the Lunar Module flight software targeted for use in Apollo 11, after Luminary 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.

060300,000002:                                                                                                  ## Copyright:   Public domain.
060301,000003:                                                                                                  ## Filename:    ALARM_AND_ABORT.agc
060302,000004:                                                                                                  ## Purpose:     Part of the reconstructed source code for LMY99 Rev 0,
060303,000005:                                                                                                  ##              otherwise known as Luminary Rev 99, the second release
060304,000006:                                                                                                  ##              of the Apollo Guidance Computer (AGC) software for Apollo 11.
060305,000007:                                                                                                  ##              It differs from LMY99 Rev 1 (the flown version) only in the
060306,000008:                                                                                                  ##              placement of a single label. The corrections shown here have
060307,000009:                                                                                                  ##              been verified to have the same bank checksums as AGC developer
060308,000010:                                                                                                  ##              Allan Klumpp's copy of Luminary Rev 99, and so are believed
060309,000011:                                                                                                  ##              to be accurate. This file is intended to be a faithful 
060310,000012:                                                                                                  ##              recreation, except that the code format has been changed to 
060311,000013:                                                                                                  ##              conform to the requirements of the yaYUL assembler rather than 
060312,000014:                                                                                                  ##              the original YUL assembler.
060313,000015:                                                                                                  ##
060314,000016:                                                                                                  ## Assembler:   yaYUL
060315,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
060316,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo.
060317,000019:                                                                                                  ## Pages:       1381-1385
060318,000020:                                                                                                  ## Mod history: 2009-05-10 SN   (Sergio Navarro).  Started adapting
060319,000021:                                                                                                  ##                              from the Luminary131/ file of the same
060320,000022:                                                                                                  ##                              name, using Luminary099 page images.
060321,000023:                                                                                                  ##              2009-06-05 RSB  Fixed a type.
060322,000024:                                                                                                  ##              2011-01-06 JL   Fixed pseudo-label indentation.
060323,000025:                                                                                                  ##              2016-12-13 RSB  GOTOP00H -> GOTOPOOH
060324,000026:                                                                                                  ##              2016-12-18 RSB  Proofed text comments with octopus/ProoferComments
060325,000027:                                                                                                  ##                              and corrected the errors found.
060326,000028:                                                                                                  ##              2017-08-01 MAS  Created from LMY99 Rev 1.
060327,000029: 
060328,000030:                                                                                                  ## This source code has been transcribed or otherwise adapted from
060329,000031:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
060330,000032:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
060331,000033:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
060332,000034:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
060333,000035:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
060334,000036:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
060335,000037:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
060336,000038:                                                                                                  ## actually created.
060337,000039:                                                                                                  ##
060338,000040:                                                                                                  ## The code has been modified to match LMY99 Revision 0, otherwise
060339,000041:                                                                                                  ## known as Luminary Revision 99, the Apollo 11 software release preceeding
060340,000042:                                                                                                  ## the listing from which it was transcribed. It has been verified to
060341,000043:                                                                                                  ## contain the same bank checksums as AGC developer Allan Klumpp's listing
060342,000044:                                                                                                  ## of Luminary Revision 99 (for which we do not have scans).
060343,000045:                                                                                                  ##
060344,000046:                                                                                                  ## Notations on Allan Klumpp's listing read, in part:
060345,000047:                                                                                                  ##
060346,000048:                                                                                                  ##      ASSEMBLE REVISION 099 OF AGC PROGRAM LUMINARY BY NASA 2021112-51
060347,000049: 

Page 1381

060349,000051:                                                                                                  #  THE FOLLOWING SUBROUTINE MAY BE CALLED TO DISPLAY A NON-ABORTIVE ALARM CONDITION.  IT MAY BE CALLED
060350,000052:                                                                                                  #  EITHER IN INTERRUPT OR UNDER EXECUTIVE CONTROL.
060351,000053: 
060352,000054:                                                                                                  #  CALLING SEQUENCE IS AS FOLLOWS:
060353,000055:                                                                                                  #                TC      ALARM
060354,000056:                                                                                                  #                OCT     AAANN           ALARM NO. NN IN GENERAL AREA AAA.
060355,000057:                                                                                                  #                                        (RETURNS HERE)
060356,000058: 
060357,000059:    5567                                           BLOCK    02                                    
060358,000060:    4000                                           SETLOC   FFTAG7                                
060359,000061:    4000                                           BANK                                           
060360,000062: 
060361,000063:    5567     0375                                  EBANK=   FAILREG                               
060362,000064: 
060363,000065:    5567                                           COUNT*   $$/ALARM                              
060364,000066: 
060365,000067:                                                                                                  #  ALARM TURNS ON THE PROGRAM ALARM LIGHT, BUT DOES NOT DISPLAY.
060366,000068: 
060367,000069:    5567           00004        ALARM              INHINT                                         
060368,000070: 
060369,000071:    5570           30002                           CA       Q                                     
060370,000072:    5571           55363        ALARM2             TS       ALMCADR                               
060371,000073:    5572           50002                           INDEX    Q                                     
060372,000074:    5573           30000                           CA       0                                     
060373,000075:    5574           54001        BORTENT            TS       L                                     
060374,000076: 
060375,000077:    5575           30006        PRIOENT            CA       BBANK                                 
060376,000078:    5576           00006                 +1        EXTEND                                         
060377,000079:    5577           04007                           ROR      SUPERBNK                              #  ADD SUPER BITS.
060378,000080:    5600           55364                           TS       ALMCADR    +1                         
060379,000081: 
060380,000082:    5601           30002        LARMENT            CA       Q                                     #  STORE RETURN FOR ALARM
060381,000083:    5602           54061                           TS       ITEMP1                                
060382,000084: 
060383,000085:    5603           10375        CHKFAIL1           CCS      FAILREG                               #  IS ANYTHING IN FAILREG
060384,000086:    5604           15607                           TCF      CHKFAIL2                              #  YES TRY NEXT REG
060385,000087:    5605           22375                           LXCH     FAILREG                               
060386,000088:    5606           15621                           TCF      PROGLARM                              #  TURN ALARM LIGHT ON FOR FIRST ALARM
060387,000089: 
060388,000090:    5607           10376        CHKFAIL2           CCS      FAILREG    +1                         
060389,000091:    5610           15613                           TCF      FAIL3                                 
060390,000092:    5611           22376                           LXCH     FAILREG    +1                         
060391,000093:    5612           15624                           TCF      MULTEXIT                              
060392,000094: 
060393,000095:    5613           30377        FAIL3              CA       FAILREG    +2                         
060394,000096:    5614           74733                           MASK     POSMAX                                
060395,000097:    5615           10000                           CCS      A                                     
060396,000098:    5616           15630                           TCF      MULTFAIL                              
060397,000099:    5617           22377                           LXCH     FAILREG    +2                         
060398,000100:    5620           15624                           TCF      MULTEXIT                              
060399,000101: 

Page 1382

060401,000103: 
060402,000104:    5621           41036        PROGLARM           CS       DSPTAB     +11D                       
060403,000105:    5622           75642                           MASK     OCT40400                              
060404,000106:    5623           27036                           ADS      DSPTAB     +11D                       
060405,000107: 
060406,000108: 
060407,000109:    5624           56061        MULTEXIT           XCH      ITEMP1                                #  OBTAIN RETURN ADDRESS IN A
060408,000110:    5625           00003                           RELINT                                         
060409,000111:    5626           50000                           INDEX    A                                     
060410,000112:    5627           00001                           TC       1                                     
060411,000113: 
060412,000114:    5630           30001        MULTFAIL           CA       L                                     
060413,000115:    5631           64735                           AD       BIT15                                 
060414,000116:    5632           54377                           TS       FAILREG    +2                         
060415,000117: 
060416,000118:    5633           15624                           TCF      MULTEXIT                              
060417,000119: 
060418,000120:                                                                                                  #  PRIOLARM DISPLAYS V05N09 VIA PRIODSPR WITH 3 RETURNS TO THE USER FROM THE ASTRONAUT AT CALL LOC +1,+2,+3 AND
060419,000121:                                                                                                  #  AN IMMEDIATE RETURN TO THE USER AT CALL LOC +4.  EXAMPLE FOLLOWS,
060420,000122:                                                                                                  #                CAF     OCTXX           ALARM CODE
060421,000123:                                                                                                  #                TC      BANKCALL
060422,000124:                                                                                                  #                CADR    PRIOLARM
060423,000125:                                                                                                  #                ...     ...
060424,000126:                                                                                                  #                ...     ...
060425,000127:                                                                                                  #                ...     ...             ASTRONAUT RETURN
060426,000128:                                                                                                  #                TC      PHASCHNG        IMMEDIATE RETURN TO USER.  RESTART
060427,000129:                                                                                                  #                OCT     X.1             PHASE CHANGE FOR PRIO DISPLAY
060428,000130: 
060429,000131: 10,3562                                           BANK     10                                    
060430,000132: 10,2000                                           SETLOC   DISPLAYS                              
060431,000133: 10,2000                                           BANK                                           
060432,000134: 
060433,000135: 10,3562                                           COUNT*   $$/DSPLA                              
060434,000136: 10,3562           00004        PRIOLARM           INHINT                                         #  * * * KEEP IN DISPLAY ROUTINES BANK
060435,000137: 10,3563           54001                           TS       L                                     #  SAVE ALARM CODE
060436,000138: 
060437,000139: 10,3564           30133                           CA       BUF2                                  #  2 CADR OF PRIOLARM USER
060438,000140: 10,3565           55363                           TS       ALMCADR                               
060439,000141: 10,3566           30134                           CA       BUF2       +1                         
060440,000142: 10,3567           05576                           TC       PRIOENT    +1                         #  * LEAVE L ALONE
060441,000143: 10,3570           77467        -2SEC              DEC      -200       B-14                       #  *** DONT MOVE
060442,000144: 10,3571           35006                           CAF      V05N09                                
060443,000145: 10,3572           12504                           TCF      PRIODSPR                              
060444,000146: 
060445,000147:    5634                                           BLOCK    02                                    
060446,000148:    4000                                           SETLOC   FFTAG7                                
060447,000149:    4000                                           BANK                                           
060448,000150: 
060449,000151:    5634                                           COUNT*   $$/ALARM                              
060450,000152:    5634           00004        BAILOUT            INHINT                                         
060451,000153:    5635           30002                           CA       Q                                     

Page 1383

060453,000155:    5636           55363                           TS       ALMCADR                               
060454,000156: 
060455,000157:    5637           50002                           INDEX    Q                                     
060456,000158:    5640           30000                           CAF      0                                     
060457,000159:    5641           05574                           TC       BORTENT                               
060458,000160:    5642           40400        OCT40400           OCT      40400                                 
060459,000161: 
060460,000162:    5643           00004                           INHINT                                         
060461,000163:    5644           34752        WHIMPER            CA       TWO                                   
060462,000164:    5645           60005                           AD       Z                                     
060463,000165:    5646           54017                           TS       BRUPT                                 
060464,000166:    5647           50017                           RESUME                                         
060465,000167:    5650           04635                           TC       POSTJUMP                              #  RESUME SENDS CONTROL HERE
060466,000168:    5651           12765                           CADR     ENEMA                                 
060467,000169:    5652           00004        POODOO             INHINT                                         
060468,000170:    5653           30002                           CA       Q                                     
060469,000171:    5654           55363        ABORT2             TS       ALMCADR                               
060470,000172:    5655           50002                           INDEX    Q                                     
060471,000173:    5656           30000                           CAF      0                                     
060472,000174:    5657           05574                           TC       BORTENT                               
060473,000175:    5660           77770        OCT77770           OCT      77770                                 #  DON'T MOVE
060474,000176: 
060475,000177:    5661           34765                           CAF      OCT35                                 #  4.35SPOT FOR GOPOODOO
060476,000178:    5662           54001                           TS       L                                     
060477,000179:    5663           40000                           COM                                            
060478,000180:    5664           52761                           DXCH     -PHASE4                               
060479,000181:    5665           00004        GOPOODOO           INHINT                                         
060480,000182:    5666           04616                           TC       BANKCALL                              #  RESET STATEFLG, REINTFLG, AND NODOFLAG.
060481,000183:    5667           27755                           CADR     FLAGS                                 
060482,000184:    5670           30103                           CA       FLAGWRD7                              #  IS SERVICER CURRENTLY IN OPERATION?
060483,000185:    5671           74746                           MASK     V37FLBIT                              
060484,000186:    5672           10000                           CCS      A                                     
060485,000187:    5673           15701                           TCF      STRTIDLE                              
060486,000188:    5674           04616                           TC       BANKCALL                              #  TERMINATE GRPS 1, 3, 5, AND 6
060487,000189:    5675           12652                           CADR     V37KLEAN                              
060488,000190:    5676           04616                           TC       BANKCALL                              #  TERMINATE GRPS 2, 4, 1, 3, 5, AND 6
060489,000191:    5677           12643                           CADR     MR.KLEAN                              #        (I.E., GRP 4 LAST)
060490,000192:    5700           15644                           TCF      WHIMPER                               
060491,000193:    5701           35743        STRTIDLE           CAF      BBSERVDL                              
060492,000194:    5702           04727                           TC       SUPERSW                               
060493,000195:    5703           04616                           TC       BANKCALL                              #  PUT SERVICER INTO ITS "GROUND" STATE
060494,000196:    5704           57321                           CADR     SERVIDLE                              #  AND PROCEED TO GOTOPOOH.
060495,000197:    5705           00004        CCSHOLE            INHINT                                         
060496,000198:    5706           30002                           CA       Q                                     
060497,000199:    5707           05654                           TC       ABORT2                                
060498,000200:    5710           01103        OCT21103           OCT      1103                                  
060499,000201:    5711           00004        CURTAINS           INHINT                                         
060500,000202:    5712           30002                           CA       Q                                     
060501,000203:    5713           05571                           TC       ALARM2                                
060502,000204:    5714           00217        OCT217             OCT      00217                                 

Page 1384

060504,000206:    5715           01363                           TC       ALMCADR                               #  RETURN TO USER
060505,000207: 
060506,000208:    5716           00004        BAILOUT1           INHINT                                         
060507,000209:    5717           53364                           DXCH     ALMCADR                               
060508,000210:    5720           35742                           CAF      ADR40400                              
060509,000211:    5721           54061        BOTHABRT           TS       ITEMP1                                
060510,000212:    5722           50002                           INDEX    Q                                     
060511,000213:    5723           30000                           CAF      0                                     
060512,000214:    5724           54001                           TS       L                                     
060513,000215:    5725           15603                           TCF      CHKFAIL1                              
060514,000216:    5726           00004        POODOO1            INHINT                                         
060515,000217:    5727           53364                           DXCH     ALMCADR                               
060516,000218:    5730           35741                           CAF      ADR77770                              
060517,000219:    5731           15721                           TCF      BOTHABRT                              
060518,000220: 
060519,000221:    5732           00004        ALARM1             INHINT                                         
060520,000222:    5733           53364                           DXCH     ALMCADR                               
060521,000223:    5734           00004        ALMNCADR           INHINT                                         
060522,000224:    5735           50002                           INDEX    Q                                     
060523,000225:    5736           30000                           CA       0                                     
060524,000226:    5737           54001                           TS       L                                     
060525,000227:    5740           15601                           TCF      LARMENT                               
060526,000228: 
060527,000229:    5741           15660        ADR77770           TCF      OCT77770                              
060528,000230:    5742           15642        ADR40400           TCF      OCT40400                              
060529,000231:    5743     5155               DOALARM            EQUALS   ENDOFJOB                              
060530,000232:    5743  E7,1515                                  EBANK=   DVCNTR                                
060531,000233:    5743           56067        BBSERVDL           BBCON    SERVIDLE                              
060532,000234: 
060533,000235:                                                                                                  #  CALLING SEQUENCE FOR VARALARM
060534,000236:                                                                                                  #                CAF     (ALARM)
060535,000237:                                                                                                  #                TC      VARALARM
060536,000238: 
060537,000239:                                                                                                  #  VARALARM TURNS ON PROGRAM ALARM LIGHT BUT DOES NOT DISPLAY
060538,000240: 
060539,000241:    5744           00004        VARALARM           INHINT                                         
060540,000242: 
060541,000243:    5745           54001                           TS       L                                     #  SAVE USERS ALARM CODE
060542,000244: 
060543,000245:    5746           30002                           CA       Q                                     #  SAVE USERS Q
060544,000246:    5747           55363                           TS       ALMCADR                               
060545,000247: 
060546,000248:    5750           05575                           TC       PRIOENT                               
060547,000249:    5751           00014        OCT14              OCT      14                                    #  DONT MOVE
060548,000250: 
060549,000251:    5752           01363                           TC       ALMCADR                               #  RETURN TO USER
060550,000252: 
060551,000253:    5753     5644               ABORT              EQUALS   WHIMPER                               
060552,000254: 13,3755                                           BANK     13                                    
060553,000255: 13,2000                                           SETLOC   ABTFLGS                               
060554,000256: 13,2000                                           BANK                                           

Page 1385

060556,000258: 13,3755                                           COUNT*   $$/ALARM                              
060557,000259: 
060558,000260: 13,3755           44747        FLAGS              CS       STATEBIT                              
060559,000261: 13,3756           70077                           MASK     FLAGWRD3                              
060560,000262: 13,3757           54077                           TS       FLAGWRD3                              
060561,000263: 13,3760           44745                           CS       REINTBIT                              
060562,000264: 13,3761           70106                           MASK     FLGWRD10                              
060563,000265: 13,3762           54106                           TS       FLGWRD10                              
060564,000266: 13,3763           44753                           CS       NODOBIT                               
060565,000267: 13,3764           70076                           MASK     FLAGWRD2                              
060566,000268: 13,3765           54076                           TS       FLAGWRD2                              
060567,000269: 13,3766           00002                           TC       Q                                     
060568,000270: 

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