Source Code

These source-code files are part of a reconstructed copy of Comanche 72/3 (AKA Manche72 revision 3), the final, flown mission release of the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 13.

The starting point was the source code of Comanche 72 (itself previously reconstructed). Comanche 72 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 72 and 72/3. 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/3 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.

060319,000002:                                                                                                  ## Copyright:   Public domain.
060320,000003:                                                                                                  ## Filename:    KEYRUPT,_UPRUPT.agc
060321,000004:                                                                                                  ## Purpose:     A section of Manche72 revision 3.
060322,000005:                                                                                                  ##              It is part of the reconstructed source code for the final, flown
060323,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
060324,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
060325,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
060326,000009:                                                                                                  ##              from a reconstructed copy of Comanche 072. It has been adapted
060327,000010:                                                                                                  ##              such that the resulting bugger words exactly match those
060328,000011:                                                                                                  ##              specified for Manche72 revision 3 in NASA drawing 2021153G,
060329,000012:                                                                                                  ##              which gives relatively high confidence that the reconstruction
060330,000013:                                                                                                  ##              is correct.
060331,000014:                                                                                                  ## Assembler:   yaYUL
060332,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
060333,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
060334,000017:                                                                                                  ## Mod history: 2024-05-19 MAS  Created from Comanche 072.
060335,000018: 
060336,000019: 14,3765                                           BANK     14                                    
060337,000020: 07,2000                                           SETLOC   KEYRUPT                               
060338,000021: 07,2000                                           BANK                                           
060339,000022: 07,3673                                           COUNT*   $$/KEYUP                              
060340,000023: 
060341,000024: 07,3673           54016        KEYRUPT1           TS       BANKRUPT                              
060342,000025: 07,3674           56002                           XCH      Q                                     
060343,000026: 07,3675           54012                           TS       QRUPT                                 
060344,000027: 07,3676           04414                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
060345,000028: 07,3677           34362                           CAF      LOW5                                  
060346,000029: 07,3700           00006                           EXTEND                                         
060347,000030: 07,3701           02015                           RAND     MNKEYIN                               #  CHECK IF KEYS 5M-1M ON
060348,000031: 07,3702           54073        KEYCOM             TS       RUPTREG4                              
060349,000032: 07,3703           40101                           CS       FLAGWRD5                              
060350,000033: 07,3704           75015                           MASK     BIT15                                 
060351,000034: 07,3705           26101                           ADS      FLAGWRD5                              
060352,000035: 
060353,000036: 07,3706           34371        ACCEPTUP           CAF      CHRPRIO                               #  (NOTE: RUPTREG4 = KEYTEMP1)
060354,000037: 07,3707           05150                           TC       NOVAC                                 
060355,000038: 07,3710     0777                                  EBANK=   DSPCOUNT                              
060356,000039: 07,3710           02000 60101                     2CADR    CHARIN                                
060357,000040: 
060358,000041: 07,3712           30073                           CA       RUPTREG4                              
060359,000042: 07,3713           50064                           INDEX    LOCCTR                                
060360,000043: 07,3714           54154                           TS       MPAC                                  #  LEAVE 5 BIT KEY CDE IN MPAC FOR CHARIN
060361,000044: 07,3715           05347                           TC       RESUME                                
060362,000045: 
060363,000046:                                                                                                  #  UPRUPT PROGRAM
060364,000047: 
060365,000048: 07,3716           54016        UPRUPT             TS       BANKRUPT                              
060366,000049: 07,3717           56002                           XCH      Q                                     
060367,000050: 07,3720           54012                           TS       QRUPT                                 
060368,000051: 07,3721           04414                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
060369,000052: 07,3722           35035                           CAF      ZERO                                  
060370,000053: 07,3723           56045                           XCH      INLINK                                
060371,000054: 07,3724           54073                           TS       KEYTEMP1                              
060372,000055: 07,3725           35031                           CAF      BIT3                                  #  TURN ON UPACT LIGHT
060373,000056: 07,3726           00006                           EXTEND                                         #  (BIT 3 OF CHANNEL 11)
060374,000057: 07,3727           05011                           WOR      DSALMOUT                              
060375,000058: 07,3730           34362        UPRPT1             CAF      LOW5                                  #  TEST FOR TRIPLE CHAR REDUNDANCY
060376,000059: 07,3731           70073                           MASK     KEYTEMP1                              #  LOW5 OF WORD
060377,000060: 07,3732           56073                           XCH      KEYTEMP1                              #  LOW5 INTO KEYTEMP1
060378,000061: 07,3733           00006                           EXTEND                                         
060379,000062: 07,3734           75022                           MP       BIT10                                 #  SHIFT RIGHT 5
060380,000063: 07,3735           54734                           TS       KEYTEMP2                              
060381,000064: 07,3736           74362                           MASK     LOW5                                  #  MID 5
060382,000065: 07,3737           63773                           AD       HI10                                  
060383,000066: 07,3740           03770                           TC       UPTEST                                
060384,000067: 07,3741           35022                           CAF      BIT10                                 
060385,000068: 07,3742           00006                           EXTEND                                         
060386,000069: 07,3743           70734                           MP       KEYTEMP2                              #  SHIFT RIGHT 5
060387,000070: 07,3744           74362                           MASK     LOW5                                  #  HIGH 5
060388,000071: 07,3745           40000                           COM                                            
060389,000072: 07,3746           03770                           TC       UPTEST                                
060390,000073: 
060391,000074: 07,3747           43776        UPOK               CS       ELRCODE                               #  CODE IS GOOD.  IF CODE = 'ERROR RESET',
060392,000075: 07,3750           60073                           AD       KEYTEMP1                              #  CLEAR UPLOCKFL (SET BIT4 OF FLAGWRD7 = 0)
060393,000076: 07,3751           00006                           EXTEND                                         #  IF CODE DOES NOT = 'ERROR RESET', ACCEPT
060394,000077: 07,3752           13760                           BZF      CLUPLOCK                              #  CODE ONLY IF UPLOCKFL IS CLEAR (=0).
060395,000078: 
060396,000079: 07,3753           35030                           CAF      BIT4                                  #  TEST UPLOCKFL FOR 0 OR 1.
060397,000080: 07,3754           70103                           MASK     FLAGWRD7                              
060398,000081: 07,3755           10000                           CCS      A                                     
060399,000082: 07,3756           05347                           TC       RESUME                                #  UPLOCKFL = 1
060400,000083: 07,3757           03706                           TC       ACCEPTUP                              #  UPLOCKFL = 0
060401,000084: 
060402,000085: 07,3760           45030        CLUPLOCK           CS       BIT4                                  #  CLEAR UPLOCKFL (I.E., SET BIT 4 OF
060403,000086: 07,3761           70103                           MASK     FLAGWRD7                              #  FLAGWRD7 = 0)
060404,000087: 07,3762           54103                           TS       FLAGWRD7                              
060405,000088: 07,3763           03706                           TC       ACCEPTUP                              
060406,000089: 
060407,000090:                                                                                                  #  CODE IS BAD
060408,000091: 07,3764           40103        TMFAIL2            CS       FLAGWRD7                              #  LOCK OUT FURTHER UPLINK ACTIVITY
060409,000092: 07,3765           75030                           MASK     BIT4                                  #  (BY SETTING UPLOCKFL = 1) UNTIL
060410,000093: 07,3766           26103                           ADS      FLAGWRD7                              #  'ERROR RESET' IS SENT VIA UPLINK.
060411,000094: 07,3767           05347                           TC       RESUME                                
060412,000095: 07,3770           60073        UPTEST             AD       KEYTEMP1                              
060413,000096: 07,3771           10000                           CCS      A                                     
060414,000097: 07,3772           03764                           TC       TMFAIL2                               
060415,000098: 07,3773           77740        HI10               OCT      77740                                 
060416,000099: 07,3774           03764                           TC       TMFAIL2                               
060417,000100: 07,3775           00002                           TC       Q                                     
060418,000101: 
060419,000102: 07,3776           00022        ELRCODE            OCT      22                                    
060420,000103: 
060421,000104:                                                                                                  #  'UPLINK ACTIVITY LIGHT' IS TURNED OFF BY .....
060422,000105:                                                                                                  #        1.      VBRELDSP
060423,000106:                                                                                                  #        2.      ERROR RESET
060424,000107:                                                                                                  #        3.      UPDATE PROGRAM (P27) ENTERED BY V70,V71,V72, AND V73.
060425,000108: 
060426,000109:                                                                                                  #                                     -
060427,000110:                                                                                                  #  THE RECEPTION OF A BAD CODE (I.E  CCC FAILURE) LOCKS OUT FURTHER UPLINK ACTIVITY BY SETTING BIT4 OF FLAGWRD7 = 1.
060428,000111:                                                                                                  #  THIS INDICATION WILL BE TRANSFERRED TO THE GROUND BY THE DOWNLINK WHICH DOWNLINKS ALL FLAGWORDS.
060429,000112:                                                                                                  #  WHEN UPLINK ACTIVITY IS LOCKED OUT, IT CAN BE ALLOWED WHEN THE GROUND UPLINKS AND 'ERROR RESET' CODE.
060430,000113:                                                                                                  #  (IT IS RECOMMENDED THAT THE 'ERROR LIGHT RESET' CODE IS PRECEEDED BY 16 BITS THE FIRST OF WHICH IS 1 FOLLOWED
060431,000114:                                                                                                  #  BY 15 ZEROES.  THIS WILL ELIMINATE EXTRANEOUS BITS FROM INLINK WHICH MAY HAVE BEEN LEFT OVER FROM THE ORIGINAL
060432,000115:                                                                                                  #  FAILURE)
060433,000116: 
060434,000117:                                                                                                  #  UPLINK ACTIVITY IS ALSO ALLOWED (UNLOCKED) DURING FRESH START WHEN FRESH START SETS BIT4 OF FLAGWRD7 = 0.
060435,000118: 
060436,000119: 

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