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.

040053,000002:                                                                                                  ## Copyright:   Public domain.
040054,000003:                                                                                                  ## Filename:    S-BAND_ANTENNA_FOR_CM.agc
040055,000004:                                                                                                  ## Purpose:     A section of Manche72 revision 3.
040056,000005:                                                                                                  ##              It is part of the reconstructed source code for the final, flown
040057,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
040058,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
040059,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
040060,000009:                                                                                                  ##              from a reconstructed copy of Comanche 072. It has been adapted
040061,000010:                                                                                                  ##              such that the resulting bugger words exactly match those
040062,000011:                                                                                                  ##              specified for Manche72 revision 3 in NASA drawing 2021153G,
040063,000012:                                                                                                  ##              which gives relatively high confidence that the reconstruction
040064,000013:                                                                                                  ##              is correct.
040065,000014:                                                                                                  ## Assembler:   yaYUL
040066,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
040067,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
040068,000017:                                                                                                  ## Mod history: 2024-05-19 MAS  Created from Comanche 072.
040069,000018: 
040070,000019: 23,3207                                           BANK     23                                    
040071,000020: 42,2000                                           SETLOC   SBAND                                 
040072,000021: 42,2000                                           BANK                                           
040073,000022: 
040074,000023: 42,3651                                           COUNT*   $$/R05                                
040075,000024: 42,3651  E4,1417                                  EBANK=   EMSALT                                
040076,000025: 
040077,000026: 42,3651           06006        SBANDANT           TC       INTPRET                               
040078,000027: 42,3652           45034                           RTB      CALL                                  
040079,000028: 42,3653           45510                                    LOADTIME                              #  PICKUP CURRENT TIME SCALED B-28
040080,000029: 42,3654           47501                                    CDUTRIG                               #  COMPUTE SINES AND COSINES OF CDU ANGLES
040081,000030: 42,3655           34041                           STCALL   TDEC1                                 #  ADVANCE INTEGRATION TO TIME IN TDEC1
040082,000031: 42,3656           27123                                    CSMCONIC                              #  USING CONIC INTEGRATION
040083,000032: 42,3657           46135                           SLOAD    BHIZ                                  #  ORIGIN OF REFERENCE INERTIAL SYSTEM IS
040084,000033: 42,3660           00050                                    X2                                    #  EARTH = 0, MOON = 2
040085,000034: 42,3661           65674                                    EISOI                                 
040086,000035: 42,3662           77775                           VLOAD                                          
040087,000036: 42,3663           00001                                    RATT                                  
040088,000037: 42,3664           00003                           STORE    RCM                                   #  MOVE RATT TO PREVENT WIPEOUT
040089,000038: 42,3665           45145                           DLOAD    CALL                                  #  MOON, PUSH ON
040090,000039: 42,3666           00015                                    TAT                                   #  GET ORIGINAL TIME
040091,000040: 42,3667           54115                                    LUNPOS                                #  COMPUTE POSITION VECTOR OF MOON
040092,000041: 42,3670           57455                           VAD      VCOMP                                 #  R= -(REM+RCM) = NEG. OF S/C POS. VEC
040093,000042: 42,3671           00003                                    RCM                                   
040094,000043: 42,3672           77650                           GOTO                                           
040095,000044: 42,3673           65676                                    EISOI      +2                         
040096,000045: 42,3674           57575        EISOI              VLOAD    VCOMP                                 #  EARTH, R= -RCM
040097,000046: 42,3675           00001                                    RATT                                  
040098,000047: 42,3676           64201                           SETPD    MXV                                   #  RCS TO STABLE MEMBER- B-1X B-29X B+1
040099,000048: 42,3677           00003                                    2D                                    #  2D
040100,000049: 42,3700           01736                                    REFSMMAT                              #  STABLE MEMBER.  B-1X B-29X B+1= B-29
040101,000050: 42,3701           65372                           VSL1     PDDL                                  #  8D
040102,000051: 42,3702           15334                                    HI6ZEROS                              
040103,000052: 42,3703           24025                           STOVL    YAWANG                                #  ZERO OUT YAWANG, SET UP FOR SMNB
040104,000053: 42,3704           00003                                    RCM                                   #  TRANSFORMATION.  SM COORD.  SCALED B-29
040105,000054: 42,3705           77624                           CALL                                           
040106,000055: 42,3706           47646                                    *SMNB*                                
040107,000056: 42,3707           00003                           STORE    R                                     #  SAVE NAV. BASE COORDINATES
040108,000057: 42,3710           63256                           UNIT     PDVL                                  #  14D
040109,000058: 42,3711           00003                                    R                                     
040110,000059: 42,3712           72431                           VPROJ    VSL2                                  #  COMPUTE PROJECTION OF VECTOR INTO CM
040111,000060: 42,3713           15326                                    HIUNITZ                               #  XY-PLANE, R-(R.UZ)UZ
040112,000061: 42,3714           40045                           BVSU     BOV                                   #  CLEAR OVERFLOW INDICATOR IF SET
040113,000062: 42,3715           00003                                    R                                     
040114,000063: 42,3716           65717                                    COVCNV                                
040115,000064: 42,3717           40056        COVCNV             UNIT     BOV                                   #  TEST OVERFLOW FOR INDICATION OF NULL
040116,000065: 42,3720           65734                                    NOADJUST                              #  VECTOR
040117,000066: 42,3721           50206                           PUSH     DOT                                   #  20D
040118,000067: 42,3722           15332                                    HIUNITX                               #  COMPUTE YAW ANGLE = ACOS (URP.UX)
040119,000068: 42,3723           65552                           SL1      ACOS                                  #  REVOLUTIONS SCALED B0
040120,000069: 42,3724           50315                           PDVL     DOT                                   #  22D YAWANG
040121,000070: 42,3725           00017                                    URP                                   
040122,000071: 42,3726           15330                                    HIUNITY                               #  COMPUTE FOLLOWING- URP.UY
040123,000072: 42,3727           51152                           SL1      BPL                                   #  POSITIVE
040124,000073: 42,3730           65734                                    NOADJUST                              #  YES, 0-180 DEGREES
040125,000074: 42,3731           45345                           DLOAD    DSU                                   #  NO, 181-360 DEGREES 20D
040126,000075: 42,3732           15342                                    DPPOSMAX                              #  COMPUTE 2 PI MINUS YAW ANGLE
040127,000076: 42,3733           77606                           PUSH                                           #  22D YAWANG
040128,000077: 42,3734           50375        NOADJUST           VLOAD    DOT                                   #  COMPUTE PITCH ANGLE
040129,000078: 42,3735           00011                                    UR                                    #  ACOS (UR.UZ) - PI/2
040130,000079: 42,3736           15326                                    HIUNITZ                               
040131,000080: 42,3737           65552                           SL1      ACOS                                  #  REVOLUTIONS B0
040132,000081: 42,3740           77625                           DSU                                            
040133,000082: 42,3741           15324                                    HIDP1/4                               
040134,000083: 42,3742           16321                           STODL    RHOSB                                 
040135,000084: 42,3743           00025                                    YAWANG                                
040136,000085: 42,3744           02323                           STORE    GAMMASB                               #  PATCH FOR CHECKOUT
040137,000086: 42,3745           77776                           EXIT                                           
040138,000087: 42,3746           31044                           CA       EXTVBACT                              #  IS BIT 5 STILL ON
040139,000088: 42,3747           75027                           MASK     BIT5                                  
040140,000089: 42,3750           00006                           EXTEND                                         
040141,000090: 42,3751           15550                           BZF      ENDEXT                                #  NO, WE HAVE BEEN ANSWERED
040142,000091: 42,3752           33766                           CAF      V06N51                                #  DISPLAY ANGLES
040143,000092: 42,3753           04676                           TC       BANKCALL                              
040144,000093: 42,3754           20600                           CADR     GOMARKFR                              
040145,000094: 42,3755           05641                           TC       B5OFF                                 #  TERMINATE
040146,000095: 42,3756           05641                           TC       B5OFF                                 
040147,000096: 42,3757           05233                           TC       ENDOFJOB                              #  RECYCLE
040148,000097: 42,3760           35031                           CAF      BIT3                                  #  IMMEDIATE RETURN
040149,000098: 42,3761           05542                           TC       BLANKET                               #  BLANK R3
040150,000099: 42,3762           35033                           CAF      BIT1                                  #  DELAY MINIMUM TIME TO ALLOW DISPLAY IN
040151,000100: 42,3763           04676                           TC       BANKCALL                              
040152,000101: 42,3764           01732                           CADR     DELAYJOB                              
040153,000102: 42,3765           13651                           TCF      SBANDANT                              
040154,000103: 42,3766           01463        V06N51             VN       0651                                  
040155,000104: 42,3767                        RCM                EQUALS   2D                                    
040156,000105: 42,3767                        UR                 EQUALS   8D                                    
040157,000106: 42,3767                        URP                EQUALS   14D                                   
040158,000107: 42,3767                        YAWANG             EQUALS   20D                                   
040159,000108: 42,3767                        PITCHANG           EQUALS   22D                                   
040160,000109: 42,3767  0000002               R                  EQUALS   RCM                                   
040161,000110: 42,3767  30,2000                                  SBANK=   LOWSUPER                              
040162,000111: 

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