Source Code

These source-code files derive from a printout of Luminary 116 (the Apollo 12 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Ron Burkey, and transcribed to source code by a team of volunteers. This colorized, syntax-highlighted form was created by assembling that transcribed source code. Note that the full page images are available on the Virtual AGC project page at archive.org, while reduced-size images are presented at the VirtualAGC project website. Report or fix any transcription errors at the Virtual AGC project code repository.

Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 116 OF AGC PROGRAM LUMINARY BY NASA 2021112-071
	19:09 AUG. 11,1969
Note that the date is the date of the printout, not the date of the program revision.

058192,000002:                                                                                                  ## Copyright:   Public domain.
058193,000003:                                                                                                  ## Filename:    ALARM_AND_ABORT.agc
058194,000004:                                                                                                  ## Purpose:     A section of Luminary revision 116.
058195,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM) 
058196,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 12.
058197,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
058198,000008:                                                                                                  ##              that the code format has been changed to conform to the
058199,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
058200,000010:                                                                                                  ##              original YUL assembler.
058201,000011:                                                                                                  ## Reference:   pp. 1371-1375
058202,000012:                                                                                                  ## Assembler:   yaYUL
058203,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
058204,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
058205,000015:                                                                                                  ## Mod history: 2017-01-22 MAS  Created from Luminary 99.
058206,000016:                                                                                                  ##              2017-02-03 RRB  Updated for Luminary 116.
058207,000017:                                                                                                  ##              2017-03-01 HG   Fix Page number 
058208,000018:                                                                                                  ##                              Fix operand      : -> L
058209,000019:                                                                                                  ##                                  operator  LXCH -> TS
058210,000020:                                                                                                  ##              2017-03-10 RSB  Proofed comment text via 3-way diff vs
058211,000021:                                                                                                  ##                              Luminary 99 and 132 ... no problems found.
058212,000022: 

Page 1371

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

Page 1372

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

Page 1373

058317,000127:    5636           54017                           TS       BRUPT                                 
058318,000128:    5637           50017                           RESUME                                         

The command RESUME is circled in red ink - RRB 2017

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

Page 1374

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

Page 1375

058421,000231: 13,3760           54076                           TS       FLAGWRD2                              
058422,000232: 13,3761           00002                           TC       Q                                     
058423,000233: 

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