Source Code

These source-code files derive from a printout of Luminary 210 (Apollo 15-17 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Jim Lawton, 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 210 OF AGC PROGRAM LUMINARY 
	BY NASA 2021112-161 17:11 MAR. 19,1971
Note that the date is the date of the printout, not the date of the program revision.

057629,000002:                                                                                                  ## Copyright:   Public domain.
057630,000003:                                                                                                  ## Filename:    KEYRUPT,_UPRUPT.agc
057631,000004:                                                                                                  ## Purpose:     A section of Luminary revision 210.
057632,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
057633,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 15-17.
057634,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
057635,000008:                                                                                                  ##              that the code format has been changed to conform to the
057636,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
057637,000010:                                                                                                  ##              original YUL assembler.
057638,000011:                                                                                                  ## Reference:   pp. 1335 - 1337
057639,000012:                                                                                                  ## Assembler:   yaYUL
057640,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
057641,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
057642,000015:                                                                                                  ## Mod history: 2016-11-17 JL   Created from Luminary131 version.
057643,000016:                                                                                                  ##              2016-11-23 AS   Transcribed
057644,000017:                                                                                                  ##              2016-11-27 HG   fix opcode  CSS   ->  CCS
057645,000018:                                                                                                  ##                                  operand lOW5  ->  LOW5 
057646,000019:                                                                                                  ##              2016-12-26 RSB  Comment-text proofed using ProoferComments
057647,000020:                                                                                                  ##                              and corrected errors found.
057648,000021:                                                                                                  ##              2017-03-13 RSB  Comment-text fixes noted in proofing Luminary 116.
057649,000022: 

Page 1335

057651,000024: 
057652,000025: 14,3765                                           BANK     14                                    
057653,000026: 04,2000                                           SETLOC   KEYRUPT                               
057654,000027: 04,2000                                           BANK                                           
057655,000028: 04,3257                                           COUNT*   $$/KEYUP                              
057656,000029: 
057657,000030: 04,3257           54016        KEYRUPT1           TS       BANKRUPT                              
057658,000031: 04,3260           56002                           XCH      Q                                     
057659,000032: 04,3261           54012                           TS       QRUPT                                 
057660,000033: 04,3262           04371                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
057661,000034: 04,3263           34337                           CAF      LOW5                                  
057662,000035: 04,3264           00006                           EXTEND                                         
057663,000036: 04,3265           02015                           RAND     MNKEYIN                               #  CHECK IF KEYS 5M-1M ON
057664,000037: 04,3266           54073        KEYCOM             TS       RUPTREG4                              
057665,000038: 04,3267           40101                           CS       FLAGWRD5                              
057666,000039: 04,3270           74726                           MASK     DSKYFBIT                              
057667,000040: 04,3271           26101                           ADS      FLAGWRD5                              
057668,000041: 
057669,000042: 04,3272           34346        ACCEPTUP           CAF      CHRPRIO                               #  (NOTE: RUPTREG4 = KEYTEMP1)
057670,000043: 04,3273           05063                           TC       NOVAC                                 
057671,000044: 04,3274     0776                                  EBANK=   DSPCOUNT                              
057672,000045: 04,3274           02057 60101                     2CADR    CHARIN                                
057673,000046: 
057674,000047: 04,3276           30073                           CA       RUPTREG4                              
057675,000048: 04,3277           50064                           INDEX    LOCCTR                                
057676,000049: 04,3300           54154                           TS       MPAC                                  #  LEAVE 5 BIT KEY CDE IN MPAC FOR CHARIN
057677,000050: 04,3301           05272                           TC       RESUME                                
057678,000051: 

Page 1336

057680,000053:                                                                                                  #  UPRUPT PROGRAM
057681,000054: 
057682,000055: 04,3302           54016        UPRUPT             TS       BANKRUPT                              
057683,000056: 04,3303           56002                           XCH      Q                                     
057684,000057: 04,3304           54012                           TS       QRUPT                                 
057685,000058: 04,3305           04371                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
057686,000059: 04,3306           34746                           CAF      ZERO                                  
057687,000060: 04,3307           56045                           XCH      INLINK                                
057688,000061: 04,3310           54073                           TS       KEYTEMP1                              
057689,000062: 04,3311           30077                           CA       FLAGWRD3                              #  AFTER EARTH LAUNCH?
057690,000063: 04,3312           74732                           MASK     NOP07BIT                              
057691,000064: 04,3313           10000                           CCS      A                                     
057692,000065: 04,3314           13320                           TCF      UPRPT1                                #  YES
057693,000066: 04,3315           30073                           CA       KEYTEMP1                              #  NO: SUM UPLINK DATA
057694,000067: 04,3316           27245                           ADS      UPSUM                                 
057695,000068: 04,3317           25246                           INCR     UPSUM      +1                         
057696,000069: 04,3320           34742        UPRPT1             CAF      BIT3                                  #  TURN ON UPACT LIGHT
057697,000070: 04,3321           00006                           EXTEND                                         #  (BIT 3 OF CHANNEL 11)
057698,000071: 04,3322           05011                           WOR      DSALMOUT                              
057699,000072: 04,3323           34337                           CAF      LOW5                                  #  TEST FOR TRIPLE CHAR REDUNDANCY
057700,000073: 04,3324           70073                           MASK     KEYTEMP1                              #  LOW5 OF WORD
057701,000074: 04,3325           56073                           XCH      KEYTEMP1                              #  LOW5 INTO KEYTEMP1
057702,000075: 04,3326           00006                           EXTEND                                         
057703,000076: 04,3327           74733                           MP       BIT10                                 #  SHIFT RIGHT 5
057704,000077: 04,3330           54332                           TS       KEYTEMP2                              
057705,000078: 04,3331           74337                           MASK     LOW5                                  #  MID 5
057706,000079: 04,3332           63366                           AD       HI10                                  
057707,000080: 04,3333           03363                           TC       UPTEST                                
057708,000081: 04,3334           34733                           CAF      BIT10                                 
057709,000082: 04,3335           00006                           EXTEND                                         
057710,000083: 04,3336           70332                           MP       KEYTEMP2                              #  SHIFT RIGHT 5
057711,000084: 04,3337           74337                           MASK     LOW5                                  #  HIGH 5
057712,000085: 04,3340           40000                           COM                                            
057713,000086: 04,3341           03363                           TC       UPTEST                                
057714,000087: 
057715,000088: 04,3342           43371        UPOK               CS       ELRCODE                               #  CODE IS GOOD.  IF CODE = 'ERROR RESET',
057716,000089: 04,3343           60073                           AD       KEYTEMP1                              #  CLEAR UPLOCKFL(SET BIT4 OF FLAGWRD7 = 0)
057717,000090: 04,3344           00006                           EXTEND                                         #  IF CODE DOES NOT = 'ERROR RESET', ACCEPT
057718,000091: 04,3345           13353                           BZF      CLUPLOCK                              #  CODE ONLY IF UPLOCKFL IS CLEAR (=0).
057719,000092: 
057720,000093: 04,3346           34741                           CAF      UPLOCBIT                              #  TEST UPLOCKFL FOR 0 OR 1
057721,000094: 04,3347           70103                           MASK     FLAGWRD7                              
057722,000095: 04,3350           10000                           CCS      A                                     
057723,000096: 04,3351           05272                           TC       RESUME                                #  UPLOCKFL = 1
057724,000097: 04,3352           03272                           TC       ACCEPTUP                              #  UPLOCKFL = 0
057725,000098: 
057726,000099: 04,3353           44741        CLUPLOCK           CS       UPLOCBIT                              #  CLEAR UPLOCKFL (I.E., SET BIT 4 OF )
057727,000100: 04,3354           70103                           MASK     FLAGWRD7                              #  FLAGWRD7 = 0)
057728,000101: 04,3355           54103                           TS       FLAGWRD7                              
057729,000102: 04,3356           03272                           TC       ACCEPTUP                              
057730,000103: 

Page 1337

057732,000105:                                                                                                  #  CODE IS BAD
057733,000106: 04,3357           40103        TMFAIL2            CS       FLAGWRD7                              #  LOCK OUT FURTHER UPLINK ACTIVITY
057734,000107: 04,3360           74741                           MASK     UPLOCBIT                              #  (BY SETTING UPLOCKFL = 1) UNTIL
057735,000108: 04,3361           26103                           ADS      FLAGWRD7                              #  'ERROR RESET' IS SENT VIA UPLINK.
057736,000109: 04,3362           05272                           TC       RESUME                                
057737,000110: 04,3363           60073        UPTEST             AD       KEYTEMP1                              
057738,000111: 04,3364           10000                           CCS      A                                     
057739,000112: 04,3365           03357                           TC       TMFAIL2                               
057740,000113: 04,3366           77740        HI10               OCT      77740                                 
057741,000114: 04,3367           03357                           TC       TMFAIL2                               
057742,000115: 04,3370           00002                           TC       Q                                     
057743,000116: 
057744,000117: 04,3371           00022        ELRCODE            OCT      22                                    
057745,000118: 
057746,000119:                                                                                                  #  'UPLINK ACTIVITY LIGHT' IS TURNED OFF BY .....
057747,000120:                                                                                                  #        1.      VBRELDSP
057748,000121:                                                                                                  #        2.      ERROR RESET
057749,000122:                                                                                                  #        3.      UPDATE PROGRAM(P27) ENTERED BY V70,V71,V72,AND V73.
057750,000123:                                                                                                  #                                   -
057751,000124:                                                                                                  #  THE RECEPTION OF A BAD CODE(I.E CCC FAILURE) LOCKS OUT FURTHER UPLINK ACTIVITY BY SETTING BIT4 OF FLAGWRD7 = 1.
057752,000125:                                                                                                  #  THIS INDICATION WILL BE TRANSFERRED TO THE GROUND BY THE DOWNLINK WHICH DOWNLINKS ALL FLAGWORDS.
057753,000126:                                                                                                  #  WHEN UPLINK ACTIVITY IS LOCKED OUT ,IT CAN BE ALLOWED WHEN THE GROUND UPLINKS AND 'ERROR RESET' CODE.
057754,000127:                                                                                                  #  (IT IS RECOMMENDED THAT THE 'ERROR LIGHT RESET' CODE IS PRECEEDED BY 16 BITS THE FIRST OF WHICH IS 1 FOLLOWED
057755,000128:                                                                                                  #  BY 15 ZEROES. THIS WILL ELIMINATE EXTRANEOUS BITS FROM INLINK WHICH MAY HAVE BEEN LEFT OVER FROM THE ORIGINAL
057756,000129:                                                                                                  #  FAILURE)
057757,000130: 
057758,000131:                                                                                                  #  UPLINK ACTIVITY IS ALSO ALLOWED(UNLOCKED) DURING FRESH START WHEN FRESH START SETS BIT4 OF FLAGWRD7 = 0.

End of include-file KEYRUPT,_UPRUPT.agc.  Parent file is MAIN.agc