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.

039791,000002:                                                                                                  ## Copyright:   Public domain.
039792,000003:                                                                                                  ## Filename:    S-BAND_ANTENNA_FOR_CM.agc
039793,000004:                                                                                                  ## Purpose:     A section of Comanche revision 067.
039794,000005:                                                                                                  ##              It is part of the reconstructed source code for the flight
039795,000006:                                                                                                  ##              software for the Command Module's (CM) Apollo Guidance Computer
039796,000007:                                                                                                  ##              (AGC) for Apollo 12. No original listings of this program are
039797,000008:                                                                                                  ##              available; instead, this file was created via dissassembly of
039798,000009:                                                                                                  ##              dumps of Comanche 067 core rope modules and comparison with
039799,000010:                                                                                                  ##              other AGC programs.
039800,000011:                                                                                                  ## Assembler:   yaYUL
039801,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
039802,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
039803,000014:                                                                                                  ## Mod history: 2023-08-16 MAS  Created from Comanche 055.
039804,000015:                                                                                                  ##              2024-05-13 MAS  Updated for Comanche 067.
039805,000016: 
039806,000017: 23,3207                                           BANK     23                                    
039807,000018: 42,2000                                           SETLOC   SBAND                                 
039808,000019: 42,2000                                           BANK                                           
039809,000020: 
039810,000021: 42,3652                                           COUNT*   $$/R05                                
039811,000022: 42,3652  E4,1417                                  EBANK=   EMSALT                                
039812,000023: 
039813,000024: 42,3652           06006        SBANDANT           TC       INTPRET                               
039814,000025: 42,3653           45034                           RTB      CALL                                  
039815,000026: 42,3654           45510                                    LOADTIME                              #  PICKUP CURRENT TIME SCALED B-28
039816,000027: 42,3655           47501                                    CDUTRIG                               #  COMPUTE SINES AND COSINES OF CDU ANGLES
039817,000028: 42,3656           34041                           STCALL   TDEC1                                 #  ADVANCE INTEGRATION TO TIME IN TDEC1
039818,000029: 42,3657           27124                                    CSMCONIC                              #  USING CONIC INTEGRATION
039819,000030: 42,3660           46135                           SLOAD    BHIZ                                  #  ORIGIN OF REFERENCE INERTIAL SYSTEM IS
039820,000031: 42,3661           00050                                    X2                                    #  EARTH = 0, MOON = 2
039821,000032: 42,3662           65675                                    EISOI                                 
039822,000033: 42,3663           77775                           VLOAD                                          
039823,000034: 42,3664           00001                                    RATT                                  
039824,000035: 42,3665           00003                           STORE    RCM                                   #  MOVE RATT TO PREVENT WIPEOUT
039825,000036: 42,3666           45145                           DLOAD    CALL                                  #  MOON, PUSH ON
039826,000037: 42,3667           00015                                    TAT                                   #  GET ORIGINAL TIME
039827,000038: 42,3670           54115                                    LUNPOS                                #  COMPUTE POSITION VECTOR OF MOON
039828,000039: 42,3671           57455                           VAD      VCOMP                                 #  R= -(REM+RCM) = NEG. OF S/C POS. VEC
039829,000040: 42,3672           00003                                    RCM                                   
039830,000041: 42,3673           77650                           GOTO                                           
039831,000042: 42,3674           65677                                    EISOI      +2                         
039832,000043: 42,3675           57575        EISOI              VLOAD    VCOMP                                 #  EARTH, R= -RCM
039833,000044: 42,3676           00001                                    RATT                                  
039834,000045: 42,3677           64201                           SETPD    MXV                                   #  RCS TO STABLE MEMBER- B-1X B-29X B+1
039835,000046: 42,3700           00003                                    2D                                    #  2D
039836,000047: 42,3701           01736                                    REFSMMAT                              #  STABLE MEMBER.  B-1X B-29X B+1= B-29
039837,000048: 42,3702           65372                           VSL1     PDDL                                  #  8D
039838,000049: 42,3703           15334                                    HI6ZEROS                              
039839,000050: 42,3704           24025                           STOVL    YAWANG                                #  ZERO OUT YAWANG, SET UP FOR SMNB
039840,000051: 42,3705           00003                                    RCM                                   #  TRANSFORMATION.  SM COORD.  SCALED B-29
039841,000052: 42,3706           77624                           CALL                                           
039842,000053: 42,3707           47646                                    *SMNB*                                
039843,000054: 42,3710           00003                           STORE    R                                     #  SAVE NAV. BASE COORDINATES
039844,000055: 42,3711           63256                           UNIT     PDVL                                  #  14D
039845,000056: 42,3712           00003                                    R                                     
039846,000057: 42,3713           72431                           VPROJ    VSL2                                  #  COMPUTE PROJECTION OF VECTOR INTO CM
039847,000058: 42,3714           15326                                    HIUNITZ                               #  XY-PLANE, R-(R.UZ)UZ
039848,000059: 42,3715           40045                           BVSU     BOV                                   #  CLEAR OVERFLOW INDICATOR IF SET
039849,000060: 42,3716           00003                                    R                                     
039850,000061: 42,3717           65720                                    COVCNV                                
039851,000062: 42,3720           40056        COVCNV             UNIT     BOV                                   #  TEST OVERFLOW FOR INDICATION OF NULL
039852,000063: 42,3721           65735                                    NOADJUST                              #  VECTOR
039853,000064: 42,3722           50206                           PUSH     DOT                                   #  20D
039854,000065: 42,3723           15332                                    HIUNITX                               #  COMPUTE YAW ANGLE = ACOS (URP.UX)
039855,000066: 42,3724           65552                           SL1      ACOS                                  #  REVOLUTIONS SCALED B0
039856,000067: 42,3725           50315                           PDVL     DOT                                   #  22D YAWANG
039857,000068: 42,3726           00017                                    URP                                   
039858,000069: 42,3727           15330                                    HIUNITY                               #  COMPUTE FOLLOWING- URP.UY
039859,000070: 42,3730           51152                           SL1      BPL                                   #  POSITIVE
039860,000071: 42,3731           65735                                    NOADJUST                              #  YES, 0-180 DEGREES
039861,000072: 42,3732           45345                           DLOAD    DSU                                   #  NO, 181-360 DEGREES 20D
039862,000073: 42,3733           15342                                    DPPOSMAX                              #  COMPUTE 2 PI MINUS YAW ANGLE
039863,000074: 42,3734           77606                           PUSH                                           #  22D YAWANG
039864,000075: 42,3735           50375        NOADJUST           VLOAD    DOT                                   #  COMPUTE PITCH ANGLE
039865,000076: 42,3736           00011                                    UR                                    #  ACOS (UR.UZ) - PI/2
039866,000077: 42,3737           15326                                    HIUNITZ                               
039867,000078: 42,3740           65552                           SL1      ACOS                                  #  REVOLUTIONS B0
039868,000079: 42,3741           77625                           DSU                                            
039869,000080: 42,3742           15324                                    HIDP1/4                               
039870,000081: 42,3743           16321                           STODL    RHOSB                                 
039871,000082: 42,3744           00025                                    YAWANG                                
039872,000083: 42,3745           02323                           STORE    GAMMASB                               #  PATCH FOR CHECKOUT
039873,000084: 42,3746           77776                           EXIT                                           
039874,000085: 42,3747           31044                           CA       EXTVBACT                              #  IS BIT 5 STILL ON
039875,000086: 42,3750           75027                           MASK     BIT5                                  
039876,000087: 42,3751           00006                           EXTEND                                         
039877,000088: 42,3752           15550                           BZF      ENDEXT                                #  NO, WE HAVE BEEN ANSWERED
039878,000089: 42,3753           33767                           CAF      V06N51                                #  DISPLAY ANGLES
039879,000090: 42,3754           04676                           TC       BANKCALL                              
039880,000091: 42,3755           20600                           CADR     GOMARKFR                              
039881,000092: 42,3756           05641                           TC       B5OFF                                 #  TERMINATE
039882,000093: 42,3757           05641                           TC       B5OFF                                 
039883,000094: 42,3760           05233                           TC       ENDOFJOB                              #  RECYCLE
039884,000095: 42,3761           35031                           CAF      BIT3                                  #  IMMEDIATE RETURN
039885,000096: 42,3762           05542                           TC       BLANKET                               #  BLANK R3
039886,000097: 42,3763           35033                           CAF      BIT1                                  #  DELAY MINIMUM TIME TO ALLOW DISPLAY IN
039887,000098: 42,3764           04676                           TC       BANKCALL                              
039888,000099: 42,3765           01732                           CADR     DELAYJOB                              
039889,000100: 42,3766           13652                           TCF      SBANDANT                              
039890,000101: 42,3767           01463        V06N51             VN       0651                                  
039891,000102: 42,3770                        RCM                EQUALS   2D                                    
039892,000103: 42,3770                        UR                 EQUALS   8D                                    
039893,000104: 42,3770                        URP                EQUALS   14D                                   
039894,000105: 42,3770                        YAWANG             EQUALS   20D                                   
039895,000106: 42,3770                        PITCHANG           EQUALS   22D                                   
039896,000107: 42,3770  0000002               R                  EQUALS   RCM                                   
039897,000108: 42,3770  30,2000                                  SBANK=   LOWSUPER                              
039898,000109: 

End of include-file S-BAND_ANTENNA_FOR_CM.agc.  Parent file is MAIN.agc