Source Code

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

The reconstruction began with reconstructed source code for Luminary 173. Changes between revision 163 and 173 were backed out, as described by Luminary memos 157 and 158. 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 163 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.

058483,000002:                                                                                                  ## Copyright:   Public domain.
058484,000003:                                                                                                  ## Filename:    ALARM_AND_ABORT.agc
058485,000004:                                                                                                  ## Purpose:     A section of Luminary revision 163.
058486,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
058487,000006:                                                                                                  ##              (unflown) release of the flight software for the Lunar
058488,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 14.
058489,000008:                                                                                                  ##              The code has been recreated from a reconstructed copy of
058490,000009:                                                                                                  ##              Luminary 173, as well as Luminary memos 157 amd 158.
058491,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
058492,000011:                                                                                                  ##              exactly match those specified for Luminary 163 in NASA
058493,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
058494,000013:                                                                                                  ##              that the reconstruction is correct.
058495,000014:                                                                                                  ## Reference:   pp. 1369-1373
058496,000015:                                                                                                  ## Assembler:   yaYUL
058497,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
058498,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
058499,000018:                                                                                                  ## Mod history: 2019-08-21 MAS  Created from Luminary 173.
058500,000019: 

Page 1369

058502,000021:                                                                                                  #           THE FOLLOWING SUBROUTINE MAY BE CALLED TO DISPLAY A NON-ABORTIVE ALARM CONDITION. IT MAY BE CALLED
058503,000022:                                                                                                  #  EITHER IN INTERRUPT OR UNDER EXECUTIVE CONTROL.
058504,000023: 
058505,000024:                                                                                                  #           CALLING SEQUENCE IS AS FOLLOWS:
058506,000025: 
058507,000026:                                                                                                  #           TC     ALARM
058508,000027:                                                                                                  #           OCT    AAANN           ALARM NO. NN IN GENERAL AREA AAA.
058509,000028:                                                                                                  #                                  (RETURNS HERE)
058510,000029: 
058511,000030:    5600                                           BLOCK    02                                    
058512,000031:    4000                                           SETLOC   FFTAG7                                
058513,000032:    4000                                           BANK                                           
058514,000033: 
058515,000034:    5600     0375                                  EBANK=   FAILREG                               
058516,000035: 
058517,000036:    5600                                           COUNT*   $$/ALARM                              
058518,000037:                                                                                                  #  ALARM TURNS ON THE PROGRAM ALARM LIGHT, BUT DOES NOT DISPLAY.
058519,000038: 
058520,000039:    5600           00004        ALARM              INHINT                                         
058521,000040: 
058522,000041:    5601           30002                           CA       Q                                     
058523,000042:    5602           55363        ALARM2             TS       ALMCADR                               
058524,000043:    5603           50002                           INDEX    Q                                     
058525,000044:    5604           30000                           CA       0                                     
058526,000045:    5605           54001        BORTENT            TS       L                                     
058527,000046: 
058528,000047:    5606           30006        PRIOENT            CA       BBANK                                 
058529,000048:    5607           00006                 +1        EXTEND                                         
058530,000049:    5610           04007                           ROR      SUPERBNK                              #  ADD SUPER BITS.
058531,000050:    5611           55364                           TS       ALMCADR    +1                         
058532,000051: 
058533,000052:    5612           30002        LARMENT            CA       Q                                     #  STORE RETURN FOR ALARM
058534,000053:    5613           54061                           TS       ITEMP1                                
058535,000054: 
058536,000055:    5614           10375        CHKFAIL1           CCS      FAILREG                               #  IS ANYTHING IN FAILREG
058537,000056:    5615           15621                           TCF      CHKFAIL2                              #  YES TRY NEXT REG
058538,000057:    5616           30001                           CA       L                                     
058539,000058:    5617           54375                           TS       FAILREG                               
058540,000059:    5620           15625                           TCF      PROGLARM                              #  TURN ALARM LIGHT ON FOR FIRST ALARM
058541,000060: 
058542,000061:    5621           10376        CHKFAIL2           CCS      FAILREG    +1                         
058543,000062:    5622           15625                           TCF      PROGLARM                              
058544,000063:    5623           30001                           CA       L                                     
058545,000064:    5624           54376                           TS       FAILREG    +1                         
058546,000065: 
058547,000066:    5625           22377        PROGLARM           LXCH     FAILREG    +2                         #  STORE AS "MOST RECENT" ALARM CODE
058548,000067: 
058549,000068:    5626           41035                           CS       DSPTAB     +11D                       #  TURN ON PROGRAM ALARM IF OFF
058550,000069:    5627           75643                           MASK     OCT40400                              
058551,000070:    5630           27035                           ADS      DSPTAB     +11D                       
058552,000071: 

Page 1370

058554,000073:    5631           56061        MULTEXIT           XCH      ITEMP1                                #  OBTAIN RETURN ADDRESS IN A
058555,000074:    5632           00003                           RELINT                                         
058556,000075:    5633           50000                           INDEX    A                                     
058557,000076:    5634           00001                           TC       1                                     
058558,000077: 
058559,000078:                                                                                                  #  PRIOLARM DISPLAYS V05N09 VIA PRIODSPR WITH 3 RETURNS TO THE USER FROM THE ASTRONAUT AT CALL LOC +1,+2,+3 AND
058560,000079:                                                                                                  #  AN IMMEDIATE RETURN TO THE USER AT CALL LOC +4. EXAMPLE FOLLOWS,
058561,000080:                                                                                                  #                                                   CAF    OCTXX           ALARM CODE
058562,000081:                                                                                                  #                                                   TC     BANKCALL
058563,000082:                                                                                                  #                                                   CADR   PRIOLARM
058564,000083: 
058565,000084:                                                                                                  #                                                   ...    ...
058566,000085:                                                                                                  #                                                   ...    ...
058567,000086:                                                                                                  #                                                   ...    ...             ASTRONAUT RETURN
058568,000087:                                                                                                  #                                                   TC     PHASCHNG        IMMEDIATE RETURN TO USER. RESTART
058569,000088:                                                                                                  #                                                   OCT    X.1             PHASE CHANGE FOR PRIO DISPLAY
058570,000089: 
058571,000090: 10,3563                                           BANK     10                                    
058572,000091: 10,2000                                           SETLOC   DISPLAYS                              
058573,000092: 10,2000                                           BANK                                           
058574,000093: 
058575,000094: 10,3563                                           COUNT*   $$/DSPLA                              
058576,000095: 10,3563           00004        PRIOLARM           INHINT                                         #  * * * KEEP IN DISPLAY ROUTINES BANK
058577,000096: 10,3564           54001                           TS       L                                     #  SAVE ALARM CODE
058578,000097: 
058579,000098: 10,3565           30133                           CA       BUF2                                  #  2 CADR OF PRIOLARM USER
058580,000099: 10,3566           55363                           TS       ALMCADR                               
058581,000100: 10,3567           30134                           CA       BUF2       +1                         
058582,000101: 10,3570           05607                           TC       PRIOENT    +1                         #  * LEAVE L ALONE
058583,000102: 10,3571           77467        -2SEC              DEC      -200       B-14                       #  *** DONT MOVE
058584,000103: 10,3572           35006                           CAF      V05N09                                
058585,000104: 10,3573           12505                           TCF      PRIODSPR                              
058586,000105: 
058587,000106:    5635                                           BLOCK    02                                    
058588,000107:    4000                                           SETLOC   FFTAG7                                
058589,000108:    4000                                           BANK                                           
058590,000109: 
058591,000110:    5635                                           COUNT*   $$/ALARM                              
058592,000111:    5635           00004        BAILOUT            INHINT                                         
058593,000112:    5636           30002                           CA       Q                                     
058594,000113:    5637           55363                           TS       ALMCADR                               
058595,000114: 
058596,000115:    5640           50002                           INDEX    Q                                     
058597,000116:    5641           30000                           CAF      0                                     
058598,000117:    5642           05605                           TC       BORTENT                               
058599,000118:    5643           40400        OCT40400           OCT      40400                                 
058600,000119: 
058601,000120:    5644           00004                           INHINT                                         
058602,000121:    5645           34752        WHIMPER            CA       TWO                                   
058603,000122:    5646           60005                           AD       Z                                     

Page 1371

058605,000124:    5647           54017                           TS       BRUPT                                 
058606,000125:    5650           50017                           RESUME                                         
058607,000126:    5651           04635                           TC       POSTJUMP                              #  RESUME SENDS CONTROL HERE
058608,000127:    5652           12777                           CADR     ENEMA                                 
058609,000128:    5653           00004        POODOO             INHINT                                         
058610,000129:    5654           30002                           CA       Q                                     
058611,000130:    5655           55363        ABORT2             TS       ALMCADR                               
058612,000131:    5656           50002                           INDEX    Q                                     
058613,000132:    5657           30000                           CAF      0                                     
058614,000133:    5660           05605                           TC       BORTENT                               
058615,000134:    5661           77770        OCT77770           OCT      77770                                 #  DON'T MOVE
058616,000135: 
058617,000136:    5662           34765                           CAF      OCT35                                 #  4.35SPOT FOR GOPOODOO
058618,000137:    5663           54001                           TS       L                                     
058619,000138:    5664           40000                           COM                                            
058620,000139:    5665           52760                           DXCH     -PHASE4                               
058621,000140:    5666           00004        GOPOODOO           INHINT                                         
058622,000141:    5667           04616                           TC       BANKCALL                              #  RESET STATEFLG, REINTFLG, AND NODOFLAG.
058623,000142:    5670           27746                           CADR     FLAGS                                 
058624,000143:    5671           30103                           CA       FLAGWRD7                              #  IS SERVICER CURRENTLY IN OPERATION?
058625,000144:    5672           74746                           MASK     V37FLBIT                              
058626,000145:    5673           10000                           CCS      A                                     
058627,000146:    5674           15702                           TCF      STRTIDLE                              
058628,000147:    5675           04616                           TC       BANKCALL                              #  TERMINATE GRPS 1, 3, 5, AND 6
058629,000148:    5676           12664                           CADR     V37KLEAN                              
058630,000149:    5677           04616                           TC       BANKCALL                              #  TERMINATE GRPS 2, 4, 1, 3, 5, AND 6
058631,000150:    5700           12655                           CADR     MR.KLEAN                              #        (I.E., GRP 4 LAST)
058632,000151:    5701           15645                           TCF      WHIMPER                               
058633,000152:    5702           35744        STRTIDLE           CAF      BBSERVDL                              
058634,000153:    5703           04727                           TC       SUPERSW                               
058635,000154:    5704           04616                           TC       BANKCALL                              #  PUT SERVICER INTO ITS "GROUND" STATE
058636,000155:    5705           57326                           CADR     SERVIDLE                              #  AND PROCEED TO GOTOPOOH.
058637,000156:    5706           00004        CCSHOLE            INHINT                                         
058638,000157:    5707           30002                           CA       Q                                     
058639,000158:    5710           05655                           TC       ABORT2                                
058640,000159:    5711           21103        OCT21103           OCT      21103                                 
058641,000160:    5712           00004        CURTAINS           INHINT                                         
058642,000161:    5713           30002                           CA       Q                                     
058643,000162:    5714           05602                           TC       ALARM2                                
058644,000163:    5715           00217        OCT217             OCT      00217                                 
058645,000164:    5716           01363                           TC       ALMCADR                               #  RETURN TO USER
058646,000165: 
058647,000166:    5717           00004        BAILOUT1           INHINT                                         
058648,000167:    5720           53364                           DXCH     ALMCADR                               
058649,000168:    5721           35743                           CAF      ADR40400                              
058650,000169:    5722           54061        BOTHABRT           TS       ITEMP1                                
058651,000170:    5723           50002                           INDEX    Q                                     
058652,000171:    5724           30000                           CAF      0                                     
058653,000172:    5725           54001                           TS       L                                     
058654,000173:    5726           15614                           TCF      CHKFAIL1                              
058655,000174: 

Page 1372

058657,000176:    5727           00004        POODOO1            INHINT                                         
058658,000177:    5730           53364                           DXCH     ALMCADR                               
058659,000178:    5731           35742                           CAF      ADR77770                              
058660,000179:    5732           15722                           TCF      BOTHABRT                              
058661,000180: 
058662,000181:    5733           00004        ALARM1             INHINT                                         
058663,000182:    5734           53364                           DXCH     ALMCADR                               
058664,000183:    5735           00004        ALMNCADR           INHINT                                         
058665,000184:    5736           50002                           INDEX    Q                                     
058666,000185:    5737           30000                           CA       0                                     
058667,000186:    5740           54001                           TS       L                                     
058668,000187:    5741           15612                           TCF      LARMENT                               
058669,000188: 
058670,000189:    5742           15661        ADR77770           TCF      OCT77770                              
058671,000190:    5743           15643        ADR40400           TCF      OCT40400                              
058672,000191:    5744     5155               DOALARM            EQUALS   ENDOFJOB                              
058673,000192:    5744  E7,1515                                  EBANK=   DVCNTR                                
058674,000193:    5744           56067        BBSERVDL           BBCON    SERVIDLE                              
058675,000194:                                                                                                  #  CALLING SEQUENCE FOR VARALARM
058676,000195: 
058677,000196:                                                                                                  #                                                   CAF    (ALARM)
058678,000197:                                                                                                  #                                                   TC     VARALARM
058679,000198: 
058680,000199:                                                                                                  #  VARALARM TURNS ON PROGRAM ALARM LIGHT BUT DOES NOT DISPLAY
058681,000200:    5745           00004        VARALARM           INHINT                                         
058682,000201: 
058683,000202:    5746           54001                           TS       L                                     #  SAVE USERS ALARM CODE
058684,000203: 
058685,000204:    5747           30002                           CA       Q                                     #  SAVE USERS Q
058686,000205:    5750           55363                           TS       ALMCADR                               
058687,000206: 
058688,000207:    5751           05606                           TC       PRIOENT                               
058689,000208:    5752           00014        OCT14              OCT      14                                    #  DONT MOVE
058690,000209: 
058691,000210:    5753           01363                           TC       ALMCADR                               #  RETURN TO USER
058692,000211: 
058693,000212:    5754     5645               ABORT              EQUALS   WHIMPER                               
058694,000213: 13,3746                                           BANK     13                                    
058695,000214: 13,2000                                           SETLOC   ABTFLGS                               
058696,000215: 13,2000                                           BANK                                           
058697,000216: 13,3746                                           COUNT*   $$/ALARM                              
058698,000217: 
058699,000218: 13,3746           44747        FLAGS              CS       STATEBIT                              
058700,000219: 13,3747           70077                           MASK     FLAGWRD3                              
058701,000220: 13,3750           54077                           TS       FLAGWRD3                              
058702,000221: 13,3751           44745                           CS       REINTBIT                              
058703,000222: 13,3752           70106                           MASK     FLGWRD10                              
058704,000223: 13,3753           54106                           TS       FLGWRD10                              
058705,000224: 13,3754           44753                           CS       NODOBIT                               
058706,000225: 13,3755           70076                           MASK     FLAGWRD2                              

Page 1373

058708,000227: 13,3756           54076                           TS       FLAGWRD2                              
058709,000228: 13,3757           00002                           TC       Q                                     

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