Source Code

These source-code files are part of a reconstructed copy of Luminary 97, the second release of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software. It was created to fix two incorrect ephemeris constants in Luminary 96, as described by anomaly report LNY-59.

The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memos 83 and 85, using asterisks indicating changed lines in the listing as a guide. 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 97 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.

058194,000002:                                                                                                  ## Copyright:   Public domain.
058195,000003:                                                                                                  ## Filename:    ALARM_AND_ABORT.agc
058196,000004:                                                                                                  ## Purpose:     A section of Luminary revision 97.
058197,000005:                                                                                                  ##              It is part of the reconstructed source code for the
058198,000006:                                                                                                  ##              second release of the flight software for the Lunar 
058199,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
058200,000008:                                                                                                  ##              It was created to fix two incorrect ephemeris constants in
058201,000009:                                                                                                  ##              Luminary 96, as described by anomaly report LNY-59.
058202,000010:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
058203,000011:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
058204,000012:                                                                                                  ##              the listing and Luminary Memos #83 and #85, which list 
058205,000013:                                                                                                  ##              changes between Luminary 97 and 98, and 98 and 99. The
058206,000014:                                                                                                  ##              code has been adapted such that the resulting bugger words
058207,000015:                                                                                                  ##              exactly match those specified for Luminary 97 in NASA drawing
058208,000016:                                                                                                  ##              2021152D, which gives relatively high confidence that the
058209,000017:                                                                                                  ##              reconstruction is correct.
058210,000018:                                                                                                  ## Reference:   pp. 1381-1385
058211,000019:                                                                                                  ## Assembler:   yaYUL
058212,000020:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
058213,000021:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
058214,000022:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
058215,000023:                                                                                                  ##              2021-05-30 ABS  OCT21103 -> OCT1103
058216,000024: 

Page 1381

058218,000026:                                                                                                  #  THE FOLLOWING SUBROUTINE MAY BE CALLED TO DISPLAY A NON-ABORTIVE ALARM CONDITION.  IT MAY BE CALLED
058219,000027:                                                                                                  #  EITHER IN INTERRUPT OR UNDER EXECUTIVE CONTROL.
058220,000028: 
058221,000029:                                                                                                  #  CALLING SEQUENCE IS AS FOLLOWS:
058222,000030:                                                                                                  #                TC      ALARM
058223,000031:                                                                                                  #                OCT     AAANN           ALARM NO. NN IN GENERAL AREA AAA.
058224,000032:                                                                                                  #                                        (RETURNS HERE)
058225,000033: 
058226,000034:    5567                                           BLOCK    02                                    
058227,000035:    4000                                           SETLOC   FFTAG7                                
058228,000036:    4000                                           BANK                                           
058229,000037: 
058230,000038:    5567     0375                                  EBANK=   FAILREG                               
058231,000039: 
058232,000040:    5567                                           COUNT*   $$/ALARM                              
058233,000041: 
058234,000042:                                                                                                  #  ALARM TURNS ON THE PROGRAM ALARM LIGHT, BUT DOES NOT DISPLAY.
058235,000043: 
058236,000044:    5567           00004        ALARM              INHINT                                         
058237,000045: 
058238,000046:    5570           30002                           CA       Q                                     
058239,000047:    5571           55363        ALARM2             TS       ALMCADR                               
058240,000048:    5572           50002                           INDEX    Q                                     
058241,000049:    5573           30000                           CA       0                                     
058242,000050:    5574           54001        BORTENT            TS       L                                     
058243,000051: 
058244,000052:    5575           30006        PRIOENT            CA       BBANK                                 
058245,000053:    5576           00006                 +1        EXTEND                                         
058246,000054:    5577           04007                           ROR      SUPERBNK                              #  ADD SUPER BITS.
058247,000055:    5600           55364                           TS       ALMCADR    +1                         
058248,000056: 
058249,000057:    5601           30002        LARMENT            CA       Q                                     #  STORE RETURN FOR ALARM
058250,000058:    5602           54061                           TS       ITEMP1                                
058251,000059: 
058252,000060:    5603           10375        CHKFAIL1           CCS      FAILREG                               #  IS ANYTHING IN FAILREG
058253,000061:    5604           15607                           TCF      CHKFAIL2                              #  YES TRY NEXT REG
058254,000062:    5605           22375                           LXCH     FAILREG                               
058255,000063:    5606           15621                           TCF      PROGLARM                              #  TURN ALARM LIGHT ON FOR FIRST ALARM
058256,000064: 
058257,000065:    5607           10376        CHKFAIL2           CCS      FAILREG    +1                         
058258,000066:    5610           15613                           TCF      FAIL3                                 
058259,000067:    5611           22376                           LXCH     FAILREG    +1                         
058260,000068:    5612           15624                           TCF      MULTEXIT                              
058261,000069: 
058262,000070:    5613           30377        FAIL3              CA       FAILREG    +2                         
058263,000071:    5614           74733                           MASK     POSMAX                                
058264,000072:    5615           10000                           CCS      A                                     
058265,000073:    5616           15630                           TCF      MULTFAIL                              
058266,000074:    5617           22377                           LXCH     FAILREG    +2                         
058267,000075:    5620           15624                           TCF      MULTEXIT                              
058268,000076: 

Page 1382

058270,000078: 
058271,000079:    5621           41036        PROGLARM           CS       DSPTAB     +11D                       
058272,000080:    5622           75642                           MASK     OCT40400                              
058273,000081:    5623           27036                           ADS      DSPTAB     +11D                       
058274,000082: 
058275,000083: 
058276,000084:    5624           56061        MULTEXIT           XCH      ITEMP1                                #  OBTAIN RETURN ADDRESS IN A
058277,000085:    5625           00003                           RELINT                                         
058278,000086:    5626           50000                           INDEX    A                                     
058279,000087:    5627           00001                           TC       1                                     
058280,000088: 
058281,000089:    5630           30001        MULTFAIL           CA       L                                     
058282,000090:    5631           64735                           AD       BIT15                                 
058283,000091:    5632           54377                           TS       FAILREG    +2                         
058284,000092: 
058285,000093:    5633           15624                           TCF      MULTEXIT                              
058286,000094: 
058287,000095:                                                                                                  #  PRIOLARM DISPLAYS V05N09 VIA PRIODSPR WITH 3 RETURNS TO THE USER FROM THE ASTRONAUT AT CALL LOC +1,+2,+3 AND
058288,000096:                                                                                                  #  AN IMMEDIATE RETURN TO THE USER AT CALL LOC +4.  EXAMPLE FOLLOWS,
058289,000097:                                                                                                  #                CAF     OCTXX           ALARM CODE
058290,000098:                                                                                                  #                TC      BANKCALL
058291,000099:                                                                                                  #                CADR    PRIOLARM
058292,000100:                                                                                                  #                ...     ...
058293,000101:                                                                                                  #                ...     ...
058294,000102:                                                                                                  #                ...     ...             ASTRONAUT RETURN
058295,000103:                                                                                                  #                TC      PHASCHNG        IMMEDIATE RETURN TO USER.  RESTART
058296,000104:                                                                                                  #                OCT     X.1             PHASE CHANGE FOR PRIO DISPLAY
058297,000105: 
058298,000106: 10,3562                                           BANK     10                                    
058299,000107: 10,2000                                           SETLOC   DISPLAYS                              
058300,000108: 10,2000                                           BANK                                           
058301,000109: 
058302,000110: 10,3562                                           COUNT*   $$/DSPLA                              
058303,000111: 10,3562           00004        PRIOLARM           INHINT                                         #  * * * KEEP IN DISPLAY ROUTINES BANK
058304,000112: 10,3563           54001                           TS       L                                     #  SAVE ALARM CODE
058305,000113: 
058306,000114: 10,3564           30133                           CA       BUF2                                  #  2 CADR OF PRIOLARM USER
058307,000115: 10,3565           55363                           TS       ALMCADR                               
058308,000116: 10,3566           30134                           CA       BUF2       +1                         
058309,000117: 10,3567           05576                           TC       PRIOENT    +1                         #  * LEAVE L ALONE
058310,000118: 10,3570           77467        -2SEC              DEC      -200       B-14                       #  *** DONT MOVE
058311,000119: 10,3571           35006                           CAF      V05N09                                
058312,000120: 10,3572           12504                           TCF      PRIODSPR                              
058313,000121: 
058314,000122:    5634                                           BLOCK    02                                    
058315,000123:    4000                                           SETLOC   FFTAG7                                
058316,000124:    4000                                           BANK                                           
058317,000125: 
058318,000126:    5634                                           COUNT*   $$/ALARM                              
058319,000127:    5634           00004        BAILOUT            INHINT                                         
058320,000128:    5635           30002                           CA       Q                                     

Page 1383

058322,000130:    5636           55363                           TS       ALMCADR                               
058323,000131: 
058324,000132:    5637           50002                           INDEX    Q                                     
058325,000133:    5640           30000                           CAF      0                                     
058326,000134:    5641           05574                           TC       BORTENT                               
058327,000135:    5642           40400        OCT40400           OCT      40400                                 
058328,000136: 
058329,000137:    5643           00004                           INHINT                                         
058330,000138:    5644           34752        WHIMPER            CA       TWO                                   
058331,000139:    5645           60005                           AD       Z                                     
058332,000140:    5646           54017                           TS       BRUPT                                 
058333,000141:    5647           50017                           RESUME                                         
058334,000142:    5650           04635                           TC       POSTJUMP                              #  RESUME SENDS CONTROL HERE
058335,000143:    5651           12765                           CADR     ENEMA                                 
058336,000144:    5652           00004        POODOO             INHINT                                         
058337,000145:    5653           30002                           CA       Q                                     
058338,000146:    5654           55363        ABORT2             TS       ALMCADR                               
058339,000147:    5655           50002                           INDEX    Q                                     
058340,000148:    5656           30000                           CAF      0                                     
058341,000149:    5657           05574                           TC       BORTENT                               
058342,000150:    5660           77770        OCT77770           OCT      77770                                 #  DON'T MOVE
058343,000151: 
058344,000152:    5661           34765                           CAF      OCT35                                 #  4.35SPOT FOR GOPOODOO
058345,000153:    5662           54001                           TS       L                                     
058346,000154:    5663           40000                           COM                                            
058347,000155:    5664           52761                           DXCH     -PHASE4                               
058348,000156:    5665           00004        GOPOODOO           INHINT                                         
058349,000157:    5666           04616                           TC       BANKCALL                              #  RESET STATEFLG, REINTFLG, AND NODOFLAG.
058350,000158:    5667           27755                           CADR     FLAGS                                 
058351,000159:    5670           30103                           CA       FLAGWRD7                              #  IS SERVICER CURRENTLY IN OPERATION?
058352,000160:    5671           74746                           MASK     V37FLBIT                              
058353,000161:    5672           10000                           CCS      A                                     
058354,000162:    5673           15701                           TCF      STRTIDLE                              
058355,000163:    5674           04616                           TC       BANKCALL                              #  TERMINATE GRPS 1, 3, 5, AND 6
058356,000164:    5675           12652                           CADR     V37KLEAN                              
058357,000165:    5676           04616                           TC       BANKCALL                              #  TERMINATE GRPS 2, 4, 1, 3, 5, AND 6
058358,000166:    5677           12643                           CADR     MR.KLEAN                              #        (I.E., GRP 4 LAST)
058359,000167:    5700           15644                           TCF      WHIMPER                               
058360,000168:    5701           35743        STRTIDLE           CAF      BBSERVDL                              
058361,000169:    5702           04727                           TC       SUPERSW                               
058362,000170:    5703           04616                           TC       BANKCALL                              #  PUT SERVICER INTO ITS "GROUND" STATE
058363,000171:    5704           57321                           CADR     SERVIDLE                              #  AND PROCEED TO GOTOPOOH.
058364,000172:    5705           00004        CCSHOLE            INHINT                                         
058365,000173:    5706           30002                           CA       Q                                     
058366,000174:    5707           05654                           TC       ABORT2                                
058367,000175:    5710           01103        OCT1103            OCT      1103                                  
058368,000176:    5711           00004        CURTAINS           INHINT                                         
058369,000177:    5712           30002                           CA       Q                                     
058370,000178:    5713           05571                           TC       ALARM2                                
058371,000179:    5714           00217        OCT217             OCT      00217                                 

Page 1384

058373,000181:    5715           01363                           TC       ALMCADR                               #  RETURN TO USER
058374,000182: 
058375,000183:    5716           00004        BAILOUT1           INHINT                                         
058376,000184:    5717           53364                           DXCH     ALMCADR                               
058377,000185:    5720           35742                           CAF      ADR40400                              
058378,000186:    5721           54061        BOTHABRT           TS       ITEMP1                                
058379,000187:    5722           50002                           INDEX    Q                                     
058380,000188:    5723           30000                           CAF      0                                     
058381,000189:    5724           54001                           TS       L                                     
058382,000190:    5725           15603                           TCF      CHKFAIL1                              
058383,000191:    5726           00004        POODOO1            INHINT                                         
058384,000192:    5727           53364                           DXCH     ALMCADR                               
058385,000193:    5730           35741                           CAF      ADR77770                              
058386,000194:    5731           15721                           TCF      BOTHABRT                              
058387,000195: 
058388,000196:    5732           00004        ALARM1             INHINT                                         
058389,000197:    5733           53364                           DXCH     ALMCADR                               
058390,000198:    5734           00004        ALMNCADR           INHINT                                         
058391,000199:    5735           50002                           INDEX    Q                                     
058392,000200:    5736           30000                           CA       0                                     
058393,000201:    5737           54001                           TS       L                                     
058394,000202:    5740           15601                           TCF      LARMENT                               
058395,000203: 
058396,000204:    5741           15660        ADR77770           TCF      OCT77770                              
058397,000205:    5742           15642        ADR40400           TCF      OCT40400                              
058398,000206:    5743     5155               DOALARM            EQUALS   ENDOFJOB                              
058399,000207:    5743  E7,1515                                  EBANK=   DVCNTR                                
058400,000208:    5743           56067        BBSERVDL           BBCON    SERVIDLE                              
058401,000209: 
058402,000210:                                                                                                  #  CALLING SEQUENCE FOR VARALARM
058403,000211:                                                                                                  #                CAF     (ALARM)
058404,000212:                                                                                                  #                TC      VARALARM
058405,000213: 
058406,000214:                                                                                                  #  VARALARM TURNS ON PROGRAM ALARM LIGHT BUT DOES NOT DISPLAY
058407,000215: 
058408,000216:    5744           00004        VARALARM           INHINT                                         
058409,000217: 
058410,000218:    5745           54001                           TS       L                                     #  SAVE USERS ALARM CODE
058411,000219: 
058412,000220:    5746           30002                           CA       Q                                     #  SAVE USERS Q
058413,000221:    5747           55363                           TS       ALMCADR                               
058414,000222: 
058415,000223:    5750           05575                           TC       PRIOENT                               
058416,000224:    5751           00014        OCT14              OCT      14                                    #  DONT MOVE
058417,000225: 
058418,000226:    5752           01363                           TC       ALMCADR                               #  RETURN TO USER
058419,000227: 
058420,000228:    5753     5644               ABORT              EQUALS   WHIMPER                               
058421,000229: 13,3755                                           BANK     13                                    
058422,000230: 13,2000                                           SETLOC   ABTFLGS                               
058423,000231: 13,2000                                           BANK                                           

Page 1385

058425,000233: 13,3755                                           COUNT*   $$/ALARM                              
058426,000234: 
058427,000235: 13,3755           44747        FLAGS              CS       STATEBIT                              
058428,000236: 13,3756           70077                           MASK     FLAGWRD3                              
058429,000237: 13,3757           54077                           TS       FLAGWRD3                              
058430,000238: 13,3760           44745                           CS       REINTBIT                              
058431,000239: 13,3761           70106                           MASK     FLGWRD10                              
058432,000240: 13,3762           54106                           TS       FLGWRD10                              
058433,000241: 13,3763           44753                           CS       NODOBIT                               
058434,000242: 13,3764           70076                           MASK     FLAGWRD2                              
058435,000243: 13,3765           54076                           TS       FLAGWRD2                              
058436,000244: 13,3766           00002                           TC       Q                                     
058437,000245: 

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