Source Code

These source-code files are part of a reconstructed copy of Comanche 72, the first release of the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 13.

They have been adapted from sources files created from a listing of Comanche 55. These source files were updated to match binary dumps of a set of Comanche 67 rope modules. They were then further modified by applying known changes between Comanche 67 and Comanche 72. A binary dump of module B2 of Comanche 72, part number 2010802-021, was also used to validate changes made to banks 05-13. The resulting code assembles to have identical memory-bank checksums as those specified in NASA drawing 2021153G; this gives reasonably high confidence that the changes that have been made are correct. In places where ambiguity exists, this ambiguity is discussed in "## Reconstruction:" comments.

Since no contemporary listings of Comanche 72 are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

060424,000002:                                                                                                  ## Copyright:   Public domain.
060425,000003:                                                                                                  ## Filename:    KEYRUPT,_UPRUPT.agc
060426,000004:                                                                                                  ## Purpose:     A section of Comanche revision 072.
060427,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
060428,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
060429,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
060430,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
060431,000009:                                                                                                  ##              from a printout of Comanche 055, binary dumps of a set of
060432,000010:                                                                                                  ##              Comanche 067 rope modules, and changelogs between Comanche 067
060433,000011:                                                                                                  ##              and 072. It has been adapted such that the resulting bugger words
060434,000012:                                                                                                  ##              exactly match those specified for Comanche 072 in NASA drawing
060435,000013:                                                                                                  ##              2021153G, which gives relatively high confidence that the
060436,000014:                                                                                                  ##              reconstruction is correct.
060437,000015:                                                                                                  ## Assembler:   yaYUL
060438,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
060439,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
060440,000018:                                                                                                  ## Mod history: 2024-05-13 MAS  Created from Comanche 067.
060441,000019: 
060442,000020: 14,3765                                           BANK     14                                    
060443,000021: 07,2000                                           SETLOC   KEYRUPT                               
060444,000022: 07,2000                                           BANK                                           
060445,000023: 07,3673                                           COUNT*   $$/KEYUP                              
060446,000024: 
060447,000025: 07,3673           54016        KEYRUPT1           TS       BANKRUPT                              
060448,000026: 07,3674           56002                           XCH      Q                                     
060449,000027: 07,3675           54012                           TS       QRUPT                                 
060450,000028: 07,3676           04414                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
060451,000029: 07,3677           34362                           CAF      LOW5                                  
060452,000030: 07,3700           00006                           EXTEND                                         
060453,000031: 07,3701           02015                           RAND     MNKEYIN                               #  CHECK IF KEYS 5M-1M ON
060454,000032: 07,3702           54073        KEYCOM             TS       RUPTREG4                              
060455,000033: 07,3703           40101                           CS       FLAGWRD5                              
060456,000034: 07,3704           75015                           MASK     BIT15                                 
060457,000035: 07,3705           26101                           ADS      FLAGWRD5                              
060458,000036: 
060459,000037: 07,3706           34371        ACCEPTUP           CAF      CHRPRIO                               #  (NOTE: RUPTREG4 = KEYTEMP1)
060460,000038: 07,3707           05150                           TC       NOVAC                                 
060461,000039: 07,3710     0777                                  EBANK=   DSPCOUNT                              
060462,000040: 07,3710           02000 60101                     2CADR    CHARIN                                
060463,000041: 
060464,000042: 07,3712           30073                           CA       RUPTREG4                              
060465,000043: 07,3713           50064                           INDEX    LOCCTR                                
060466,000044: 07,3714           54154                           TS       MPAC                                  #  LEAVE 5 BIT KEY CDE IN MPAC FOR CHARIN
060467,000045: 07,3715           05347                           TC       RESUME                                
060468,000046: 
060469,000047:                                                                                                  #  UPRUPT PROGRAM
060470,000048: 
060471,000049: 07,3716           54016        UPRUPT             TS       BANKRUPT                              
060472,000050: 07,3717           56002                           XCH      Q                                     
060473,000051: 07,3720           54012                           TS       QRUPT                                 
060474,000052: 07,3721           04414                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
060475,000053: 07,3722           35035                           CAF      ZERO                                  
060476,000054: 07,3723           56045                           XCH      INLINK                                
060477,000055: 07,3724           54073                           TS       KEYTEMP1                              
060478,000056: 07,3725           35031                           CAF      BIT3                                  #  TURN ON UPACT LIGHT
060479,000057: 07,3726           00006                           EXTEND                                         #  (BIT 3 OF CHANNEL 11)
060480,000058: 07,3727           05011                           WOR      DSALMOUT                              
060481,000059: 07,3730           34362        UPRPT1             CAF      LOW5                                  #  TEST FOR TRIPLE CHAR REDUNDANCY
060482,000060: 07,3731           70073                           MASK     KEYTEMP1                              #  LOW5 OF WORD
060483,000061: 07,3732           56073                           XCH      KEYTEMP1                              #  LOW5 INTO KEYTEMP1
060484,000062: 07,3733           00006                           EXTEND                                         
060485,000063: 07,3734           75022                           MP       BIT10                                 #  SHIFT RIGHT 5
060486,000064: 07,3735           54734                           TS       KEYTEMP2                              
060487,000065: 07,3736           74362                           MASK     LOW5                                  #  MID 5
060488,000066: 07,3737           63773                           AD       HI10                                  
060489,000067: 07,3740           03770                           TC       UPTEST                                
060490,000068: 07,3741           35022                           CAF      BIT10                                 
060491,000069: 07,3742           00006                           EXTEND                                         
060492,000070: 07,3743           70734                           MP       KEYTEMP2                              #  SHIFT RIGHT 5
060493,000071: 07,3744           74362                           MASK     LOW5                                  #  HIGH 5
060494,000072: 07,3745           40000                           COM                                            
060495,000073: 07,3746           03770                           TC       UPTEST                                
060496,000074: 
060497,000075: 07,3747           43776        UPOK               CS       ELRCODE                               #  CODE IS GOOD.  IF CODE = 'ERROR RESET',
060498,000076: 07,3750           60073                           AD       KEYTEMP1                              #  CLEAR UPLOCKFL (SET BIT4 OF FLAGWRD7 = 0)
060499,000077: 07,3751           00006                           EXTEND                                         #  IF CODE DOES NOT = 'ERROR RESET', ACCEPT
060500,000078: 07,3752           13760                           BZF      CLUPLOCK                              #  CODE ONLY IF UPLOCKFL IS CLEAR (=0).
060501,000079: 
060502,000080: 07,3753           35030                           CAF      BIT4                                  #  TEST UPLOCKFL FOR 0 OR 1.
060503,000081: 07,3754           70103                           MASK     FLAGWRD7                              
060504,000082: 07,3755           10000                           CCS      A                                     
060505,000083: 07,3756           05347                           TC       RESUME                                #  UPLOCKFL = 1
060506,000084: 07,3757           03706                           TC       ACCEPTUP                              #  UPLOCKFL = 0
060507,000085: 
060508,000086: 07,3760           45030        CLUPLOCK           CS       BIT4                                  #  CLEAR UPLOCKFL (I.E., SET BIT 4 OF
060509,000087: 07,3761           70103                           MASK     FLAGWRD7                              #  FLAGWRD7 = 0)
060510,000088: 07,3762           54103                           TS       FLAGWRD7                              
060511,000089: 07,3763           03706                           TC       ACCEPTUP                              
060512,000090: 
060513,000091:                                                                                                  #  CODE IS BAD
060514,000092: 07,3764           40103        TMFAIL2            CS       FLAGWRD7                              #  LOCK OUT FURTHER UPLINK ACTIVITY
060515,000093: 07,3765           75030                           MASK     BIT4                                  #  (BY SETTING UPLOCKFL = 1) UNTIL
060516,000094: 07,3766           26103                           ADS      FLAGWRD7                              #  'ERROR RESET' IS SENT VIA UPLINK.
060517,000095: 07,3767           05347                           TC       RESUME                                
060518,000096: 07,3770           60073        UPTEST             AD       KEYTEMP1                              
060519,000097: 07,3771           10000                           CCS      A                                     
060520,000098: 07,3772           03764                           TC       TMFAIL2                               
060521,000099: 07,3773           77740        HI10               OCT      77740                                 
060522,000100: 07,3774           03764                           TC       TMFAIL2                               
060523,000101: 07,3775           00002                           TC       Q                                     
060524,000102: 
060525,000103: 07,3776           00022        ELRCODE            OCT      22                                    
060526,000104: 
060527,000105:                                                                                                  #  'UPLINK ACTIVITY LIGHT' IS TURNED OFF BY .....
060528,000106:                                                                                                  #        1.      VBRELDSP
060529,000107:                                                                                                  #        2.      ERROR RESET
060530,000108:                                                                                                  #        3.      UPDATE PROGRAM (P27) ENTERED BY V70,V71,V72, AND V73.
060531,000109: 
060532,000110:                                                                                                  #                                     -
060533,000111:                                                                                                  #  THE RECEPTION OF A BAD CODE (I.E  CCC FAILURE) LOCKS OUT FURTHER UPLINK ACTIVITY BY SETTING BIT4 OF FLAGWRD7 = 1.
060534,000112:                                                                                                  #  THIS INDICATION WILL BE TRANSFERRED TO THE GROUND BY THE DOWNLINK WHICH DOWNLINKS ALL FLAGWORDS.
060535,000113:                                                                                                  #  WHEN UPLINK ACTIVITY IS LOCKED OUT, IT CAN BE ALLOWED WHEN THE GROUND UPLINKS AND 'ERROR RESET' CODE.
060536,000114:                                                                                                  #  (IT IS RECOMMENDED THAT THE 'ERROR LIGHT RESET' CODE IS PRECEEDED BY 16 BITS THE FIRST OF WHICH IS 1 FOLLOWED
060537,000115:                                                                                                  #  BY 15 ZEROES.  THIS WILL ELIMINATE EXTRANEOUS BITS FROM INLINK WHICH MAY HAVE BEEN LEFT OVER FROM THE ORIGINAL
060538,000116:                                                                                                  #  FAILURE)
060539,000117: 
060540,000118:                                                                                                  #  UPLINK ACTIVITY IS ALSO ALLOWED (UNLOCKED) DURING FRESH START WHEN FRESH START SETS BIT4 OF FLAGWRD7 = 0.
060541,000119: 
060542,000120: 

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