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.

021244,000002:                                                                                                  ## Copyright:   Public domain.
021245,000003:                                                                                                  ## Filename:    P76.agc
021246,000004:                                                                                                  ## Purpose:     A section of Comanche revision 067.
021247,000005:                                                                                                  ##              It is part of the reconstructed source code for the flight
021248,000006:                                                                                                  ##              software for the Command Module's (CM) Apollo Guidance Computer
021249,000007:                                                                                                  ##              (AGC) for Apollo 12. No original listings of this program are
021250,000008:                                                                                                  ##              available; instead, this file was created via dissassembly of
021251,000009:                                                                                                  ##              dumps of Comanche 067 core rope modules and comparison with
021252,000010:                                                                                                  ##              other AGC programs.
021253,000011:                                                                                                  ## Assembler:   yaYUL
021254,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
021255,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
021256,000014:                                                                                                  ## Mod history: 2023-08-16 MAS  Created from Comanche 055.
021257,000015:                                                                                                  ##              2024-05-13 MAS  Updated for Comanche 067.
021258,000016: 
021259,000017:                                                                                                  #  1)    PROGRAM NAME - TARGET DELTA V PROGRAM (P76).
021260,000018:                                                                                                  #  2)    FUNCTIONAL DESCRIPTION - UPON ENTRY BY ASTRONAUT ACTION, P76 FLASHES DSKY REQUESTS TO THE ASTRONAUT
021261,000019:                                                                                                  #        TO PROVIDE VIA DSKY (1) THE DELTA V TO BE APPLIED TO THE OTHER VEHICLE STATE VECTOR AND (2) THE
021262,000020:                                                                                                  #        TIME (TIG) AT WHICH THE OTHER VEHICLE VELOCITY WAS CHANGED BY EXECUTION OF A THRUSTING MANEUVER. THE
021263,000021:                                                                                                  #        OTHER VEHICLE STATE VECTOR IS INTEGRATED TO TIG AND UPDATED BY THE ADDITION OF DELTA V (DELTA V HAVING
021264,000022:                                                                                                  #        BEEN TRANSFORMED FROM LV TO REF COSYS).  USING INTEGRVS, THE PROGRAM THEN INTEGRATES THE OTHER
021265,000023:                                                                                                  #        VEHICLE STATE VECTOR TO THE STATE VECTOR OF THIS VEHICLE, THUS INSURING THAT THE W-MATRIX AND BOTH VEHICLE
021266,000024:                                                                                                  #        STATES CORRESPOND TO THE SAME TIME.
021267,000025:                                                                                                  #  3)    ERASABLE INITIALIZATION REQUIRED - NONE.
021268,000026:                                                                                                  #  4)    CALLING SEQUENCES AND EXIT MODES - CALLED BY ASTRONAUT REQUEST THRU DSKY V 37 E 76E.
021269,000027:                                                                                                  #        EXITS BY TCF ENDOFJOB.
021270,000028:                                                                                                  #  5)    OUTPUT - OTHER VEHICLE STATE VECTOR INTEGRATED TO TIG AND INCREMENTED BY DELTA V IN REF COSYS.
021271,000029:                                                                                                  #        THE PUSHLIST CONTAINS THE MATRIX BY WHICH THE INPUT DELTA V MUST BE POST-MULTIPLIED TO CONVERT FROM LV
021272,000030:                                                                                                  #        TO REF COSYS.
021273,000031:                                                                                                  #  6)    DEBRIS - OTHER VEHICLE STATE VECTOR.
021274,000032:                                                                                                  #  7)    SUBROUTINES CALLED - BANKCALL, GOXDSPF, CSMPREC (OR LEMPREC), ATOPCSM (OR ATOPLEM), INTSTALL, INTWAKE, PHASCHNG
021275,000033:                                                                                                  #        INTPRET, INTEGRVS, AND MINIRECT.
021276,000034:                                                                                                  #  8)    FLAG USE - MOONFLAG, CMOONFLAG, INTYPFLG, RASFLAG, AND MARKCTR.
021277,000035: 
021278,000036: 30,2000                                           BANK     30                                    
021279,000037: 13,2000                                           SETLOC   P76LOC                                
021280,000038: 13,2000                                           BANK                                           
021281,000039: 
021282,000040: 13,2071                                           COUNT*   $$/P76                                
021283,000041: 
021284,000042: 13,2071  E7,1412                                  EBANK=   TIG                                   
021285,000043: 
021286,000044: 13,2071           05562        P76                TC       UPFLAG                                
021287,000045: 13,2072           00031                           ADRES    TRACKFLG                              
021288,000046: 
021289,000047: 13,2073           32221                           CAF      V06N84     +1                         #  FLASH VERB 06 NOUN 33, DISPLAY LAST TIG,
021290,000048: 13,2074           04676                           TC       BANKCALL                              #  AND WAIT FOR KEYBOARD ACTION.
021291,000049: 13,2075           20720                           CADR     GOFLASH                               
021292,000050: 13,2076           12212                           TCF      ENDP76                                
021293,000051: 13,2077           02101                           TC       +2                                    #  PROCEED
021294,000052: 13,2100           02073                           TC       -5                                    #  STORE DATA AND REPEAT FLASHING
021295,000053: 13,2101           32220                           CAF      V06N84                                #  FLASH LAST DELTA V,
021296,000054: 13,2102           04676                           TC       BANKCALL                              #  AND WAIT FOR KEYBOARD ACTION.
021297,000055: 13,2103           20720                           CADR     GOFLASH                               
021298,000056: 13,2104           12212                           TCF      ENDP76                                
021299,000057: 13,2105           02107                           TC       +2                                    
021300,000058: 13,2106           02101                           TC       -5                                    
021301,000059: 13,2107           06006                           TC       INTPRET                               #  RETURN TO INTERPRETIVE CODE
021302,000060: 13,2110           77745                           DLOAD                                          #  SET D(MPAC)=TIG IN CSEC B28
021303,000061: 13,2111           03413                                    TIG                                   
021304,000062: 13,2112           34041                           STCALL   TDEC1                                 #  SET TDEC1=TIG FOR ORBITAL INTEGRATION
021305,000063: 13,2113           27115                                    OTHPREC                               
021306,000064: 13,2114           53575        COMPMAT            VLOAD    UNIT                                  
021307,000065: 13,2115           00001                                    RATT                                  
021308,000066: 13,2116           77676                           VCOMP                                          #  U(-R)
021309,000067: 13,2117           00031                           STORE    24D                                   #  U(-R) TO 24D
021310,000068: 13,2120           53435                           VXV      UNIT                                  #  U(-R) X V = U(V X R)
021311,000069: 13,2121           00007                                    VATT                                  
021312,000070: 13,2122           00023                           STORE    18D                                   
021313,000071: 13,2123           53435                           VXV      UNIT                                  #  U(V X R) X U(-R) = U((R X V) X R)
021314,000072: 13,2124           00031                                    24D                                   
021315,000073: 13,2125           24015                           STOVL    12D                                   
021316,000074: 13,2126           03540                                    DELVOV                                
021317,000075: 13,2127           76505                           VXM      VSL1                                  #  V(MPAC)=DELTA V IN REFCOSYS
021318,000076: 13,2130           00015                                    12D                                   
021319,000077: 13,2131           77655                           VAD                                            
021320,000078: 13,2132           00007                                    VATT                                  
021321,000079: 13,2133           00007                           STORE    6                                     #  V(PD6)=VATT + DELTA V
021322,000080: 13,2134           77624                           CALL                                           #  PREVENT WOULD-BE USER OF ORBITAL
021323,000081: 13,2135           27452                                    INTSTALL                              #  INTEG FROM INTERFERING WITH UPDATING
021324,000082: 13,2136           77624                           CALL                                           
021325,000083: 13,2137           26222                                    P76SUB1                               
021326,000084: 13,2140           53775                           VLOAD    VSR*                                  
021327,000085: 13,2141           00007                                    6                                     
021328,000086: 13,2142           57176                                    0,2                                   
021329,000087: 13,2143           25543                           STOVL    VCV                                   
021330,000088: 13,2144           00001                                    RATT                                  
021331,000089: 13,2145           77657                           VSR*                                           
021332,000090: 13,2146           57176                                    0,2                                   
021333,000091: 13,2147           15535                           STODL    RCV                                   
021334,000092: 13,2150           03413                                    TIG                                   
021335,000093: 13,2151           01517                           STORE    TET                                   
021336,000094: 13,2152           71214                           CLEAR    DLOAD                                 
021337,000095: 13,2153           01673                                    INTYPFLG                              
021338,000096: 13,2154           01571                                    TETTHIS                               
021339,000097: 13,2155           34041        INTOTHIS           STCALL   TDEC1                                 
021340,000098: 13,2156           27145                                    INTEGRVS                              
021341,000099: 13,2157           77624                           CALL                                           
021342,000100: 13,2160           27452                                    INTSTALL                              
021343,000101: 13,2161           77624                           CALL                                           
021344,000102: 13,2162           26222                                    P76SUB1                               #  SET/CLEAR MOONFLAG
021345,000103: 13,2163           77775                           VLOAD                                          
021346,000104: 13,2164           00017                                    RATT1                                 
021347,000105: 13,2165           01503                           STORE    RRECT                                 
021348,000106: 13,2166           15535                           STODL    RCV                                   
021349,000107: 13,2167           00015                                    TAT                                   
021350,000108: 13,2170           25517                           STOVL    TET                                   
021351,000109: 13,2171           00025                                    VATT1                                 
021352,000110: 13,2172           77624                           CALL                                           
021353,000111: 13,2173           23417                                    MINIRECT                              
021354,000112: 13,2174           77776                           EXIT                                           
021355,000113: 13,2175           05426                           TC       PHASCHNG                              
021356,000114: 13,2176           04024                           OCT      04024                                 
021357,000115: 13,2177           05562                           TC       UPFLAG                                
021358,000116: 13,2200           00236                           ADRES    REINTFLG                              
021359,000117: 
021360,000118: 13,2201           06006                           TC       INTPRET                               
021361,000119: 13,2202           77624                           CALL                                           
021362,000120: 13,2203           26770                                    ATOPOTH                               
021363,000121: 13,2204           77531                           SSP      EXIT                                  
021364,000122: 13,2205           00053                                    QPRET                                 
021365,000123: 13,2206           26211                                    OUT                                   
021366,000124: 13,2207           04676                           TC       BANKCALL                              #  PERMIT USE OF ORBITAL INTEGRATION
021367,000125: 13,2210           27507                           CADR     INTWAKE1                              
021368,000126: 13,2211           77776        OUT                EXIT                                           
021369,000127: 13,2212           35035        ENDP76             CAF      ZERO                                  
021370,000128: 13,2213           55126                           TS       MARKCTR                               #  CLEAR RR TRACKING MARK COUNTER
021371,000129: 13,2214           55125                           TS       VHFCNT                                
021372,000130: 
021373,000131: 13,2215           37716                           CAF      NEGONE                                
021374,000132: 13,2216           55734                           TS       MRKBUF2                               #  INVALIDATE MARK BUFFER
021375,000133: 
021376,000134: 13,2217           14106                           TCF      GOTOPOOH                              
021377,000135: 
021378,000136: 13,2220           01524        V06N84             NV       0684                                  
021379,000137: 13,2221           01441                           NV       0633                                  
021380,000138: 13,2222           67214        P76SUB1            CLEAR    SLOAD                                 
021381,000139: 13,2223           00263                                    MOONFLAG                              
021382,000140: 13,2224           00050                                    X2                                    
021383,000141: 13,2225           43030                           BHIZ     SET                                   #  X2=0...CLEAR MOONFLAG
021384,000142: 13,2226           26230                                    +2                                    #    =2.....SET MOONFLAG
021385,000143: 13,2227           00063                                    MOONFLAG                              
021386,000144: 13,2230           77616                           RVQ                                            
021387,000145: 

End of include-file P76.agc.  Parent file is MAIN.agc