Source Code

This is a reconstructed version of Luminary 130, the initial AGC program released in November 1969 for the Apollo 13 LM. Three more releases followed before the flown revision was finally manufactured in February 1970.

This reconstruction was created from a previous transcription of the original listing of Luminary 131, combined with Luminary memo #129 which describes the small difference between the Luminary 130 and 131. The reconstructed source code was verified by matching memory-bank checksums to those listed for Luminary 130 in drawing 2021152G.

In this source code, program comments from the original (Luminary 131) code are prefixed with '#', while those added later by the Virtual AGC project are prefixed with '##'.

058187,000002:                                                                                                  ## Copyright:   Public domain.
058188,000003:                                                                                                  ## Filename:    ALARM_AND_ABORT.agc
058189,000004:                                                                                                  ## Purpose:     A section of the reconstructed source code for Luminary 130.
058190,000005:                                                                                                  ##              This was the original program released for the Apollo 13 LM,
058191,000006:                                                                                                  ##              although several more revisions would follow. It has been
058192,000007:                                                                                                  ##              reconstructed from a listing of Luminary 131, from which it
058193,000008:                                                                                                  ##              differs on only two lines in P70-P71. The difference is
058194,000009:                                                                                                  ##              described in detail in Luminary memo #129, which was used
058195,000010:                                                                                                  ##              to perform the reconstruction. This file is intended to be a
058196,000011:                                                                                                  ##              faithful reconstruction, except that the code format has been
058197,000012:                                                                                                  ##              changed to conform to the requirements of the yaYUL assembler
058198,000013:                                                                                                  ##              rather than the original YUL assembler.
058199,000014:                                                                                                  ## Reference:   pp. 1373-1377
058200,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
058201,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
058202,000017:                                                                                                  ## Mod history: 06/07/03 RSB.   Began transcribing.
058203,000018:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
058204,000019:                                                                                                  ##              2010-10-25 JL   Indentation fixes.
058205,000020:                                                                                                  ##              2011-06-07 JL   Removed workarounds.
058206,000021:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
058207,000022:                                                                                                  ##                              original hardcopy, as opposed to the PDF page
058208,000023:                                                                                                  ##                              numbers in 1701.pdf.
058209,000024:                                                                                                  ##              2017-02-28 RSB  Proofed comment text using octopus/ProoferComments.
058210,000025:                                                                                                  ##              2017-03-10 RSB  Comment-text fixes noted in proofing Luminary 116.
058211,000026:                                                                                                  ##              2018-09-04 MAS  Copied from Luminary 131 for Luminary 130.
058212,000027: 

Page 1373

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

Page 1374

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

Page 1375

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

Page 1376

058368,000183:    5716           00004        POODOO1            INHINT                                         
058369,000184:    5717           53364                           DXCH     ALMCADR                               
058370,000185:    5720           35731                           CAF      ADR77770                              
058371,000186:    5721           15711                           TCF      BOTHABRT                              
058372,000187: 
058373,000188:    5722           00004        ALARM1             INHINT                                         
058374,000189:    5723           53364                           DXCH     ALMCADR                               
058375,000190:    5724           00004        ALMNCADR           INHINT                                         
058376,000191:    5725           50002                           INDEX    Q                                     
058377,000192:    5726           30000                           CA       0                                     
058378,000193:    5727           54001                           TS       L                                     
058379,000194:    5730           15601                           TCF      LARMENT                               
058380,000195: 
058381,000196:    5731           15650        ADR77770           TCF      OCT77770                              
058382,000197:    5732           15632        ADR40400           TCF      OCT40400                              
058383,000198:    5733     5155               DOALARM            EQUALS   ENDOFJOB                              
058384,000199:    5733  E7,1515                                  EBANK=   DVCNTR                                
058385,000200:    5733           56067        BBSERVDL           BBCON    SERVIDLE                              
058386,000201: 
058387,000202:                                                                                                  #  CALLING SEQUENCE FOR VARALARM
058388,000203:                                                                                                  #                CAF     (ALARM)
058389,000204:                                                                                                  #                TC      VARALARM
058390,000205: 
058391,000206:                                                                                                  #  VARALARM TURNS ON PROGRAM ALARM LIGHT BUT DOES NOT DISPLAY
058392,000207: 
058393,000208:    5734           00004        VARALARM           INHINT                                         
058394,000209: 
058395,000210:    5735           54001                           TS       L                                     #  SAVE USERS ALARM CODE
058396,000211: 
058397,000212:    5736           30002                           CA       Q                                     #  SAVE USERS Q
058398,000213:    5737           55363                           TS       ALMCADR                               
058399,000214: 
058400,000215:    5740           05575                           TC       PRIOENT                               
058401,000216:    5741           00014        OCT14              OCT      14                                    #  DONT MOVE
058402,000217: 
058403,000218:    5742           01363                           TC       ALMCADR                               #  RETURN TO USER
058404,000219: 
058405,000220:    5743     5634               ABORT              EQUALS   WHIMPER                               
058406,000221: 13,3746                                           BANK     13                                    
058407,000222: 13,2000                                           SETLOC   ABTFLGS                               
058408,000223: 13,2000                                           BANK                                           
058409,000224: 13,3746                                           COUNT*   $$/ALARM                              
058410,000225: 
058411,000226: 13,3746           44747        FLAGS              CS       STATEBIT                              
058412,000227: 13,3747           70077                           MASK     FLAGWRD3                              
058413,000228: 13,3750           54077                           TS       FLAGWRD3                              
058414,000229: 13,3751           44745                           CS       REINTBIT                              
058415,000230: 13,3752           70106                           MASK     FLGWRD10                              
058416,000231: 13,3753           54106                           TS       FLGWRD10                              
058417,000232: 13,3754           44753                           CS       NODOBIT                               
058418,000233: 13,3755           70076                           MASK     FLAGWRD2                              
058419,000234: 

Page 1377

058421,000236: 13,3756           54076                           TS       FLAGWRD2                              
058422,000237: 13,3757           00002                           TC       Q                                     
058423,000238: 
058424,000239: 

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