Source Code

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

They have been adapted from sources files for Comanche 55, and updated via disassembly of binary dumps of original core rope memory modules, part numbers 2003972-1081, 2003972-1091, 2003972-1111, 2003972-1121, 2003972-1131, and 2003972-1141.

Since only binary dumps (rather than listings) of Comanche 67 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.

059944,000002:                                                                                                  ## Copyright:   Public domain.
059945,000003:                                                                                                  ## Filename:    KEYRUPT,_UPRUPT.agc
059946,000004:                                                                                                  ## Purpose:     A section of Comanche revision 067.
059947,000005:                                                                                                  ##              It is part of the reconstructed source code for the flight
059948,000006:                                                                                                  ##              software for the Command Module's (CM) Apollo Guidance Computer
059949,000007:                                                                                                  ##              (AGC) for Apollo 12. No original listings of this program are
059950,000008:                                                                                                  ##              available; instead, this file was created via dissassembly of
059951,000009:                                                                                                  ##              dumps of Comanche 067 core rope modules and comparison with
059952,000010:                                                                                                  ##              other AGC programs.
059953,000011:                                                                                                  ## Assembler:   yaYUL
059954,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
059955,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
059956,000014:                                                                                                  ## Mod history: 2023-08-16 MAS  Created from Comanche 055.
059957,000015: 
059958,000016: 14,3763                                           BANK     14                                    
059959,000017: 07,2000                                           SETLOC   KEYRUPT                               
059960,000018: 07,2000                                           BANK                                           
059961,000019: 07,3673                                           COUNT*   $$/KEYUP                              
059962,000020: 
059963,000021: 07,3673           54016        KEYRUPT1           TS       BANKRUPT                              
059964,000022: 07,3674           56002                           XCH      Q                                     
059965,000023: 07,3675           54012                           TS       QRUPT                                 
059966,000024: 07,3676           04414                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
059967,000025: 07,3677           34362                           CAF      LOW5                                  
059968,000026: 07,3700           00006                           EXTEND                                         
059969,000027: 07,3701           02015                           RAND     MNKEYIN                               #  CHECK IF KEYS 5M-1M ON
059970,000028: 07,3702           54073        KEYCOM             TS       RUPTREG4                              
059971,000029: 07,3703           40101                           CS       FLAGWRD5                              
059972,000030: 07,3704           75015                           MASK     BIT15                                 
059973,000031: 07,3705           26101                           ADS      FLAGWRD5                              
059974,000032: 
059975,000033: 07,3706           34371        ACCEPTUP           CAF      CHRPRIO                               #  (NOTE: RUPTREG4 = KEYTEMP1)
059976,000034: 07,3707           05150                           TC       NOVAC                                 
059977,000035: 07,3710     0777                                  EBANK=   DSPCOUNT                              
059978,000036: 07,3710           02000 60101                     2CADR    CHARIN                                
059979,000037: 
059980,000038: 07,3712           30073                           CA       RUPTREG4                              
059981,000039: 07,3713           50064                           INDEX    LOCCTR                                
059982,000040: 07,3714           54154                           TS       MPAC                                  #  LEAVE 5 BIT KEY CDE IN MPAC FOR CHARIN
059983,000041: 07,3715           05347                           TC       RESUME                                
059984,000042: 
059985,000043:                                                                                                  #  UPRUPT PROGRAM
059986,000044: 
059987,000045: 07,3716           54016        UPRUPT             TS       BANKRUPT                              
059988,000046: 07,3717           56002                           XCH      Q                                     
059989,000047: 07,3720           54012                           TS       QRUPT                                 
059990,000048: 07,3721           04414                           TC       LODSAMPT                              #  TIME IS SNATCHED IN RUPT FOR NOUN 65.
059991,000049: 07,3722           35035                           CAF      ZERO                                  
059992,000050: 07,3723           56045                           XCH      INLINK                                
059993,000051: 07,3724           54073                           TS       KEYTEMP1                              
059994,000052: 07,3725           35031                           CAF      BIT3                                  #  TURN ON UPACT LIGHT
059995,000053: 07,3726           00006                           EXTEND                                         #  (BIT 3 OF CHANNEL 11)
059996,000054: 07,3727           05011                           WOR      DSALMOUT                              
059997,000055: 07,3730           34362        UPRPT1             CAF      LOW5                                  #  TEST FOR TRIPLE CHAR REDUNDANCY
059998,000056: 07,3731           70073                           MASK     KEYTEMP1                              #  LOW5 OF WORD
059999,000057: 07,3732           56073                           XCH      KEYTEMP1                              #  LOW5 INTO KEYTEMP1
060000,000058: 07,3733           00006                           EXTEND                                         
060001,000059: 07,3734           75022                           MP       BIT10                                 #  SHIFT RIGHT 5
060002,000060: 07,3735           54734                           TS       KEYTEMP2                              
060003,000061: 07,3736           74362                           MASK     LOW5                                  #  MID 5
060004,000062: 07,3737           63773                           AD       HI10                                  
060005,000063: 07,3740           03770                           TC       UPTEST                                
060006,000064: 07,3741           35022                           CAF      BIT10                                 
060007,000065: 07,3742           00006                           EXTEND                                         
060008,000066: 07,3743           70734                           MP       KEYTEMP2                              #  SHIFT RIGHT 5
060009,000067: 07,3744           74362                           MASK     LOW5                                  #  HIGH 5
060010,000068: 07,3745           40000                           COM                                            
060011,000069: 07,3746           03770                           TC       UPTEST                                
060012,000070: 
060013,000071: 07,3747           43776        UPOK               CS       ELRCODE                               #  CODE IS GOOD.  IF CODE = 'ERROR RESET',
060014,000072: 07,3750           60073                           AD       KEYTEMP1                              #  CLEAR UPLOCKFL (SET BIT4 OF FLAGWRD7 = 0)
060015,000073: 07,3751           00006                           EXTEND                                         #  IF CODE DOES NOT = 'ERROR RESET', ACCEPT
060016,000074: 07,3752           13760                           BZF      CLUPLOCK                              #  CODE ONLY IF UPLOCKFL IS CLEAR (=0).
060017,000075: 
060018,000076: 07,3753           35030                           CAF      BIT4                                  #  TEST UPLOCKFL FOR 0 OR 1.
060019,000077: 07,3754           70103                           MASK     FLAGWRD7                              
060020,000078: 07,3755           10000                           CCS      A                                     
060021,000079: 07,3756           05347                           TC       RESUME                                #  UPLOCKFL = 1
060022,000080: 07,3757           03706                           TC       ACCEPTUP                              #  UPLOCKFL = 0
060023,000081: 
060024,000082: 07,3760           45030        CLUPLOCK           CS       BIT4                                  #  CLEAR UPLOCKFL (I.E., SET BIT 4 OF
060025,000083: 07,3761           70103                           MASK     FLAGWRD7                              #  FLAGWRD7 = 0)
060026,000084: 07,3762           54103                           TS       FLAGWRD7                              
060027,000085: 07,3763           03706                           TC       ACCEPTUP                              
060028,000086: 
060029,000087:                                                                                                  #  CODE IS BAD
060030,000088: 07,3764           40103        TMFAIL2            CS       FLAGWRD7                              #  LOCK OUT FURTHER UPLINK ACTIVITY
060031,000089: 07,3765           75030                           MASK     BIT4                                  #  (BY SETTING UPLOCKFL = 1) UNTIL
060032,000090: 07,3766           26103                           ADS      FLAGWRD7                              #  'ERROR RESET' IS SENT VIA UPLINK.
060033,000091: 07,3767           05347                           TC       RESUME                                
060034,000092: 07,3770           60073        UPTEST             AD       KEYTEMP1                              
060035,000093: 07,3771           10000                           CCS      A                                     
060036,000094: 07,3772           03764                           TC       TMFAIL2                               
060037,000095: 07,3773           77740        HI10               OCT      77740                                 
060038,000096: 07,3774           03764                           TC       TMFAIL2                               
060039,000097: 07,3775           00002                           TC       Q                                     
060040,000098: 
060041,000099: 07,3776           00022        ELRCODE            OCT      22                                    
060042,000100: 
060043,000101:                                                                                                  #  'UPLINK ACTIVITY LIGHT' IS TURNED OFF BY .....
060044,000102:                                                                                                  #        1.      VBRELDSP
060045,000103:                                                                                                  #        2.      ERROR RESET
060046,000104:                                                                                                  #        3.      UPDATE PROGRAM (P27) ENTERED BY V70,V71,V72, AND V73.
060047,000105: 
060048,000106:                                                                                                  #                                     -
060049,000107:                                                                                                  #  THE RECEPTION OF A BAD CODE (I.E  CCC FAILURE) LOCKS OUT FURTHER UPLINK ACTIVITY BY SETTING BIT4 OF FLAGWRD7 = 1.
060050,000108:                                                                                                  #  THIS INDICATION WILL BE TRANSFERRED TO THE GROUND BY THE DOWNLINK WHICH DOWNLINKS ALL FLAGWORDS.
060051,000109:                                                                                                  #  WHEN UPLINK ACTIVITY IS LOCKED OUT, IT CAN BE ALLOWED WHEN THE GROUND UPLINKS AND 'ERROR RESET' CODE.
060052,000110:                                                                                                  #  (IT IS RECOMMENDED THAT THE 'ERROR LIGHT RESET' CODE IS PRECEEDED BY 16 BITS THE FIRST OF WHICH IS 1 FOLLOWED
060053,000111:                                                                                                  #  BY 15 ZEROES.  THIS WILL ELIMINATE EXTRANEOUS BITS FROM INLINK WHICH MAY HAVE BEEN LEFT OVER FROM THE ORIGINAL
060054,000112:                                                                                                  #  FAILURE)
060055,000113: 
060056,000114:                                                                                                  #  UPLINK ACTIVITY IS ALSO ALLOWED (UNLOCKED) DURING FRESH START WHEN FRESH START SETS BIT4 OF FLAGWRD7 = 0.
060057,000115: 
060058,000116: 

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