Source Code

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

The reconstruction began with source code of Zerlina 56, Luminary 210, and Luminary 131, previously transcribed from digitized copies of those programs. The code was created by combining the three, using Zerlina 56 as a base, since it was based off of Luminary 183. The differences between the three were carefully merged using the Luminary memos as a guide, with all changes made after Luminary 178 being backed out. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 178 listing would be different.

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.

058651,000002:                                                                                                  ## Copyright:   Public domain.
058652,000003:                                                                                                  ## Filename:    ALARM_AND_ABORT.agc
058653,000004:                                                                                                  ## Purpose:     A section of Luminary revision 178.
058654,000005:                                                                                                  ##              It is part of the reconstructed source code for the final
058655,000006:                                                                                                  ##              release of the flight software for the Lunar Module's
058656,000007:                                                                                                  ##              (LM) Apollo Guidance Computer (AGC) for Apollo 14. The
058657,000008:                                                                                                  ##              code has been recreated from copies of Zerlina 56, Luminary
058658,000009:                                                                                                  ##              210, and Luminary 131, as well as many Luminary memos.
058659,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
058660,000011:                                                                                                  ##              exactly match those specified for Luminary 178 in NASA
058661,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
058662,000013:                                                                                                  ##              that the reconstruction is correct.
058663,000014:                                                                                                  ## Reference:   pp. 1369-1373
058664,000015:                                                                                                  ## Assembler:   yaYUL
058665,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
058666,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
058667,000018:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Zerlina 56.
058668,000019: 

Page 1369

058670,000021:                                                                                                  #           THE FOLLOWING SUBROUTINE MAY BE CALLED TO DISPLAY A NON-ABORTIVE ALARM CONDITION. IT MAY BE CALLED
058671,000022:                                                                                                  #  EITHER IN INTERRUPT OR UNDER EXECUTIVE CONTROL.
058672,000023: 
058673,000024:                                                                                                  #           CALLING SEQUENCE IS AS FOLLOWS:
058674,000025: 
058675,000026:                                                                                                  #           TC     ALARM
058676,000027:                                                                                                  #           OCT    AAANN           ALARM NO. NN IN GENERAL AREA AAA.
058677,000028:                                                                                                  #                                  (RETURNS HERE)
058678,000029: 
058679,000030:    5600                                           BLOCK    02                                    
058680,000031:    4000                                           SETLOC   FFTAG7                                
058681,000032:    4000                                           BANK                                           
058682,000033: 
058683,000034:    5600     0375                                  EBANK=   FAILREG                               
058684,000035: 
058685,000036:    5600                                           COUNT*   $$/ALARM                              
058686,000037:                                                                                                  #  ALARM TURNS ON THE PROGRAM ALARM LIGHT, BUT DOES NOT DISPLAY.
058687,000038: 
058688,000039:    5600           00004        ALARM              INHINT                                         
058689,000040: 
058690,000041:    5601           30002                           CA       Q                                     
058691,000042:    5602           55363        ALARM2             TS       ALMCADR                               
058692,000043:    5603           50002                           INDEX    Q                                     
058693,000044:    5604           30000                           CA       0                                     
058694,000045:    5605           54001        BORTENT            TS       L                                     
058695,000046: 
058696,000047:    5606           30006        PRIOENT            CA       BBANK                                 
058697,000048:    5607           00006                 +1        EXTEND                                         
058698,000049:    5610           04007                           ROR      SUPERBNK                              #  ADD SUPER BITS.
058699,000050:    5611           55364                           TS       ALMCADR    +1                         
058700,000051: 
058701,000052:    5612           30002        LARMENT            CA       Q                                     #  STORE RETURN FOR ALARM
058702,000053:    5613           54061                           TS       ITEMP1                                
058703,000054: 
058704,000055:    5614           10375        CHKFAIL1           CCS      FAILREG                               #  IS ANYTHING IN FAILREG
058705,000056:    5615           15621                           TCF      CHKFAIL2                              #  YES TRY NEXT REG
058706,000057:    5616           30001                           CA       L                                     
058707,000058:    5617           54375                           TS       FAILREG                               
058708,000059:    5620           15625                           TCF      PROGLARM                              #  TURN ALARM LIGHT ON FOR FIRST ALARM
058709,000060: 
058710,000061:    5621           10376        CHKFAIL2           CCS      FAILREG    +1                         
058711,000062:    5622           15625                           TCF      PROGLARM                              
058712,000063:    5623           30001                           CA       L                                     
058713,000064:    5624           54376                           TS       FAILREG    +1                         
058714,000065: 
058715,000066:    5625           22377        PROGLARM           LXCH     FAILREG    +2                         #  STORE AS "MOST RECENT" ALARM CODE
058716,000067: 
058717,000068:    5626           41035                           CS       DSPTAB     +11D                       #  TURN ON PROGRAM ALARM IF OFF
058718,000069:    5627           75643                           MASK     OCT40400                              
058719,000070:    5630           27035                           ADS      DSPTAB     +11D                       
058720,000071: 

Page 1370

058722,000073:    5631           56061        MULTEXIT           XCH      ITEMP1                                #  OBTAIN RETURN ADDRESS IN A
058723,000074:    5632           00003                           RELINT                                         
058724,000075:    5633           50000                           INDEX    A                                     
058725,000076:    5634           00001                           TC       1                                     
058726,000077: 
058727,000078:                                                                                                  #  PRIOLARM DISPLAYS V05N09 VIA PRIODSPR WITH 3 RETURNS TO THE USER FROM THE ASTRONAUT AT CALL LOC +1,+2,+3 AND
058728,000079:                                                                                                  #  AN IMMEDIATE RETURN TO THE USER AT CALL LOC +4. EXAMPLE FOLLOWS,
058729,000080:                                                                                                  #                                                   CAF    OCTXX           ALARM CODE
058730,000081:                                                                                                  #                                                   TC     BANKCALL
058731,000082:                                                                                                  #                                                   CADR   PRIOLARM
058732,000083: 
058733,000084:                                                                                                  #                                                   ...    ...
058734,000085:                                                                                                  #                                                   ...    ...
058735,000086:                                                                                                  #                                                   ...    ...             ASTRONAUT RETURN
058736,000087:                                                                                                  #                                                   TC     PHASCHNG        IMMEDIATE RETURN TO USER. RESTART
058737,000088:                                                                                                  #                                                   OCT    X.1             PHASE CHANGE FOR PRIO DISPLAY
058738,000089: 
058739,000090: 10,3563                                           BANK     10                                    
058740,000091: 10,2000                                           SETLOC   DISPLAYS                              
058741,000092: 10,2000                                           BANK                                           
058742,000093: 
058743,000094: 10,3563                                           COUNT*   $$/DSPLA                              
058744,000095: 10,3563           00004        PRIOLARM           INHINT                                         #  * * * KEEP IN DISPLAY ROUTINES BANK
058745,000096: 10,3564           54001                           TS       L                                     #  SAVE ALARM CODE
058746,000097: 
058747,000098: 10,3565           30133                           CA       BUF2                                  #  2 CADR OF PRIOLARM USER
058748,000099: 10,3566           55363                           TS       ALMCADR                               
058749,000100: 10,3567           30134                           CA       BUF2       +1                         
058750,000101: 10,3570           05607                           TC       PRIOENT    +1                         #  * LEAVE L ALONE
058751,000102: 10,3571           77467        -2SEC              DEC      -200       B-14                       #  *** DONT MOVE
058752,000103: 10,3572           35006                           CAF      V05N09                                
058753,000104: 10,3573           12505                           TCF      PRIODSPR                              
058754,000105: 
058755,000106:    5635                                           BLOCK    02                                    
058756,000107:    4000                                           SETLOC   FFTAG7                                
058757,000108:    4000                                           BANK                                           
058758,000109: 
058759,000110:    5635                                           COUNT*   $$/ALARM                              
058760,000111:    5635           00004        BAILOUT            INHINT                                         
058761,000112:    5636           30002                           CA       Q                                     
058762,000113:    5637           55363                           TS       ALMCADR                               
058763,000114: 
058764,000115:    5640           50002                           INDEX    Q                                     
058765,000116:    5641           30000                           CAF      0                                     
058766,000117:    5642           05605                           TC       BORTENT                               
058767,000118:    5643           40400        OCT40400           OCT      40400                                 
058768,000119: 
058769,000120:    5644           00004                           INHINT                                         
058770,000121:    5645           34752        WHIMPER            CA       TWO                                   
058771,000122:    5646           60005                           AD       Z                                     

Page 1371

058773,000124:    5647           54017                           TS       BRUPT                                 
058774,000125:    5650           50017                           RESUME                                         
058775,000126:    5651           04635                           TC       POSTJUMP                              #  RESUME SENDS CONTROL HERE
058776,000127:    5652           12775                           CADR     ENEMA                                 
058777,000128:    5653           00004        POODOO             INHINT                                         
058778,000129:    5654           30002                           CA       Q                                     
058779,000130:    5655           55363        ABORT2             TS       ALMCADR                               
058780,000131:    5656           50002                           INDEX    Q                                     
058781,000132:    5657           30000                           CAF      0                                     
058782,000133:    5660           05605                           TC       BORTENT                               
058783,000134:    5661           77770        OCT77770           OCT      77770                                 #  DON'T MOVE
058784,000135: 
058785,000136:    5662           34765                           CAF      OCT35                                 #  4.35SPOT FOR GOPOODOO
058786,000137:    5663           54001                           TS       L                                     
058787,000138:    5664           40000                           COM                                            
058788,000139:    5665           52760                           DXCH     -PHASE4                               
058789,000140:    5666           00004        GOPOODOO           INHINT                                         
058790,000141:    5667           04616                           TC       BANKCALL                              #  RESET STATEFLG, REINTFLG, AND NODOFLAG.
058791,000142:    5670           27746                           CADR     FLAGS                                 
058792,000143:    5671           30103                           CA       FLAGWRD7                              #  IS SERVICER CURRENTLY IN OPERATION?
058793,000144:    5672           74746                           MASK     V37FLBIT                              
058794,000145:    5673           10000                           CCS      A                                     
058795,000146:    5674           15702                           TCF      STRTIDLE                              
058796,000147:    5675           04616                           TC       BANKCALL                              #  TERMINATE GRPS 1, 3, 5, AND 6
058797,000148:    5676           12662                           CADR     V37KLEAN                              
058798,000149:    5677           04616                           TC       BANKCALL                              #  TERMINATE GRPS 2, 4, 1, 3, 5, AND 6
058799,000150:    5700           12653                           CADR     MR.KLEAN                              #        (I.E., GRP 4 LAST)
058800,000151:    5701           15645                           TCF      WHIMPER                               
058801,000152:    5702           35744        STRTIDLE           CAF      BBSERVDL                              
058802,000153:    5703           04727                           TC       SUPERSW                               
058803,000154:    5704           04616                           TC       BANKCALL                              #  PUT SERVICER INTO ITS "GROUND" STATE
058804,000155:    5705           57322                           CADR     SERVIDLE                              #  AND PROCEED TO GOTOPOOH.
058805,000156:    5706           00004        CCSHOLE            INHINT                                         
058806,000157:    5707           30002                           CA       Q                                     
058807,000158:    5710           05655                           TC       ABORT2                                
058808,000159:    5711           21103        OCT21103           OCT      21103                                 
058809,000160:    5712           00004        CURTAINS           INHINT                                         
058810,000161:    5713           30002                           CA       Q                                     
058811,000162:    5714           05602                           TC       ALARM2                                
058812,000163:    5715           00217        OCT217             OCT      00217                                 
058813,000164:    5716           01363                           TC       ALMCADR                               #  RETURN TO USER
058814,000165: 
058815,000166:    5717           00004        BAILOUT1           INHINT                                         
058816,000167:    5720           53364                           DXCH     ALMCADR                               
058817,000168:    5721           35743                           CAF      ADR40400                              
058818,000169:    5722           54061        BOTHABRT           TS       ITEMP1                                
058819,000170:    5723           50002                           INDEX    Q                                     
058820,000171:    5724           30000                           CAF      0                                     
058821,000172:    5725           54001                           TS       L                                     
058822,000173:    5726           15614                           TCF      CHKFAIL1                              
058823,000174: 

Page 1372

058825,000176:    5727           00004        POODOO1            INHINT                                         
058826,000177:    5730           53364                           DXCH     ALMCADR                               
058827,000178:    5731           35742                           CAF      ADR77770                              
058828,000179:    5732           15722                           TCF      BOTHABRT                              
058829,000180: 
058830,000181:    5733           00004        ALARM1             INHINT                                         
058831,000182:    5734           53364                           DXCH     ALMCADR                               
058832,000183:    5735           00004        ALMNCADR           INHINT                                         
058833,000184:    5736           50002                           INDEX    Q                                     
058834,000185:    5737           30000                           CA       0                                     
058835,000186:    5740           54001                           TS       L                                     
058836,000187:    5741           15612                           TCF      LARMENT                               
058837,000188: 
058838,000189:    5742           15661        ADR77770           TCF      OCT77770                              
058839,000190:    5743           15643        ADR40400           TCF      OCT40400                              
058840,000191:    5744     5155               DOALARM            EQUALS   ENDOFJOB                              
058841,000192:    5744  E7,1515                                  EBANK=   DVCNTR                                
058842,000193:    5744           56067        BBSERVDL           BBCON    SERVIDLE                              
058843,000194:                                                                                                  #  CALLING SEQUENCE FOR VARALARM
058844,000195: 
058845,000196:                                                                                                  #                                                   CAF    (ALARM)
058846,000197:                                                                                                  #                                                   TC     VARALARM
058847,000198: 
058848,000199:                                                                                                  #  VARALARM TURNS ON PROGRAM ALARM LIGHT BUT DOES NOT DISPLAY
058849,000200:    5745           00004        VARALARM           INHINT                                         
058850,000201: 
058851,000202:    5746           54001                           TS       L                                     #  SAVE USERS ALARM CODE
058852,000203: 
058853,000204:    5747           30002                           CA       Q                                     #  SAVE USERS Q
058854,000205:    5750           55363                           TS       ALMCADR                               
058855,000206: 
058856,000207:    5751           05606                           TC       PRIOENT                               
058857,000208:    5752           00014        OCT14              OCT      14                                    #  DONT MOVE
058858,000209: 
058859,000210:    5753           01363                           TC       ALMCADR                               #  RETURN TO USER
058860,000211: 
058861,000212:    5754     5645               ABORT              EQUALS   WHIMPER                               
058862,000213: 13,3746                                           BANK     13                                    
058863,000214: 13,2000                                           SETLOC   ABTFLGS                               
058864,000215: 13,2000                                           BANK                                           
058865,000216: 13,3746                                           COUNT*   $$/ALARM                              
058866,000217: 
058867,000218: 13,3746           44747        FLAGS              CS       STATEBIT                              
058868,000219: 13,3747           70077                           MASK     FLAGWRD3                              
058869,000220: 13,3750           54077                           TS       FLAGWRD3                              
058870,000221: 13,3751           44745                           CS       REINTBIT                              
058871,000222: 13,3752           70106                           MASK     FLGWRD10                              
058872,000223: 13,3753           54106                           TS       FLGWRD10                              
058873,000224: 13,3754           44753                           CS       NODOBIT                               
058874,000225: 13,3755           70076                           MASK     FLAGWRD2                              

Page 1373

058876,000227: 13,3756           54076                           TS       FLAGWRD2                              
058877,000228: 13,3757           00002                           TC       Q                                     

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