Source Code

These source-code files are part of a reconstructed copy of Comanche 051, the original release of the Apollo 11 Command Module (CM) Apollo Guidance Computer (AGC) software.

The reconstruction began with source code of Comanche 055 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes related to the R-2 lunar potential model, using hints from program comments and change-indicating asterisks in the Comanche 055 listing as a guide. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021153D. Note that page numbers in the reconstructed code match those on the Comanche 055 printout, although the added code would likely have changed page numbers for a real Comanche 051 listing.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

040681,000002:                                                                                                  ## Copyright:   Public domain.
040682,000003:                                                                                                  ## Filename:    S-BAND_ANTENNA_FOR_CM.agc
040683,000004:                                                                                                  ## Purpose:     A section of Comanche revision 051.
040684,000005:                                                                                                  ##              It is part of the reconstructed source code for the
040685,000006:                                                                                                  ##              original release of the flight software for the Command
040686,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 11.
040687,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
040688,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
040689,000010:                                                                                                  ##              exactly match those specified for Comanche 51 in NASA drawing
040690,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
040691,000012:                                                                                                  ##              reconstruction is correct.
040692,000013:                                                                                                  ## Reference:   pp. 934-935
040693,000014:                                                                                                  ## Assembler:   yaYUL
040694,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
040695,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
040696,000017:                                                                                                  ## Mod history: 2019-07-30 MAS  Created from Comanche 55.
040697,000018: 

Page 934

040699,000020: 23,3205                                           BANK     23                                    
040700,000021: 42,2000                                           SETLOC   SBAND                                 
040701,000022: 42,2000                                           BANK                                           
040702,000023: 
040703,000024: 42,3652                                           COUNT*   $$/R05                                
040704,000025: 42,3652  E4,1417                                  EBANK=   EMSALT                                
040705,000026: 
040706,000027: 42,3652           04662        SBANDANT           TC       BANKCALL                              #  V 64 E GETS US HERE
040707,000028: 42,3653           17653                           CADR     R02BOTH                               #  CHECK IF IMU IS ON AND ALIGNED
040708,000029: 42,3654           06006                           TC       INTPRET                               
040709,000030: 42,3655           45034                           RTB      CALL                                  
040710,000031: 42,3656           45510                                    LOADTIME                              #  PICKUP CURRENT TIME SCALED B-28
040711,000032: 42,3657           47477                                    CDUTRIG                               #  COMPUTE SINES AND COSINES OF CDU ANGLES
040712,000033: 42,3660           34041                           STCALL   TDEC1                                 #  ADVANCE INTEGRATION TO TIME IN TDEC1
040713,000034: 42,3661           27114                                    CSMCONIC                              #  USING CONIC INTEGRATION
040714,000035: 42,3662           46135                           SLOAD    BHIZ                                  #  ORIGIN OF REFERENCE INERTIAL SYSTEM IS
040715,000036: 42,3663           00050                                    X2                                    #  EARTH = 0, MOON = 2
040716,000037: 42,3664           65677                                    EISOI                                 
040717,000038: 42,3665           77775                           VLOAD                                          
040718,000039: 42,3666           00001                                    RATT                                  
040719,000040: 42,3667           00003                           STORE    RCM                                   #  MOVE RATT TO PREVENT WIPEOUT
040720,000041: 42,3670           45145                           DLOAD    CALL                                  #  MOON, PUSH ON
040721,000042: 42,3671           00015                                    TAT                                   #  GET ORIGINAL TIME
040722,000043: 42,3672           54115                                    LUNPOS                                #  COMPUTE POSITION VECTOR OF MOON
040723,000044: 42,3673           57455                           VAD      VCOMP                                 #  R= -(REM+RCM) = NEG. OF S/C POS. VEC
040724,000045: 42,3674           00003                                    RCM                                   
040725,000046: 42,3675           77650                           GOTO                                           
040726,000047: 42,3676           65701                                    EISOI      +2                         
040727,000048: 42,3677           57575        EISOI              VLOAD    VCOMP                                 #  EARTH, R= -RCM
040728,000049: 42,3700           00001                                    RATT                                  
040729,000050: 42,3701           64201                           SETPD    MXV                                   #  RCS TO STABLE MEMBER- B-1X B-29X B+1
040730,000051: 42,3702           00003                                    2D                                    #  2D
040731,000052: 42,3703           01736                                    REFSMMAT                              #  STABLE MEMBER.  B-1X B-29X B+1= B-29
040732,000053: 42,3704           65372                           VSL1     PDDL                                  #  8D
040733,000054: 42,3705           15335                                    HI6ZEROS                              
040734,000055: 42,3706           24025                           STOVL    YAWANG                                #  ZERO OUT YAWANG, SET UP FOR SMNB
040735,000056: 42,3707           00003                                    RCM                                   #  TRANSFORMATION.  SM COORD.  SCALED B-29
040736,000057: 42,3710           77624                           CALL                                           
040737,000058: 42,3711           47644                                    *SMNB*                                
040738,000059: 42,3712           00003                           STORE    R                                     #  SAVE NAV. BASE COORDINATES
040739,000060: 42,3713           63256                           UNIT     PDVL                                  #  14D
040740,000061: 42,3714           00003                                    R                                     
040741,000062: 42,3715           72431                           VPROJ    VSL2                                  #  COMPUTE PROJECTION OF VECTOR INTO CM
040742,000063: 42,3716           15327                                    HIUNITZ                               #  XY-PLANE, R-(R.UZ)UZ
040743,000064: 42,3717           40045                           BVSU     BOV                                   #  CLEAR OVERFLOW INDICATOR IF SET
040744,000065: 42,3720           00003                                    R                                     
040745,000066: 42,3721           65722                                    COVCNV                                
040746,000067: 42,3722           40056        COVCNV             UNIT     BOV                                   #  TEST OVERFLOW FOR INDICATION OF NULL
040747,000068: 42,3723           65737                                    NOADJUST                              #  VECTOR
040748,000069: 42,3724           50206                           PUSH     DOT                                   #  20D

Page 935

040750,000071: 42,3725           15333                                    HIUNITX                               #  COMPUTE YAW ANGLE = ACOS (URP.UX)
040751,000072: 42,3726           65552                           SL1      ACOS                                  #  REVOLUTIONS SCALED B0
040752,000073: 42,3727           50315                           PDVL     DOT                                   #  22D YAWANG
040753,000074: 42,3730           00017                                    URP                                   
040754,000075: 42,3731           15331                                    HIUNITY                               #  COMPUTE FOLLOWING- URP.UY
040755,000076: 42,3732           51152                           SL1      BPL                                   #  POSITIVE
040756,000077: 42,3733           65737                                    NOADJUST                              #  YES, 0-180 DEGREES
040757,000078: 42,3734           45345                           DLOAD    DSU                                   #  NO, 181-360 DEGREES 20D
040758,000079: 42,3735           15343                                    DPPOSMAX                              #  COMPUTE 2 PI MINUS YAW ANGLE
040759,000080: 42,3736           77606                           PUSH                                           #  22D YAWANG
040760,000081: 42,3737           50375        NOADJUST           VLOAD    DOT                                   #  COMPUTE PITCH ANGLE
040761,000082: 42,3740           00011                                    UR                                    #  ACOS (UR.UZ) - PI/2
040762,000083: 42,3741           15327                                    HIUNITZ                               
040763,000084: 42,3742           65552                           SL1      ACOS                                  #  REVOLUTIONS B0
040764,000085: 42,3743           77625                           DSU                                            
040765,000086: 42,3744           15325                                    HIDP1/4                               
040766,000087: 42,3745           16321                           STODL    RHOSB                                 
040767,000088: 42,3746           00025                                    YAWANG                                
040768,000089: 42,3747           02323                           STORE    GAMMASB                               #  PATCH FOR CHECKOUT
040769,000090: 42,3750           77776                           EXIT                                           
040770,000091: 42,3751           31044                           CA       EXTVBACT                              #  IS BIT 5 STILL ON
040771,000092: 42,3752           75013                           MASK     BIT5                                  
040772,000093: 42,3753           00006                           EXTEND                                         
040773,000094: 42,3754           15534                           BZF      ENDEXT                                #  NO, WE HAVE BEEN ANSWERED
040774,000095: 42,3755           33771                           CAF      V06N51                                #  DISPLAY ANGLES
040775,000096: 42,3756           04662                           TC       BANKCALL                              
040776,000097: 42,3757           20600                           CADR     GOMARKFR                              
040777,000098: 42,3760           05625                           TC       B5OFF                                 #  TERMINATE
040778,000099: 42,3761           05625                           TC       B5OFF                                 
040779,000100: 42,3762           05217                           TC       ENDOFJOB                              #  RECYCLE
040780,000101: 42,3763           35015                           CAF      BIT3                                  #  IMMEDIATE RETURN
040781,000102: 42,3764           05526                           TC       BLANKET                               #  BLANK R3
040782,000103: 42,3765           35017                           CAF      BIT1                                  #  DELAY MINIMUM TIME TO ALLOW DISPLAY IN
040783,000104: 42,3766           04662                           TC       BANKCALL                              
040784,000105: 42,3767           01732                           CADR     DELAYJOB                              
040785,000106: 42,3770           13654                           TCF      SBANDANT   +2                         
040786,000107: 42,3771           01463        V06N51             VN       0651                                  
040787,000108: 42,3772                        RCM                EQUALS   2D                                    
040788,000109: 42,3772                        UR                 EQUALS   8D                                    
040789,000110: 42,3772                        URP                EQUALS   14D                                   
040790,000111: 42,3772                        YAWANG             EQUALS   20D                                   
040791,000112: 42,3772                        PITCHANG           EQUALS   22D                                   
040792,000113: 42,3772  0000002               R                  EQUALS   RCM                                   
040793,000114: 42,3772  30,2000                                  SBANK=   LOWSUPER                              
040794,000115: 

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