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.

023741,000002:                                                                                                  ## Copyright:   Public domain.
023742,000003:                                                                                                  ## Filename:    P30,P37.agc
023743,000004:                                                                                                  ## Purpose:     A section of an attempt to reconstruct Sundance revision 306
023744,000005:                                                                                                  ##              as closely as possible with available information. Sundance
023745,000006:                                                                                                  ##              306 is the source code for the Lunar Module's (LM) Apollo
023746,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 9. This program was created
023747,000008:                                                                                                  ##              using the mixed-revision SundanceXXX as a starting point, and
023748,000009:                                                                                                  ##              pulling back features from Luminary 69 believed to have been
023749,000010:                                                                                                  ##              added based on memos, checklists, observed address changes,
023750,000011:                                                                                                  ##              or the Sundance GSOPs.
023751,000012:                                                                                                  ## Assembler:   yaYUL
023752,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
023753,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
023754,000015:                                                                                                  ## Mod history: 2020-07-24 MAS  Created from SundanceXXX.
023755,000016: 
023756,000017: 
023757,000018: 
023758,000019:                                                                                                  #  PROGRAM DESCRIPTION P30       DATE 3-6-67
023759,000020: 
023760,000021:                                                                                                  #  MOD.1 BY RAMA AIYAWAR
023761,000022:                                                                                                  #  FUNCTIONAL DESCRIPTION
023762,000023:                                                                                                  #        ACCEPT ASTRONAUT INPUTS OF TIG,DELV(LV)
023763,000024:                                                                                                  #        CALL IMU STATUS CHECK ROUTINE (R02)
023764,000025:                                                                                                  #        DISPLAY TIME TO GO, APOGEE, PERIGEE, DELV(MAG), MGA AT IGN
023765,000026:                                                                                                  #        REQUEST BURN PROGRAM
023766,000027: 
023767,000028:                                                                                                  #  CALLING SEQUENCE VIA JOB FROM V37
023768,000029: 
023769,000030:                                                                                                  #  EXIT VIA V37 CALL OR TO GOTOPOOH (V34E)
023770,000031: 
023771,000032:                                                                                                  #  SUBROUTINE CALLS -    FLAGUP, PHASCHNG, BANKCALL, ENDOFJOB, GOFLASH, GOFLASHR
023772,000033:                                                                                                  #                        GOPERF3R, INTPRET, BLANKET, GOTOPOOH, R02BOTH, S30.1,
023773,000034:                                                                                                  #                        TTG/N35, MIDGIM, DISPMGA
023774,000035: 
023775,000036:                                                                                                  #  ERASABLE INITIALIZATION - STATE VECTOR
023776,000037: 
023777,000038:                                                                                                  #  OUTPUT-RINIT, VINIT, +MGA, VTIG, RTIG, DELVSIN, DELVSAB, DELVSLV, HAPO,
023778,000039:                                                                                                  #         HPER, TTOGO
023779,000040: 
023780,000041:                                                                                                  #  DEBRIS- A,L, MPAC, PUSHLIST
023781,000042: 
023782,000043: 32,2671                                           BANK     32                                    
023783,000044: 35,2000                                           SETLOC   P30S                                  
023784,000045: 35,2000                                           BANK                                           
023785,000046: 35,2000  E4,1660                                  EBANK=   +MGA                                  
023786,000047: 35,2000                                           COUNT*   $$/P30                                
023787,000048: 
023788,000049: 35,2000           77420        REVN1645           STQ      EXIT                                  #  TRKMKCNT, TTOGO, +MGA
023789,000050: 35,2001           03652                                    QTEMP1                                
023790,000051: 
023791,000052: 35,2002           02465                           TC       COMPTGO                               
023792,000053: 35,2003           33627                           CAF      V16N45                                
023793,000054: 35,2004           04655                           TC       BANKCALL                              
023794,000055: 35,2005           20544                           CADR     GOFLASHR                              
023795,000056: 35,2006           04106                           TC       GOTOPOOH                              
023796,000057: 35,2007           02014                           TC       +5                                    
023797,000058: 35,2010           02003                           TC       -5                                    
023798,000059: 35,2011           05423                           TC       PHASCHNG                              
023799,000060: 35,2012           00014                           OCT      00014                                 
023800,000061: 35,2013           05225                           TC       ENDOFJOB                              
023801,000062: 
023802,000063: 35,2014           35026                           CAF      ONE                                   
023803,000064: 35,2015           55175                           TS       DISPDEX                               
023804,000065: 35,2016           06014                           TC       INTPRET                               
023805,000066: 35,2017           77650                           GOTO                                           
023806,000067: 35,2020           03652                                    QTEMP1                                
023807,000068: 
023808,000069: 35,2021           05566        P30                TC       UPFLAG                                #  SET UPDATE FLAG
023809,000070: 35,2022           00027                           ADRES    UPDATFLG                              
023810,000071: 35,2023           05566                           TC       UPFLAG                                #  SET TRACK FLAG
023811,000072: 35,2024           00031                           ADRES    TRACKFLG                              
023812,000073: 
023813,000074: 35,2025           32114        P30N33             CAF      V06N33                                #  T OF IGN
023814,000075: 35,2026           04655                           TC       BANKCALL                              
023815,000076: 35,2027           20544                           CADR     GOFLASHR                              
023816,000077: 35,2030           14106                           TCF      GOTOPOOH                              
023817,000078: 35,2031           12036                           TCF      +5                                    
023818,000079: 35,2032           12025                           TCF      -5                                    
023819,000080: 35,2033           05423                           TC       PHASCHNG                              
023820,000081: 35,2034           00014                           OCT      00014                                 
023821,000082: 35,2035           05225                           TC       ENDOFJOB                              
023822,000083: 
023823,000084: 35,2036           32115                           CAF      V06N82                                #  DISPLAY DELTA V (LV)
023824,000085: 35,2037           04655                           TC       BANKCALL                              
023825,000086: 35,2040           20406                           CADR     GOFLASH                               
023826,000087: 35,2041           14106                           TCF      GOTOPOOH                              
023827,000088: 35,2042           12044                           TCF      +2                                    
023828,000089: 35,2043           12036                           TCF      -5                                    
023829,000090: 
023830,000091: 35,2044           05600                           TC       DOWNFLAG                              #  RESET UPDATE FLAG
023831,000092: 35,2045           00027                           ADRES    UPDATFLG                              
023832,000093: 35,2046           06014                           TC       INTPRET                               
023833,000094: 35,2047           77624                           CALL                                           
023834,000095: 35,2050           70000                                    S30.1                                 
023835,000096: 35,2051           77745                           DLOAD                                          
023836,000097: 35,2052           00005                                    4D                                    
023837,000098: 35,2053           16261                           STODL    HAPO                                  
023838,000099: 35,2054           00011                                    8D                                    
023839,000100: 35,2055           02263                           STORE    HPER                                  
023840,000101: 35,2056           77414                           SET      EXIT                                  
023841,000102: 35,2057           00470                                    UPDATFLG                              
023842,000103: 35,2060           32116        PARAM30            CAF      V06N42                                #  DISPLAY APOGEE,PERIGEE ,DELTA V
023843,000104: 35,2061           04655                           TC       BANKCALL                              
023844,000105: 35,2062           20406                           CADR     GOFLASH                               
023845,000106: 35,2063           04106                           TC       GOTOPOOH                              
023846,000107: 35,2064           12066                           TCF      +2                                    
023847,000108: 35,2065           12060                           TCF      PARAM30                               
023848,000109: 
023849,000110: 35,2066           35012                           CAF      REFSMBIT                              
023850,000111: 35,2067           70077                           MASK     FLAGWRD3                              
023851,000112: 35,2070           00006                           EXTEND                                         
023852,000113: 35,2071           12102                           BZF      MINMGA                                
023853,000114: 
023854,000115: 35,2072           06014                           TC       INTPRET                               
023855,000116: 35,2073           77214                           SET      VLOAD                                 
023856,000117: 35,2074           01072                                    AVFLAG                                
023857,000118: 35,2075           03643                                    DELVSIN                               
023858,000119: 35,2076           45006                           PUSH     CALL                                  
023859,000120: 35,2077           20002                                    MIDGIM                                
023860,000121: 35,2100           77650                           GOTO                                           
023861,000122: 35,2101           72107                                    DISPMANV                              
023862,000123: 
023863,000124: 35,2102           06014        MINMGA             TC       INTPRET                               
023864,000125: 35,2103           43345                           DLOAD    DAD                                   
023865,000126: 35,2104           33642                                    DP-.01                                
023866,000127: 35,2105           33642                                    DP-.01                                
023867,000128: 35,2106           02261                           STORE    +MGA                                  
023868,000129: 35,2107           77624        DISPMANV           CALL                                           
023869,000130: 35,2110           72000                                    REVN1645                              
023870,000131: 35,2111           77414                           SET      EXIT                                  
023871,000132: 35,2112           01067                                    XDELVFLG                              
023872,000133: 
023873,000134: 35,2113           04106                           TC       GOTOPOOH                              
023874,000135: 
023875,000136: 35,2114           01441        V06N33             VN       0633                                  
023876,000137: 35,2115           01522        V06N82             VN       0682                                  
023877,000138: 35,2116           01452        V06N42             VN       0642                                  
023878,000139: 35,2117           01455        V06N45             VN       0645                                  
023879,000140: 
023880,000141:                                                                                                  #  PROGRAM DESCRIPTION S30.1     DATE 9NOV66
023881,000142: 
023882,000143:                                                                                                  #  MOD NO 1                      LOG SECTION P30,P37
023883,000144:                                                                                                  #  MOD BY RAMA AIYAWAR **
023884,000145: 
023885,000146:                                                                                                  #  FUNCTIONAL DESCRIPTION
023886,000147:                                                                                                  #        BASED ON STORED TARGET PARAMETERS(R OF IGNITION (RTIG), V OF
023887,000148:                                                                                                  #        IGNITION(VTIG), TIME OF IGNITION (TIG)),COMPUTE PERIGEE ALTITUDE
023888,000149:                                                                                                  #        APOGEE ALTITUDE AND DELTAV REQUIRED(DELVSIN).
023889,000150: 
023890,000151:                                                                                                  #  CALLING SEQUENCE
023891,000152:                                                                                                  #        L       CALL
023892,000153:                                                                                                  #        L+1             S30.1
023893,000154: 
023894,000155:                                                                                                  #  NORMAL EXIT MODE
023895,000156:                                                                                                  #        AT L+2 OR CALLING SEQUENCE (GOTO L+2)
023896,000157: 
023897,000158:                                                                                                  #  SUBROUTINES CALLED
023898,000159:                                                                                                  #        LEMPREC
023899,000160:                                                                                                  #        PERIAPO
023900,000161: 
023901,000162:                                                                                                  #  ALARM OR ABORT EXIT MODES
023902,000163:                                                                                                  #                NONE
023903,000164: 
023904,000165:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
023905,000166:                                                                                                  #        TIG             TIME OF IGNITION                DP B28CS
023906,000167:                                                                                                  #        DELVSLV         SPECIFIED DELTA-V IN LOCAL VERT.
023907,000168:                                                                                                  #                        COORDS. OF ACTIVE VEHICLE AT
023908,000169:                                                                                                  #                TIME OF IGNITION        VECTOR B+7 METERS/CS
023909,000170: 
023910,000171:                                                                                                  #  OUTPUT
023911,000172:                                                                                                  #        RTIG    POSITION AT TIG         VECTOR  B+29 METERS
023912,000173:                                                                                                  #        VTIG    VELOCITY AT TIG         VECTOR  B+29 METERS/CS
023913,000174:                                                                                                  #        PDL 4D  APOGEE ALTITUDE         DP      B+29 M ,  B+27 METERS.
023914,000175:                                                                                                  #        HAPO    APOGEE ALTITUDE         DP      B+29 METERS
023915,000176:                                                                                                  #        PDL 8D  PERIGEE ALTITUDE        DP      B+29 M ,  B+27 METERS.
023916,000177:                                                                                                  #        HPER    PERIGEE ALTITUDE        DP      B+29 METERS
023917,000178:                                                                                                  #        DELVSIN    SPECIFIED DELTA-V IN INERTIAL
023918,000179:                                                                                                  #                   COORD. OF ACTIVE VEHICLE AT
023919,000180:                                                                                                  #                TIME OF IGNITION        VECTOR  B+7 METERS/CS
023920,000181:                                                                                                  #        DELVSAB MAG. OF DELVSIN         VECTOR  B+7 METERS/CS
023921,000182: 
023922,000183:                                                                                                  #  DEBRIS        QTEMP   TEMP.ERASABLE
023923,000184:                                                                                                  #                QPRET, MPAC
023924,000185:                                                                                                  #                PUSHLIST
023925,000186: 
023926,000187: 34,2000                                           SETLOC   P30S1                                 
023927,000188: 34,2000                                           BANK                                           
023928,000189: 
023929,000190: 34,2000                                           COUNT*   $$/S30S                               
023930,000191: 
023931,000192: 34,2000           71220        S30.1              STQ      DLOAD                                 
023932,000193: 34,2001           03617                                    QTEMP                                 
023933,000194: 34,2002           03425                                    TIG                                   #  TIME IGNITION SCALED AT 2(+28)CS
023934,000195: 34,2003           34041                           STCALL   TDEC1                                 
023935,000196: 34,2004           27030                                    LEMPREC                               #  ENCKE ROUTINE FOR LEM
023936,000197: 
023937,000198: 34,2005           77775                           VLOAD                                          
023938,000199: 34,2006           00017                                    RATT1                                 
023939,000200: 34,2007           02655                           STORE    RVEC                                  
023940,000201: 34,2010           03627                           STORE    RTIG                                  #  RADIUS VECTOR AT IGNITION TIME
023941,000202: 34,2011           57456                           UNIT     VCOMP                                 
023942,000203: 34,2012           27643                           STOVL    DELVSIN                               #  ZRF/LV IN DELVSIN SCALED AT 2
023943,000204: 34,2013           00025                                    VATT1                                 #  VELOCITY VECTOR AT TIG, SCALED 2(7) M/CS
023944,000205: 34,2014           03635                           STORE    VTIG                                  
023945,000206: 34,2015           53435                           VXV      UNIT                                  
023946,000207: 34,2016           03627                                    RTIG                                  
023947,000208: 34,2017           77601                           SETPD                                          
023948,000209: 34,2020           00001                                    0                                     
023949,000210: 34,2021           47206                           PUSH     VXV                                   #  YRF/LV PDL 0 SCALED AT 2
023950,000211: 34,2022           03643                                    DELVSIN                               
023951,000212: 34,2023           63372                           VSL1     PDVL                                  
023952,000213: 34,2024           63315                           PDVL     PDVL                                  #  YRF/LV PDL 6 SCALED AT 2
023953,000214: 34,2025           03643                                    DELVSIN                               #  ZRF/LV PDL 12D SCALED AT 2
023954,000215: 34,2026           02267                                    DELVSLV                               
023955,000216: 34,2027           76505                           VXM      VSL1                                  
023956,000217: 34,2030           00001                                    0                                     
023957,000218: 34,2031           03643                           STORE    DELVSIN                               #  DELTAV IN INERT. COOR. SCALED TO B+7M/CS
023958,000219: 34,2032           77646                           ABVAL                                          
023959,000220: 34,2033           27651                           STOVL    DELVSAB                               #  DELTA V MAG.
023960,000221: 34,2034           03635                                    VTIG                                  #  (FOR PERIAPO)
023961,000222: 34,2035           77655                           VAD                                            #  VREQUIRED = VTIG + DELVSIN (FOR PERIAPO)
023962,000223: 34,2036           03643                                    DELVSIN                               
023963,000224: 34,2037           36744                           STCALL   VVEC                                  
023964,000225: 34,2040           46116                                    PERIAPO                               
023965,000226: 34,2041           77650                           GOTO                                           
023966,000227: 34,2042           03617                                    QTEMP                                 
023967,000228: 
023968,000229: 

End of include-file P30,P37.agc.  Parent file is MAIN.agc