Source Code

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

The starting point was the source code of Comanche 51 (separately previously reconstructed from an Apollo-era listing of Comanche 55, flown on Apollo 11). Comanche 51 source code was then modified by undoing changes known to have been made between revisions 44 and 51. The now-reconstructed Comanche 44 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 match those on the Comanche 55 printout, although the source code would likely have different page numbers in a contemporary Comanche 44 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 51. Here's a guide to the Apollo documentation referenced in those annotations:
In most cases, only the titles (rather than the full texts) of PCRs are known. In addition to the explanatory annotations, there is also a step-by-step 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.

061993,000002:                                                                                                  ## Copyright:   Public domain.
061994,000003:                                                                                                  ## Filename:    KEYRUPT,_UPRUPT.agc
061995,000004:                                                                                                  ## Purpose:     A section of Comanche revision 044.
061996,000005:                                                                                                  ##              It is part of the reconstructed source code for the
061997,000006:                                                                                                  ##              original release of the flight software for the Command
061998,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
061999,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
062000,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
062001,000010:                                                                                                  ##              exactly match those specified for Comanche 44 in NASA drawing
062002,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
062003,000012:                                                                                                  ##              reconstruction is correct.
062004,000013:                                                                                                  ## Assembler:   yaYUL
062005,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
062006,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
062007,000016:                                                                                                  ## Mod history: 2020-12-03 MAS  Created from Comanche 51.
062008,000017: 

Page 1449

062010,000019: 14,3762                                           BANK     14                                    
062011,000020: 07,2000                                           SETLOC   KEYRUPT                               
062012,000021: 07,2000                                           BANK                                           
062013,000022: 07,3673                                           COUNT*   $$/KEYUP                              
062014,000023: 
062015,000024: 07,3673           54016        KEYRUPT1           TS       BANKRUPT                              
062016,000025: 07,3674           56002                           XCH      Q                                     
062017,000026: 07,3675           54012                           TS       QRUPT                                 
062018,000027: 07,3676           04414                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
062019,000028: 07,3677           34362                           CAF      LOW5                                  
062020,000029: 07,3700           00006                           EXTEND                                         
062021,000030: 07,3701           02015                           RAND     MNKEYIN                               #  CHECK IF KEYS 5M-1M ON
062022,000031: 07,3702           54073        KEYCOM             TS       RUPTREG4                              
062023,000032: 07,3703           40101                           CS       FLAGWRD5                              
062024,000033: 07,3704           75001                           MASK     BIT15                                 
062025,000034: 07,3705           26101                           ADS      FLAGWRD5                              
062026,000035: 
062027,000036: 07,3706           34371        ACCEPTUP           CAF      CHRPRIO                               #  (NOTE: RUPTREG4 = KEYTEMP1)
062028,000037: 07,3707           05134                           TC       NOVAC                                 
062029,000038: 07,3710     0777                                  EBANK=   DSPCOUNT                              
062030,000039: 07,3710           02000 60101                     2CADR    CHARIN                                
062031,000040: 
062032,000041: 07,3712           30073                           CA       RUPTREG4                              
062033,000042: 07,3713           50064                           INDEX    LOCCTR                                
062034,000043: 07,3714           54154                           TS       MPAC                                  #  LEAVE 5 BIT KEY CDE IN MPAC FOR CHARIN
062035,000044: 07,3715           05333                           TC       RESUME                                
062036,000045: 

Page 1450

062038,000047:                                                                                                  #  UPRUPT PROGRAM
062039,000048: 
062040,000049: 07,3716           54016        UPRUPT             TS       BANKRUPT                              
062041,000050: 07,3717           56002                           XCH      Q                                     
062042,000051: 07,3720           54012                           TS       QRUPT                                 
062043,000052: 07,3721           04414                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
062044,000053: 07,3722           35021                           CAF      ZERO                                  
062045,000054: 07,3723           56045                           XCH      INLINK                                
062046,000055: 07,3724           54073                           TS       KEYTEMP1                              
062047,000056: 07,3725           35015                           CAF      BIT3                                  #  TURN ON UPACT LIGHT
062048,000057: 07,3726           00006                           EXTEND                                         #  (BIT 3 OF CHANNEL 11)
062049,000058: 07,3727           05011                           WOR      DSALMOUT                              
062050,000059: 07,3730           34362        UPRPT1             CAF      LOW5                                  #  TEST FOR TRIPLE CHAR REDUNDANCY
062051,000060: 07,3731           70073                           MASK     KEYTEMP1                              #  LOW5 OF WORD
062052,000061: 07,3732           56073                           XCH      KEYTEMP1                              #  LOW5 INTO KEYTEMP1
062053,000062: 07,3733           00006                           EXTEND                                         
062054,000063: 07,3734           75006                           MP       BIT10                                 #  SHIFT RIGHT 5
062055,000064: 07,3735           54734                           TS       KEYTEMP2                              
062056,000065: 07,3736           74362                           MASK     LOW5                                  #  MID 5
062057,000066: 07,3737           63773                           AD       HI10                                  
062058,000067: 07,3740           03770                           TC       UPTEST                                
062059,000068: 07,3741           35006                           CAF      BIT10                                 
062060,000069: 07,3742           00006                           EXTEND                                         
062061,000070: 07,3743           70734                           MP       KEYTEMP2                              #  SHIFT RIGHT 5
062062,000071: 07,3744           74362                           MASK     LOW5                                  #  HIGH 5
062063,000072: 07,3745           40000                           COM                                            
062064,000073: 07,3746           03770                           TC       UPTEST                                
062065,000074: 
062066,000075: 07,3747           43776        UPOK               CS       ELRCODE                               #  CODE IS GOOD.  IF CODE = 'ERROR RESET',
062067,000076: 07,3750           60073                           AD       KEYTEMP1                              #  CLEAR UPLOCKFL (SET BIT4 OF FLAGWRD7 = 0)
062068,000077: 07,3751           00006                           EXTEND                                         #  IF CODE DOES NOT = 'ERROR RESET', ACCEPT
062069,000078: 07,3752           13760                           BZF      CLUPLOCK                              #  CODE ONLY IF UPLOCKFL IS CLEAR (=0).
062070,000079: 
062071,000080: 07,3753           35014                           CAF      BIT4                                  #  TEST UPLOCKFL FOR 0 OR 1.
062072,000081: 07,3754           70103                           MASK     FLAGWRD7                              
062073,000082: 07,3755           10000                           CCS      A                                     
062074,000083: 07,3756           05333                           TC       RESUME                                #  UPLOCKFL = 1
062075,000084: 07,3757           03706                           TC       ACCEPTUP                              #  UPLOCKFL = 0
062076,000085: 
062077,000086: 07,3760           45014        CLUPLOCK           CS       BIT4                                  #  CLEAR UPLOCKFL (I.E., SET BIT 4 OF
062078,000087: 07,3761           70103                           MASK     FLAGWRD7                              #  FLAGWRD7 = 0)
062079,000088: 07,3762           54103                           TS       FLAGWRD7                              
062080,000089: 07,3763           03706                           TC       ACCEPTUP                              
062081,000090: 
062082,000091:                                                                                                  #  CODE IS BAD
062083,000092: 07,3764           40103        TMFAIL2            CS       FLAGWRD7                              #  LOCK OUT FURTHER UPLINK ACTIVITY
062084,000093: 07,3765           75014                           MASK     BIT4                                  #  (BY SETTING UPLOCKFL = 1) UNTIL
062085,000094: 07,3766           26103                           ADS      FLAGWRD7                              #  'ERROR RESET' IS SENT VIA UPLINK.
062086,000095: 07,3767           05333                           TC       RESUME                                
062087,000096: 07,3770           60073        UPTEST             AD       KEYTEMP1                              

Page 1451

062089,000098: 07,3771           10000                           CCS      A                                     
062090,000099: 07,3772           03764                           TC       TMFAIL2                               
062091,000100: 07,3773           77740        HI10               OCT      77740                                 
062092,000101: 07,3774           03764                           TC       TMFAIL2                               
062093,000102: 07,3775           00002                           TC       Q                                     
062094,000103: 
062095,000104: 07,3776           00022        ELRCODE            OCT      22                                    
062096,000105: 
062097,000106:                                                                                                  #  'UPLINK ACTIVITY LIGHT' IS TURNED OFF BY .....
062098,000107:                                                                                                  #        1.      VBRELDSP
062099,000108:                                                                                                  #        2.      ERROR RESET
062100,000109:                                                                                                  #        3.      UPDATE PROGRAM (P27) ENTERED BY V70,V71,V72, AND V73.
062101,000110: 
062102,000111:                                                                                                  #                                     -
062103,000112:                                                                                                  #  THE RECEPTION OF A BAD CODE (I.E  CCC FAILURE) LOCKS OUT FURTHER UPLINK ACTIVITY BY SETTING BIT4 OF FLAGWRD7 = 1.
062104,000113:                                                                                                  #  THIS INDICATION WILL BE TRANSFERRED TO THE GROUND BY THE DOWNLINK WHICH DOWNLINKS ALL FLAGWORDS.
062105,000114:                                                                                                  #  WHEN UPLINK ACTIVITY IS LOCKED OUT, IT CAN BE ALLOWED WHEN THE GROUND UPLINKS AND 'ERROR RESET' CODE.
062106,000115:                                                                                                  #  (IT IS RECOMMENDED THAT THE 'ERROR LIGHT RESET' CODE IS PRECEEDED BY 16 BITS THE FIRST OF WHICH IS 1 FOLLOWED
062107,000116:                                                                                                  #  BY 15 ZEROES.  THIS WILL ELIMINATE EXTRANEOUS BITS FROM INLINK WHICH MAY HAVE BEEN LEFT OVER FROM THE ORIGINAL
062108,000117:                                                                                                  #  FAILURE)
062109,000118: 
062110,000119:                                                                                                  #  UPLINK ACTIVITY IS ALSO ALLOWED (UNLOCKED) DURING FRESH START WHEN FRESH START SETS BIT4 OF FLAGWRD7 = 0.
062111,000120: 
062112,000121: 

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