Source Code

These source code files are an attempted reconstruction of Sundance revision 306, the Apollo 9 LM (Lunar Module) AGC (Apollo Guidance Computer) flight software, created from binary dumps of original core rope program modules, as follows:
  • B1 — Revision 292
  • B2 — Revision 302
  • B3 — Revision 302
  • B4 — Revision 302
  • B5 — Revision 292
  • B6 — Revision 306
These dumps were then modified using memos, checklists, observed address changes, and the Sundance GSOPs to get the entire program to match Sundance revision 306 as closely as possible. Without more information, it is not possible to say how close it actually is; however, this code should be quite close. It is capable of flying the whole Apollo 9 mission using the original checklists and padload. Since only binary dumps (rather than listings) of Sundance 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.

027545,000002:                                                                                                  ## Copyright:   Public domain.
027546,000003:                                                                                                  ## Filename:    R32.agc
027547,000004:                                                                                                  ## Purpose:     A section of an attempt to reconstruct Sundance revision 306
027548,000005:                                                                                                  ##              as closely as possible with available information. Sundance
027549,000006:                                                                                                  ##              306 is the source code for the Lunar Module's (LM) Apollo
027550,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 9. This program was created
027551,000008:                                                                                                  ##              using the mixed-revision SundanceXXX as a starting point, and
027552,000009:                                                                                                  ##              pulling back features from Luminary 69 believed to have been
027553,000010:                                                                                                  ##              added based on memos, checklists, observed address changes,
027554,000011:                                                                                                  ##              or the Sundance GSOPs.
027555,000012:                                                                                                  ## Assembler:   yaYUL
027556,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
027557,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
027558,000015:                                                                                                  ## Mod history: 2020-07-24 MAS  Created from SundanceXXX.
027559,000016: 
027560,000017: 
027561,000018: 
027562,000019:                                                                                                  #  1)    ROUTINE NAME - TARGET DELTA V PROGRAM (R32).
027563,000020:                                                                                                  #  2)    FUNCTIONAL DESCRIPTION - UPON ENTRY BY ASTRONAUT ACTION, R32 FLASHES DSKY REQUESTS TO THE ASTRONAUT
027564,000021:                                                                                                  #        TO PROVIDE VIA DSKY (1) THE DELTA V TO BE APPLIED TO THE OTHER VEHICLE STATE VECTOR AND (2) THE
027565,000022:                                                                                                  #        TIME (TIG) AT WHICH THE OTHER VEHICLE VELOCITY WAS CHANGED BY  EXECUTION OF A THRUSTING MANEUVER. THE
027566,000023:                                                                                                  #        OTHER VEHICLE STATE VECTOR IS INTEGRATED TO TIG AND UPDATED BY THE ADDITION OF DELTA V (DELTA V HAVING
027567,000024:                                                                                                  #        BEEN TRANSFORMED FROM LV TO REF COSYS).  USING INTEGRVS, THE   PROGRAM THEN INTEGRATES THE OTHER
027568,000025:                                                                                                  #  VEHICLE STATE VECTOR TO THE STATE VECTOR OF THIS VEHICLE, THUS INSURING THAT THE W-MATRIX AND BOTH VEHICLE
027569,000026:                                                                                                  #  STATES CORRESPOND TO THE SAME TIME.
027570,000027:                                                                                                  #  3)    ERASABLE INITIALIZATION REQUIRED - NONE.
027571,000028:                                                                                                  #  4)    CALLING SEQUENCES AND EXIT MODES - CALLED BY ASTRONAUT REQUEST THRU DSKY V 84 E.
027572,000029:                                                                                                  #        EXITS BY TCF ENDOFJOB.
027573,000030:                                                                                                  #  5)    OUTPUT - OTHER VEHICLE STATE VECTOR INTEGRATED TO TIG AND INCREMENTED BY DELTA V IN REF COSYS.
027574,000031:                                                                                                  #        THE PUSHLIST CONTAINS THE MATRIX BY WHICH THE INPUT DELTA V MUST BE POST-MULTIPLIED TO CONVERT FROM LV
027575,000032:                                                                                                  #        TO REF COSYS.
027576,000033:                                                                                                  #  6)    DEBRIS - OTHER VEHICLE STATE VECTOR.
027577,000034:                                                                                                  #  7)    SUBROUTINES CALLED - BANKCALL, GOXDSPF, CSMPREC (OR LEMPREC), ATOPCSM (OR ATOPLEM), INTSTALL, INTWAKE, PHASCHNG
027578,000035:                                                                                                  #        INTPRET, INTEGRVS, AND MINIRECT.
027579,000036:                                                                                                  #  8)    FLAG USE - MOONFLAG, CMOONFLAG, INTYPFLG, RASFLAG, AND MARKCTR.
027580,000037: 
027581,000038: 30,2000                                           BANK     30                                    
027582,000039: 13,2000                                           SETLOC   R32LOC                                
027583,000040: 13,2000                                           BANK                                           
027584,000041: 
027585,000042: 13,2161                                           COUNT*   $$/R32                                
027586,000043: 
027587,000044: 13,2161  E7,1424                                  EBANK=   TIG                                   
027588,000045: 
027589,000046: 13,2161           07766        JOBR32             TC       SETXDSP                               
027590,000047: 13,2162           06014                           TC       INTPRET                               
027591,000048: 13,2163           77414                           SET      EXIT                                  
027592,000049: 13,2164           04061                                    R32FLAG                               
027593,000050: 
027594,000051: 13,2165           32310                           CAF      V06N84                                #  FLASH LAST DELTA V,
027595,000052: 13,2166           04655                           TC       BANKCALL                              #  AND WAIT FOR KEYBOARD ACTION.
027596,000053: 13,2167           20226                           CADR     GOMARKF                               
027597,000054: 13,2170           02302                           TC       ENDR32                                
027598,000055: 13,2171           02173                           TC       +2                                    #  PROCEED
027599,000056: 13,2172           02165                           TC       -5                                    #  STORE DATA AND REPEAT FLASHING
027600,000057: 13,2173           32311                           CAF      V06N84     +1                         #  FLASH VERB 06 NOUN 33, DISPLAY LAST TIG,
027601,000058: 13,2174           04655                           TC       BANKCALL                              #  AND WAIT FOR KEYBOARD ACTION.
027602,000059: 13,2175           20226                           CADR     GOMARKF                               
027603,000060: 13,2176           02302                           TC       ENDR32                                
027604,000061: 13,2177           02201                           TC       +2                                    
027605,000062: 13,2200           02173                           TC       -5                                    
027606,000063: 13,2201           06014                           TC       INTPRET                               #  RETURN TO INTERPRETIVE CODE
027607,000064: 13,2202           77745                           DLOAD                                          #  SET D(MPAC)=TIG IN CSEC B28
027608,000065: 13,2203           03425                                    TIG                                   
027609,000066: 13,2204           34041                           STCALL   TDEC1                                 #  SET TDEC1=TIG FOR ORBITAL INTEGRATION
027610,000067: 13,2205           27014                                    OTHPREC                               
027611,000068: 13,2206           53575        COMPMAT            VLOAD    UNIT                                  
027612,000069: 13,2207           00001                                    RATT                                  
027613,000070: 13,2210           77676                           VCOMP                                          #  U(-R)
027614,000071: 13,2211           00031                           STORE    24D                                   #  U(-R) TO 24D
027615,000072: 13,2212           53435                           VXV      UNIT                                  #  U(-R) X V = U(V X R)
027616,000073: 13,2213           00007                                    VATT                                  
027617,000074: 13,2214           00023                           STORE    18D                                   
027618,000075: 13,2215           53435                           VXV      UNIT                                  #  U(V X R) X U(-R) = U((R X V) X R)
027619,000076: 13,2216           00031                                    24D                                   
027620,000077: 13,2217           24015                           STOVL    12D                                   
027621,000078: 13,2220           02231                                    DELVOV                                
027622,000079: 13,2221           76505                           VXM      VSL1                                  #  V(MPAC)=DELTA V IN REFCOSYS
027623,000080: 13,2222           00015                                    12D                                   
027624,000081: 13,2223           77655                           VAD                                            
027625,000082: 13,2224           00007                                    VATT                                  
027626,000083: 13,2225           00007                           STORE    6                                     #  V(PD6)=VATT + DELTA V
027627,000084: 13,2226           77624                           CALL                                           #  PREVENT WOULD-BE USER OF ORBITAL
027628,000085: 13,2227           27362                                    INTSTALL                              #  INTEG FROM INTERFERING WITH UPDATING
027629,000086: 13,2230           77624                           CALL                                           
027630,000087: 13,2231           26312                                    R32SUB1                               
027631,000088: 13,2232           53775                           VLOAD    VSR*                                  
027632,000089: 13,2233           00007                                    6                                     
027633,000090: 13,2234           57176                                    0,2                                   
027634,000091: 13,2235           25543                           STOVL    VCV                                   
027635,000092: 13,2236           00001                                    RATT                                  
027636,000093: 13,2237           77657                           VSR*                                           
027637,000094: 13,2240           57176                                    0,2                                   
027638,000095: 13,2241           15535                           STODL    RCV                                   
027639,000096: 13,2242           03425                                    TIG                                   
027640,000097: 13,2243           01517                           STORE    TET                                   
027641,000098: 13,2244           71214                           CLEAR    DLOAD                                 
027642,000099: 13,2245           01673                                    INTYPFLG                              
027643,000100: 13,2246           01643                                    TETTHIS                               
027644,000101: 13,2247           34041        INTOTHIS           STCALL   TDEC1                                 
027645,000102: 13,2250           27060                                    INTEGRVS                              
027646,000103: 13,2251           45014                           SET      CALL                                  
027647,000104: 13,2252           00471                                    NOUPFLAG                              
027648,000105: 13,2253           27362                                    INTSTALL                              
027649,000106: 13,2254           77775                           VLOAD                                          
027650,000107: 13,2255           00017                                    RATT1                                 
027651,000108: 13,2256           01503                           STORE    RRECT                                 
027652,000109: 13,2257           15535                           STODL    RCV                                   
027653,000110: 13,2260           00015                                    TAT                                   
027654,000111: 13,2261           25517                           STOVL    TET                                   
027655,000112: 13,2262           00025                                    VATT1                                 
027656,000113: 13,2263           77624                           CALL                                           
027657,000114: 13,2264           23354                                    MINIRECT                              
027658,000115: 13,2265           77776                           EXIT                                           
027659,000116: 
027660,000117: 13,2266           40774                           CS       RASFLAG                               
027661,000118: 13,2267           75025                           MASK     BIT2                                  
027662,000119: 13,2270           26774                           ADS      RASFLAG                               
027663,000120: 
027664,000121: 13,2271           06014                           TC       INTPRET                               
027665,000122: 13,2272           77624                           CALL                                           
027666,000123: 13,2273           26631                                    ATOPOTH                               
027667,000124: 13,2274           77531                           SSP      EXIT                                  
027668,000125: 13,2275           00053                                    QPRET                                 
027669,000126: 13,2276           26301                                    OUT                                   
027670,000127: 13,2277           04655                           TC       BANKCALL                              #  PERMIT USE OF ORBITAL INTEGRATION
027671,000128: 13,2300           27400                           CADR     INTWAKE                               
027672,000129: 13,2301           77776        OUT                EXIT                                           
027673,000130: 13,2302           06014        ENDR32             TC       INTPRET                               
027674,000131: 13,2303           77414                           CLEAR    EXIT                                  
027675,000132: 13,2304           04261                                    R32FLAG                               
027676,000133: 13,2305           35030                           CAF      ZERO                                  
027677,000134: 13,2306           55447                           TS       MARKCTR                               #  CLEAR RR TRACKING MARK COUNTER
027678,000135: 13,2307           15564                           TCF      ENDEXT                                
027679,000136: 
027680,000137: 13,2310           01524        V06N84             NV       0684                                  
027681,000138: 13,2311           01441                           NV       0633                                  
027682,000139: 13,2312           43174        R32SUB1            AXT,2    SET                                   
027683,000140: 13,2313           00002                                    2                                     
027684,000141: 13,2314           00063                                    MOONFLAG                              #  SET MEANS MOON IS SPHERE OF INFLUENCE.
027685,000142: 13,2315           77014                           BON      AXT,2                                 
027686,000143: 13,2316           04303                                    CMOONFLG                              #  SET MEANS PERM CM STATE IN LUNAR SPHERE.
027687,000144: 13,2317           00052                                    QPRET                                 
027688,000145: 13,2320           00000                                    0                                     
027689,000146: 13,2321           43414                           CLEAR    RVQ                                   
027690,000147: 13,2322           00263                                    MOONFLAG                              
027691,000148: 
027692,000149: 
027693,000150: 

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