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 '##'.

056355,000002:                                                                                                  ## Copyright:   Public domain.
056356,000003:                                                                                                  ## Filename:    KEYRUPT,_UPRUPT.agc
056357,000004:                                                                                                  ## Purpose:     A section of the reconstructed source code for Luminary 130.
056358,000005:                                                                                                  ##              This was the original program released for the Apollo 13 LM,
056359,000006:                                                                                                  ##              although several more revisions would follow. It has been
056360,000007:                                                                                                  ##              reconstructed from a listing of Luminary 131, from which it
056361,000008:                                                                                                  ##              differs on only two lines in P70-P71. The difference is
056362,000009:                                                                                                  ##              described in detail in Luminary memo #129, which was used
056363,000010:                                                                                                  ##              to perform the reconstruction. This file is intended to be a
056364,000011:                                                                                                  ##              faithful reconstruction, except that the code format has been
056365,000012:                                                                                                  ##              changed to conform to the requirements of the yaYUL assembler
056366,000013:                                                                                                  ##              rather than the original YUL assembler.
056367,000014:                                                                                                  ## Reference:   pp. 1330-1332
056368,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
056369,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
056370,000017:                                                                                                  ## Mod history: 06/06/03 RSB.   Began transcribing.
056371,000018:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
056372,000019:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
056373,000020:                                                                                                  ##                              original hardcopy, as opposed to the PDF page
056374,000021:                                                                                                  ##                              numbers in 1701.pdf.
056375,000022:                                                                                                  ##              2017-02-27 RSB  Proofed comment text using octopus/ProoferComments.
056376,000023:                                                                                                  ##              2017-03-13 RSB  Comment-text fixes noted in proofing Luminary 116.
056377,000024:                                                                                                  ##              2018-09-04 MAS  Copied from Luminary 131 for Luminary 130.
056378,000025:                                                                                                  ##              2021-05-30 ABS  UPCK -> UPOK
056379,000026:                                                                                                  ##                              Removed typo "- )" on empty line.
056380,000027: 

Page 1330

056382,000029: 14,3775                                           BANK     14                                    
056383,000030: 04,2000                                           SETLOC   KEYRUPT                               
056384,000031: 04,2000                                           BANK                                           
056385,000032: 04,3253                                           COUNT*   $$/KEYUP                              
056386,000033: 
056387,000034: 04,3253           54016        KEYRUPT1           TS       BANKRUPT                              
056388,000035: 04,3254           56002                           XCH      Q                                     
056389,000036: 04,3255           54012                           TS       QRUPT                                 
056390,000037: 04,3256           04400                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
056391,000038: 04,3257           34346                           CAF      LOW5                                  
056392,000039: 04,3260           00006                           EXTEND                                         
056393,000040: 04,3261           02015                           RAND     MNKEYIN                               #  CHECK IF KEYS 5M-1M ON
056394,000041: 04,3262           54073        KEYCOM             TS       RUPTREG4                              
056395,000042: 04,3263           40101                           CS       FLAGWRD5                              
056396,000043: 04,3264           74735                           MASK     DSKYFBIT                              
056397,000044: 04,3265           26101                           ADS      FLAGWRD5                              
056398,000045: 
056399,000046: 04,3266           34355        ACCEPTUP           CAF      CHRPRIO                               #  (NOTE: RUPTREG4 = KEYTEMP1)
056400,000047: 04,3267           05072                           TC       NOVAC                                 
056401,000048: 04,3270     0776                                  EBANK=   DSPCOUNT                              
056402,000049: 04,3270           02077 60101                     2CADR    CHARIN                                
056403,000050: 
056404,000051: 04,3272           30073                           CA       RUPTREG4                              
056405,000052: 04,3273           50064                           INDEX    LOCCTR                                
056406,000053: 04,3274           54154                           TS       MPAC                                  #  LEAVE 5 BIT KEY CDE IN MPAC FOR CHARIN
056407,000054: 04,3275           05270                           TC       RESUME                                
056408,000055: 

Page 1331

056410,000057:                                                                                                  #  UPRUPT PROGRAM
056411,000058: 
056412,000059: 04,3276           54016        UPRUPT             TS       BANKRUPT                              
056413,000060: 04,3277           56002                           XCH      Q                                     
056414,000061: 04,3300           54012                           TS       QRUPT                                 
056415,000062: 04,3301           04400                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
056416,000063: 04,3302           34755                           CAF      ZERO                                  
056417,000064: 04,3303           56045                           XCH      INLINK                                
056418,000065: 04,3304           54073                           TS       KEYTEMP1                              
056419,000066: 04,3305           34751                           CAF      BIT3                                  #  TURN ON UPACT LIGHT
056420,000067: 04,3306           00006                           EXTEND                                         #  (BIT 3 OF CHANNEL 11)
056421,000068: 04,3307           05011                           WOR      DSALMOUT                              
056422,000069: 04,3310           34346        UPRPT1             CAF      LOW5                                  #  TEST FOR TRIPLE CHAR REDUNDANCY
056423,000070: 04,3311           70073                           MASK     KEYTEMP1                              #  LOW5 OF WORD
056424,000071: 04,3312           56073                           XCH      KEYTEMP1                              #  LOW5 INTO KEYTEMP1
056425,000072: 04,3313           00006                           EXTEND                                         
056426,000073: 04,3314           74742                           MP       BIT10                                 #  SHIFT RIGHT 5
056427,000074: 04,3315           54332                           TS       KEYTEMP2                              
056428,000075: 04,3316           74346                           MASK     LOW5                                  #  MID 5
056429,000076: 04,3317           63353                           AD       HI10                                  
056430,000077: 04,3320           03350                           TC       UPTEST                                
056431,000078: 04,3321           34742                           CAF      BIT10                                 
056432,000079: 04,3322           00006                           EXTEND                                         
056433,000080: 04,3323           70332                           MP       KEYTEMP2                              #  SHIFT RIGHT 5
056434,000081: 04,3324           74346                           MASK     LOW5                                  #  HIGH 5
056435,000082: 04,3325           40000                           COM                                            
056436,000083: 04,3326           03350                           TC       UPTEST                                
056437,000084: 
056438,000085: 04,3327           43356        UPOK               CS       ELRCODE                               #  CODE IS GOOD.  IF CODE = 'ERROR RESET',
056439,000086: 04,3330           60073                           AD       KEYTEMP1                              #  CLEAR UPLOCKFL (SET BIT4 OF FLAGWRD7 = 0)
056440,000087: 04,3331           00006                           EXTEND                                         #  IF CODE DOES NOT = 'ERROR RESET', ACCEPT
056441,000088: 04,3332           13340                           BZF      CLUPLOCK                              #  CODE ONLY IF UPLOCKFL IS CLEAR (=0).
056442,000089: 
056443,000090: 04,3333           34750                           CAF      UPLOCBIT                              #  TEST UPLOCKFL FOR 0 OR 1
056444,000091: 04,3334           70103                           MASK     FLAGWRD7                              
056445,000092: 04,3335           10000                           CCS      A                                     
056446,000093: 04,3336           05270                           TC       RESUME                                #  UPLOCKFL = 1
056447,000094: 04,3337           03266                           TC       ACCEPTUP                              #  UPLOCKFL = 0
056448,000095: 
056449,000096: 04,3340           44750        CLUPLOCK           CS       UPLOCBIT                              #  CLEAR UPLOCKFL (I.E., SET BIT 4 OF )
056450,000097: 04,3341           70103                           MASK     FLAGWRD7                              #  FLAGWRD7 = 0)
056451,000098: 04,3342           54103                           TS       FLAGWRD7                              
056452,000099: 04,3343           03266                           TC       ACCEPTUP                              
056453,000100: 
056454,000101:                                                                                                  #  CODE IS BAD
056455,000102: 04,3344           40103        TMFAIL2            CS       FLAGWRD7                              #  LOCK OUT FURTHER UPLINK ACTIVITY
056456,000103: 04,3345           74750                           MASK     UPLOCBIT                              #  (BY SETTING UPLOCKFL = 1) UNTIL
056457,000104: 04,3346           26103                           ADS      FLAGWRD7                              #  'ERROR RESET' IS SENT VIA UPLINK.
056458,000105: 04,3347           05270                           TC       RESUME                                
056459,000106: 04,3350           60073        UPTEST             AD       KEYTEMP1                              

Page 1332

056461,000108: 04,3351           10000                           CCS      A                                     
056462,000109: 04,3352           03344                           TC       TMFAIL2                               
056463,000110: 04,3353           77740        HI10               OCT      77740                                 
056464,000111: 04,3354           03344                           TC       TMFAIL2                               
056465,000112: 04,3355           00002                           TC       Q                                     
056466,000113: 
056467,000114: 04,3356           00022        ELRCODE            OCT      22                                    
056468,000115: 
056469,000116:                                                                                                  #  'UPLINK ACTIVITY LIGHT' IS TURNED OFF BY .....
056470,000117:                                                                                                  #        1.      VBRELDSP
056471,000118:                                                                                                  #        2.      ERROR RESET
056472,000119:                                                                                                  #        3.      UPDATE PROGRAM (P27) ENTERED BY V70,V71,V72, AND V73.
056473,000120:                                                                                                  #                                      -
056474,000121:                                                                                                  #  THE RECEPTION OF A BAD CODE (I.E   CCC FAILURE) LOCKS OUT FURTHER UPLINK ACTIVITY BY SETTING BIT4 OF FLAGWRD7 = 1.
056475,000122:                                                                                                  #  THIS INDICATION WILL BE TRANSFERRED TO THE GROUND BY THE DOWNLINK WHICH DOWNLINKS ALL FLAGWORDS.
056476,000123:                                                                                                  #  WHEN UPLINK ACTIVITY IS LOCKED OUT, IT CAN BE ALLOWED WHEN THE GROUND UPLINKS AND 'ERROR RESET' CODE.
056477,000124:                                                                                                  #  (IT IS RECOMMENDED THAT THE 'ERROR LIGHT RESET' CODE IS PRECEEDED BY 16 BITS THE FIRST OF WHICH IS 1 FOLLOWED
056478,000125:                                                                                                  #  BY 15 ZEROES.  THIS WILL ELIMINATE EXTRANEOUS BITS FROM INLINK WHICH MAY HAVE BEEN LEFT OVER FROM THE ORIGINAL
056479,000126:                                                                                                  #  FAILURE)
056480,000127: 
056481,000128:                                                                                                  #  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