Source Code

These source-code files are part of a reconstructed copy of Comanche 45, the second release, though not the final mission release, of the Apollo 10 Command Module (CM) Apollo Guidance Computer (AGC) software. Comanche 45 was preceded by Comanche 44 and followed by Comanche 45/2 (the flown release). The reconstruction is believed to be exactly accurate, but in the absence of an actual Apollo-era listing of Comanche 45, some explanation of the reconstruction process is needed to insure confidence in that accuracy.

The starting point was the source code of Comanche 44 (itself previously accurately reconstructed). Comanche 44 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 44 and 45. The now-reconstructed Comanche 45 source code was verified by assembling it and checking that the assembled code had the expected known-correct memory-bank checksums. Note that page numbers in the reconstructed code tend to match those in the Comanche 55, the most-similar revision of Comanche for which we have access to an actual non-reconstructed hardcopy; the source code would likely have different page numbers in a contemporary Comanche 45 listing.

Annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change relative to Comanche 44. Here's a guide to the Apollo documentation referenced in those annotations:
There is also a detailed commentary about the reconstruction process.

Comments expected to have been present in the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC Project's GitHub repository.

061472,000002:                                                                                                  ## Copyright:   Public domain.
061473,000003:                                                                                                  ## Filename:    KEYRUPT,_UPRUPT.agc
061474,000004:                                                                                                  ## Purpose:     A section of Comanche revision 045.
061475,000005:                                                                                                  ##              It is part of the reconstructed source code for the
061476,000006:                                                                                                  ##              second release of the flight software for the Command
061477,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
061478,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
061479,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
061480,000010:                                                                                                  ##              exactly match those specified for Comanche 45 in NASA drawing
061481,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
061482,000012:                                                                                                  ##              reconstruction is correct.
061483,000013:                                                                                                  ## Assembler:   yaYUL
061484,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
061485,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
061486,000016:                                                                                                  ## Mod history: 2020-12-06 MAS  Created from Comanche 44.
061487,000017: 

Page 1449

061489,000019: 14,3762                                           BANK     14                                    
061490,000020: 07,2000                                           SETLOC   KEYRUPT                               
061491,000021: 07,2000                                           BANK                                           
061492,000022: 07,3673                                           COUNT*   $$/KEYUP                              
061493,000023: 
061494,000024: 07,3673           54016        KEYRUPT1           TS       BANKRUPT                              
061495,000025: 07,3674           56002                           XCH      Q                                     
061496,000026: 07,3675           54012                           TS       QRUPT                                 
061497,000027: 07,3676           04414                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
061498,000028: 07,3677           34362                           CAF      LOW5                                  
061499,000029: 07,3700           00006                           EXTEND                                         
061500,000030: 07,3701           02015                           RAND     MNKEYIN                               #  CHECK IF KEYS 5M-1M ON
061501,000031: 07,3702           54073        KEYCOM             TS       RUPTREG4                              
061502,000032: 07,3703           40101                           CS       FLAGWRD5                              
061503,000033: 07,3704           75001                           MASK     BIT15                                 
061504,000034: 07,3705           26101                           ADS      FLAGWRD5                              
061505,000035: 
061506,000036: 07,3706           34371        ACCEPTUP           CAF      CHRPRIO                               #  (NOTE: RUPTREG4 = KEYTEMP1)
061507,000037: 07,3707           05134                           TC       NOVAC                                 
061508,000038: 07,3710     0777                                  EBANK=   DSPCOUNT                              
061509,000039: 07,3710           02000 60101                     2CADR    CHARIN                                
061510,000040: 
061511,000041: 07,3712           30073                           CA       RUPTREG4                              
061512,000042: 07,3713           50064                           INDEX    LOCCTR                                
061513,000043: 07,3714           54154                           TS       MPAC                                  #  LEAVE 5 BIT KEY CDE IN MPAC FOR CHARIN
061514,000044: 07,3715           05333                           TC       RESUME                                
061515,000045: 

Page 1450

061517,000047:                                                                                                  #  UPRUPT PROGRAM
061518,000048: 
061519,000049: 07,3716           54016        UPRUPT             TS       BANKRUPT                              
061520,000050: 07,3717           56002                           XCH      Q                                     
061521,000051: 07,3720           54012                           TS       QRUPT                                 
061522,000052: 07,3721           04414                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
061523,000053: 07,3722           35021                           CAF      ZERO                                  
061524,000054: 07,3723           56045                           XCH      INLINK                                
061525,000055: 07,3724           54073                           TS       KEYTEMP1                              
061526,000056: 07,3725           35015                           CAF      BIT3                                  #  TURN ON UPACT LIGHT
061527,000057: 07,3726           00006                           EXTEND                                         #  (BIT 3 OF CHANNEL 11)
061528,000058: 07,3727           05011                           WOR      DSALMOUT                              
061529,000059: 07,3730           34362        UPRPT1             CAF      LOW5                                  #  TEST FOR TRIPLE CHAR REDUNDANCY
061530,000060: 07,3731           70073                           MASK     KEYTEMP1                              #  LOW5 OF WORD
061531,000061: 07,3732           56073                           XCH      KEYTEMP1                              #  LOW5 INTO KEYTEMP1
061532,000062: 07,3733           00006                           EXTEND                                         
061533,000063: 07,3734           75006                           MP       BIT10                                 #  SHIFT RIGHT 5
061534,000064: 07,3735           54734                           TS       KEYTEMP2                              
061535,000065: 07,3736           74362                           MASK     LOW5                                  #  MID 5
061536,000066: 07,3737           63773                           AD       HI10                                  
061537,000067: 07,3740           03770                           TC       UPTEST                                
061538,000068: 07,3741           35006                           CAF      BIT10                                 
061539,000069: 07,3742           00006                           EXTEND                                         
061540,000070: 07,3743           70734                           MP       KEYTEMP2                              #  SHIFT RIGHT 5
061541,000071: 07,3744           74362                           MASK     LOW5                                  #  HIGH 5
061542,000072: 07,3745           40000                           COM                                            
061543,000073: 07,3746           03770                           TC       UPTEST                                
061544,000074: 
061545,000075: 07,3747           43776        UPOK               CS       ELRCODE                               #  CODE IS GOOD.  IF CODE = 'ERROR RESET',
061546,000076: 07,3750           60073                           AD       KEYTEMP1                              #  CLEAR UPLOCKFL (SET BIT4 OF FLAGWRD7 = 0)
061547,000077: 07,3751           00006                           EXTEND                                         #  IF CODE DOES NOT = 'ERROR RESET', ACCEPT
061548,000078: 07,3752           13760                           BZF      CLUPLOCK                              #  CODE ONLY IF UPLOCKFL IS CLEAR (=0).
061549,000079: 
061550,000080: 07,3753           35014                           CAF      BIT4                                  #  TEST UPLOCKFL FOR 0 OR 1.
061551,000081: 07,3754           70103                           MASK     FLAGWRD7                              
061552,000082: 07,3755           10000                           CCS      A                                     
061553,000083: 07,3756           05333                           TC       RESUME                                #  UPLOCKFL = 1
061554,000084: 07,3757           03706                           TC       ACCEPTUP                              #  UPLOCKFL = 0
061555,000085: 
061556,000086: 07,3760           45014        CLUPLOCK           CS       BIT4                                  #  CLEAR UPLOCKFL (I.E., SET BIT 4 OF
061557,000087: 07,3761           70103                           MASK     FLAGWRD7                              #  FLAGWRD7 = 0)
061558,000088: 07,3762           54103                           TS       FLAGWRD7                              
061559,000089: 07,3763           03706                           TC       ACCEPTUP                              
061560,000090: 
061561,000091:                                                                                                  #  CODE IS BAD
061562,000092: 07,3764           40103        TMFAIL2            CS       FLAGWRD7                              #  LOCK OUT FURTHER UPLINK ACTIVITY
061563,000093: 07,3765           75014                           MASK     BIT4                                  #  (BY SETTING UPLOCKFL = 1) UNTIL
061564,000094: 07,3766           26103                           ADS      FLAGWRD7                              #  'ERROR RESET' IS SENT VIA UPLINK.
061565,000095: 07,3767           05333                           TC       RESUME                                
061566,000096: 07,3770           60073        UPTEST             AD       KEYTEMP1                              

Page 1451

061568,000098: 07,3771           10000                           CCS      A                                     
061569,000099: 07,3772           03764                           TC       TMFAIL2                               
061570,000100: 07,3773           77740        HI10               OCT      77740                                 
061571,000101: 07,3774           03764                           TC       TMFAIL2                               
061572,000102: 07,3775           00002                           TC       Q                                     
061573,000103: 
061574,000104: 07,3776           00022        ELRCODE            OCT      22                                    
061575,000105: 
061576,000106:                                                                                                  #  'UPLINK ACTIVITY LIGHT' IS TURNED OFF BY .....
061577,000107:                                                                                                  #        1.      VBRELDSP
061578,000108:                                                                                                  #        2.      ERROR RESET
061579,000109:                                                                                                  #        3.      UPDATE PROGRAM (P27) ENTERED BY V70,V71,V72, AND V73.
061580,000110: 
061581,000111:                                                                                                  #                                     -
061582,000112:                                                                                                  #  THE RECEPTION OF A BAD CODE (I.E  CCC FAILURE) LOCKS OUT FURTHER UPLINK ACTIVITY BY SETTING BIT4 OF FLAGWRD7 = 1.
061583,000113:                                                                                                  #  THIS INDICATION WILL BE TRANSFERRED TO THE GROUND BY THE DOWNLINK WHICH DOWNLINKS ALL FLAGWORDS.
061584,000114:                                                                                                  #  WHEN UPLINK ACTIVITY IS LOCKED OUT, IT CAN BE ALLOWED WHEN THE GROUND UPLINKS AND 'ERROR RESET' CODE.
061585,000115:                                                                                                  #  (IT IS RECOMMENDED THAT THE 'ERROR LIGHT RESET' CODE IS PRECEEDED BY 16 BITS THE FIRST OF WHICH IS 1 FOLLOWED
061586,000116:                                                                                                  #  BY 15 ZEROES.  THIS WILL ELIMINATE EXTRANEOUS BITS FROM INLINK WHICH MAY HAVE BEEN LEFT OVER FROM THE ORIGINAL
061587,000117:                                                                                                  #  FAILURE)
061588,000118: 
061589,000119:                                                                                                  #  UPLINK ACTIVITY IS ALSO ALLOWED (UNLOCKED) DURING FRESH START WHEN FRESH START SETS BIT4 OF FLAGWRD7 = 0.
061590,000120: 
061591,000121: 

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