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.

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

Page 1335

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

Page 1336

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

Page 1337

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