Source Code

These source-code files are part of a reconstructed copy of Luminary 96, the original release of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with reconstructed source code for Luminary 97. Changes between revisions 96 and 97 were backed out, as described by anomal report LNY-59. transcribed from a digitized copy of that program. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152D. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 96 listing.

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

057876,000002:                                                                                                  ## Copyright:   Public domain.
057877,000003:                                                                                                  ## Filename:    ALARM_AND_ABORT.agc
057878,000004:                                                                                                  ## Purpose:     A section of Luminary revision 96.
057879,000005:                                                                                                  ##              It is part of the reconstructed source code for the
057880,000006:                                                                                                  ##              original release of the flight software for the Lunar 
057881,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
057882,000008:                                                                                                  ##              The code has been recreated from a previously reconstructed
057883,000009:                                                                                                  ##              copy of Luminary 97 by undoing changes described in anomaly
057884,000010:                                                                                                  ##              report LNY-59. The code has been adapted such that the
057885,000011:                                                                                                  ##              resulting bugger words exactly match those specified for
057886,000012:                                                                                                  ##              Luminary 96 in NASA drawing 2021152D, which gives relatively
057887,000013:                                                                                                  ##              high confidence that the reconstruction is correct.
057888,000014:                                                                                                  ## Reference:   pp. 1381-1385
057889,000015:                                                                                                  ## Assembler:   yaYUL
057890,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
057891,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
057892,000018:                                                                                                  ## Mod history: 2019-08-04 MAS  Created from Luminary 97.
057893,000019: 

Page 1381

057895,000021:                                                                                                  #  THE FOLLOWING SUBROUTINE MAY BE CALLED TO DISPLAY A NON-ABORTIVE ALARM CONDITION.  IT MAY BE CALLED
057896,000022:                                                                                                  #  EITHER IN INTERRUPT OR UNDER EXECUTIVE CONTROL.
057897,000023: 
057898,000024:                                                                                                  #  CALLING SEQUENCE IS AS FOLLOWS:
057899,000025:                                                                                                  #                TC      ALARM
057900,000026:                                                                                                  #                OCT     AAANN           ALARM NO. NN IN GENERAL AREA AAA.
057901,000027:                                                                                                  #                                        (RETURNS HERE)
057902,000028: 
057903,000029:    5567                                           BLOCK    02                                    
057904,000030:    4000                                           SETLOC   FFTAG7                                
057905,000031:    4000                                           BANK                                           
057906,000032: 
057907,000033:    5567     0375                                  EBANK=   FAILREG                               
057908,000034: 
057909,000035:    5567                                           COUNT*   $$/ALARM                              
057910,000036: 
057911,000037:                                                                                                  #  ALARM TURNS ON THE PROGRAM ALARM LIGHT, BUT DOES NOT DISPLAY.
057912,000038: 
057913,000039:    5567           00004        ALARM              INHINT                                         
057914,000040: 
057915,000041:    5570           30002                           CA       Q                                     
057916,000042:    5571           55363        ALARM2             TS       ALMCADR                               
057917,000043:    5572           50002                           INDEX    Q                                     
057918,000044:    5573           30000                           CA       0                                     
057919,000045:    5574           54001        BORTENT            TS       L                                     
057920,000046: 
057921,000047:    5575           30006        PRIOENT            CA       BBANK                                 
057922,000048:    5576           00006                 +1        EXTEND                                         
057923,000049:    5577           04007                           ROR      SUPERBNK                              #  ADD SUPER BITS.
057924,000050:    5600           55364                           TS       ALMCADR    +1                         
057925,000051: 
057926,000052:    5601           30002        LARMENT            CA       Q                                     #  STORE RETURN FOR ALARM
057927,000053:    5602           54061                           TS       ITEMP1                                
057928,000054: 
057929,000055:    5603           10375        CHKFAIL1           CCS      FAILREG                               #  IS ANYTHING IN FAILREG
057930,000056:    5604           15607                           TCF      CHKFAIL2                              #  YES TRY NEXT REG
057931,000057:    5605           22375                           LXCH     FAILREG                               
057932,000058:    5606           15621                           TCF      PROGLARM                              #  TURN ALARM LIGHT ON FOR FIRST ALARM
057933,000059: 
057934,000060:    5607           10376        CHKFAIL2           CCS      FAILREG    +1                         
057935,000061:    5610           15613                           TCF      FAIL3                                 
057936,000062:    5611           22376                           LXCH     FAILREG    +1                         
057937,000063:    5612           15624                           TCF      MULTEXIT                              
057938,000064: 
057939,000065:    5613           30377        FAIL3              CA       FAILREG    +2                         
057940,000066:    5614           74733                           MASK     POSMAX                                
057941,000067:    5615           10000                           CCS      A                                     
057942,000068:    5616           15630                           TCF      MULTFAIL                              
057943,000069:    5617           22377                           LXCH     FAILREG    +2                         
057944,000070:    5620           15624                           TCF      MULTEXIT                              
057945,000071: 

Page 1382

057947,000073: 
057948,000074:    5621           41036        PROGLARM           CS       DSPTAB     +11D                       
057949,000075:    5622           75642                           MASK     OCT40400                              
057950,000076:    5623           27036                           ADS      DSPTAB     +11D                       
057951,000077: 
057952,000078: 
057953,000079:    5624           56061        MULTEXIT           XCH      ITEMP1                                #  OBTAIN RETURN ADDRESS IN A
057954,000080:    5625           00003                           RELINT                                         
057955,000081:    5626           50000                           INDEX    A                                     
057956,000082:    5627           00001                           TC       1                                     
057957,000083: 
057958,000084:    5630           30001        MULTFAIL           CA       L                                     
057959,000085:    5631           64735                           AD       BIT15                                 
057960,000086:    5632           54377                           TS       FAILREG    +2                         
057961,000087: 
057962,000088:    5633           15624                           TCF      MULTEXIT                              
057963,000089: 
057964,000090:                                                                                                  #  PRIOLARM DISPLAYS V05N09 VIA PRIODSPR WITH 3 RETURNS TO THE USER FROM THE ASTRONAUT AT CALL LOC +1,+2,+3 AND
057965,000091:                                                                                                  #  AN IMMEDIATE RETURN TO THE USER AT CALL LOC +4.  EXAMPLE FOLLOWS,
057966,000092:                                                                                                  #                CAF     OCTXX           ALARM CODE
057967,000093:                                                                                                  #                TC      BANKCALL
057968,000094:                                                                                                  #                CADR    PRIOLARM
057969,000095:                                                                                                  #                ...     ...
057970,000096:                                                                                                  #                ...     ...
057971,000097:                                                                                                  #                ...     ...             ASTRONAUT RETURN
057972,000098:                                                                                                  #                TC      PHASCHNG        IMMEDIATE RETURN TO USER.  RESTART
057973,000099:                                                                                                  #                OCT     X.1             PHASE CHANGE FOR PRIO DISPLAY
057974,000100: 
057975,000101: 10,3562                                           BANK     10                                    
057976,000102: 10,2000                                           SETLOC   DISPLAYS                              
057977,000103: 10,2000                                           BANK                                           
057978,000104: 
057979,000105: 10,3562                                           COUNT*   $$/DSPLA                              
057980,000106: 10,3562           00004        PRIOLARM           INHINT                                         #  * * * KEEP IN DISPLAY ROUTINES BANK
057981,000107: 10,3563           54001                           TS       L                                     #  SAVE ALARM CODE
057982,000108: 
057983,000109: 10,3564           30133                           CA       BUF2                                  #  2 CADR OF PRIOLARM USER
057984,000110: 10,3565           55363                           TS       ALMCADR                               
057985,000111: 10,3566           30134                           CA       BUF2       +1                         
057986,000112: 10,3567           05576                           TC       PRIOENT    +1                         #  * LEAVE L ALONE
057987,000113: 10,3570           77467        -2SEC              DEC      -200       B-14                       #  *** DONT MOVE
057988,000114: 10,3571           35006                           CAF      V05N09                                
057989,000115: 10,3572           12504                           TCF      PRIODSPR                              
057990,000116: 
057991,000117:    5634                                           BLOCK    02                                    
057992,000118:    4000                                           SETLOC   FFTAG7                                
057993,000119:    4000                                           BANK                                           
057994,000120: 
057995,000121:    5634                                           COUNT*   $$/ALARM                              
057996,000122:    5634           00004        BAILOUT            INHINT                                         
057997,000123:    5635           30002                           CA       Q                                     

Page 1383

057999,000125:    5636           55363                           TS       ALMCADR                               
058000,000126: 
058001,000127:    5637           50002                           INDEX    Q                                     
058002,000128:    5640           30000                           CAF      0                                     
058003,000129:    5641           05574                           TC       BORTENT                               
058004,000130:    5642           40400        OCT40400           OCT      40400                                 
058005,000131: 
058006,000132:    5643           00004                           INHINT                                         
058007,000133:    5644           34752        WHIMPER            CA       TWO                                   
058008,000134:    5645           60005                           AD       Z                                     
058009,000135:    5646           54017                           TS       BRUPT                                 
058010,000136:    5647           50017                           RESUME                                         
058011,000137:    5650           04635                           TC       POSTJUMP                              #  RESUME SENDS CONTROL HERE
058012,000138:    5651           12765                           CADR     ENEMA                                 
058013,000139:    5652           00004        POODOO             INHINT                                         
058014,000140:    5653           30002                           CA       Q                                     
058015,000141:    5654           55363        ABORT2             TS       ALMCADR                               
058016,000142:    5655           50002                           INDEX    Q                                     
058017,000143:    5656           30000                           CAF      0                                     
058018,000144:    5657           05574                           TC       BORTENT                               
058019,000145:    5660           77770        OCT77770           OCT      77770                                 #  DON'T MOVE
058020,000146: 
058021,000147:    5661           34765                           CAF      OCT35                                 #  4.35SPOT FOR GOPOODOO
058022,000148:    5662           54001                           TS       L                                     
058023,000149:    5663           40000                           COM                                            
058024,000150:    5664           52761                           DXCH     -PHASE4                               
058025,000151:    5665           00004        GOPOODOO           INHINT                                         
058026,000152:    5666           04616                           TC       BANKCALL                              #  RESET STATEFLG, REINTFLG, AND NODOFLAG.
058027,000153:    5667           27755                           CADR     FLAGS                                 
058028,000154:    5670           30103                           CA       FLAGWRD7                              #  IS SERVICER CURRENTLY IN OPERATION?
058029,000155:    5671           74746                           MASK     V37FLBIT                              
058030,000156:    5672           10000                           CCS      A                                     
058031,000157:    5673           15701                           TCF      STRTIDLE                              
058032,000158:    5674           04616                           TC       BANKCALL                              #  TERMINATE GRPS 1, 3, 5, AND 6
058033,000159:    5675           12652                           CADR     V37KLEAN                              
058034,000160:    5676           04616                           TC       BANKCALL                              #  TERMINATE GRPS 2, 4, 1, 3, 5, AND 6
058035,000161:    5677           12643                           CADR     MR.KLEAN                              #        (I.E., GRP 4 LAST)
058036,000162:    5700           15644                           TCF      WHIMPER                               
058037,000163:    5701           35743        STRTIDLE           CAF      BBSERVDL                              
058038,000164:    5702           04727                           TC       SUPERSW                               
058039,000165:    5703           04616                           TC       BANKCALL                              #  PUT SERVICER INTO ITS "GROUND" STATE
058040,000166:    5704           57321                           CADR     SERVIDLE                              #  AND PROCEED TO GOTOPOOH.
058041,000167:    5705           00004        CCSHOLE            INHINT                                         
058042,000168:    5706           30002                           CA       Q                                     
058043,000169:    5707           05654                           TC       ABORT2                                
058044,000170:    5710           01103        OCT21103           OCT      1103                                  
058045,000171:    5711           00004        CURTAINS           INHINT                                         
058046,000172:    5712           30002                           CA       Q                                     
058047,000173:    5713           05571                           TC       ALARM2                                
058048,000174:    5714           00217        OCT217             OCT      00217                                 

Page 1384

058050,000176:    5715           01363                           TC       ALMCADR                               #  RETURN TO USER
058051,000177: 
058052,000178:    5716           00004        BAILOUT1           INHINT                                         
058053,000179:    5717           53364                           DXCH     ALMCADR                               
058054,000180:    5720           35742                           CAF      ADR40400                              
058055,000181:    5721           54061        BOTHABRT           TS       ITEMP1                                
058056,000182:    5722           50002                           INDEX    Q                                     
058057,000183:    5723           30000                           CAF      0                                     
058058,000184:    5724           54001                           TS       L                                     
058059,000185:    5725           15603                           TCF      CHKFAIL1                              
058060,000186:    5726           00004        POODOO1            INHINT                                         
058061,000187:    5727           53364                           DXCH     ALMCADR                               
058062,000188:    5730           35741                           CAF      ADR77770                              
058063,000189:    5731           15721                           TCF      BOTHABRT                              
058064,000190: 
058065,000191:    5732           00004        ALARM1             INHINT                                         
058066,000192:    5733           53364                           DXCH     ALMCADR                               
058067,000193:    5734           00004        ALMNCADR           INHINT                                         
058068,000194:    5735           50002                           INDEX    Q                                     
058069,000195:    5736           30000                           CA       0                                     
058070,000196:    5737           54001                           TS       L                                     
058071,000197:    5740           15601                           TCF      LARMENT                               
058072,000198: 
058073,000199:    5741           15660        ADR77770           TCF      OCT77770                              
058074,000200:    5742           15642        ADR40400           TCF      OCT40400                              
058075,000201:    5743     5155               DOALARM            EQUALS   ENDOFJOB                              
058076,000202:    5743  E7,1515                                  EBANK=   DVCNTR                                
058077,000203:    5743           56067        BBSERVDL           BBCON    SERVIDLE                              
058078,000204: 
058079,000205:                                                                                                  #  CALLING SEQUENCE FOR VARALARM
058080,000206:                                                                                                  #                CAF     (ALARM)
058081,000207:                                                                                                  #                TC      VARALARM
058082,000208: 
058083,000209:                                                                                                  #  VARALARM TURNS ON PROGRAM ALARM LIGHT BUT DOES NOT DISPLAY
058084,000210: 
058085,000211:    5744           00004        VARALARM           INHINT                                         
058086,000212: 
058087,000213:    5745           54001                           TS       L                                     #  SAVE USERS ALARM CODE
058088,000214: 
058089,000215:    5746           30002                           CA       Q                                     #  SAVE USERS Q
058090,000216:    5747           55363                           TS       ALMCADR                               
058091,000217: 
058092,000218:    5750           05575                           TC       PRIOENT                               
058093,000219:    5751           00014        OCT14              OCT      14                                    #  DONT MOVE
058094,000220: 
058095,000221:    5752           01363                           TC       ALMCADR                               #  RETURN TO USER
058096,000222: 
058097,000223:    5753     5644               ABORT              EQUALS   WHIMPER                               
058098,000224: 13,3755                                           BANK     13                                    
058099,000225: 13,2000                                           SETLOC   ABTFLGS                               
058100,000226: 13,2000                                           BANK                                           

Page 1385

058102,000228: 13,3755                                           COUNT*   $$/ALARM                              
058103,000229: 
058104,000230: 13,3755           44747        FLAGS              CS       STATEBIT                              
058105,000231: 13,3756           70077                           MASK     FLAGWRD3                              
058106,000232: 13,3757           54077                           TS       FLAGWRD3                              
058107,000233: 13,3760           44745                           CS       REINTBIT                              
058108,000234: 13,3761           70106                           MASK     FLGWRD10                              
058109,000235: 13,3762           54106                           TS       FLGWRD10                              
058110,000236: 13,3763           44753                           CS       NODOBIT                               
058111,000237: 13,3764           70076                           MASK     FLAGWRD2                              
058112,000238: 13,3765           54076                           TS       FLAGWRD2                              
058113,000239: 13,3766           00002                           TC       Q                                     
058114,000240: 

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