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.

025490,000002:                                                                                                  ## Copyright:   Public domain.
025491,000003:                                                                                                  ## Filename:    GROUND_TRACKING_DETERMINATION_PROGRAM_-_P21.agc
025492,000004:                                                                                                  ## Purpose:     A section of an attempt to reconstruct Sundance revision 306
025493,000005:                                                                                                  ##              as closely as possible with available information. Sundance
025494,000006:                                                                                                  ##              306 is the source code for the Lunar Module's (LM) Apollo
025495,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 9. This program was created
025496,000008:                                                                                                  ##              using the mixed-revision SundanceXXX as a starting point, and
025497,000009:                                                                                                  ##              pulling back features from Luminary 69 believed to have been
025498,000010:                                                                                                  ##              added based on memos, checklists, observed address changes,
025499,000011:                                                                                                  ##              or the Sundance GSOPs.
025500,000012:                                                                                                  ## Assembler:   yaYUL
025501,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
025502,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
025503,000015:                                                                                                  ## Mod history: 2020-07-24 MAS  Created from SundanceXXX.
025504,000016: 
025505,000017: 
025506,000018: 
025507,000019:                                                                                                  #  GROUND TRACKING DETERMINATION PROGRAM P21
025508,000020:                                                                                                  #  PROGRAM DESCRIPTION
025509,000021:                                                                                                  #  MOD NO - 1
025510,000022:                                                                                                  #  MOD BY - N. M. NEVILLE
025511,000023: 
025512,000024:                                                                                                  #  FUNCTIONAL DECRIPTION -
025513,000025: 
025514,000026:                                                                                                  #  TO PROVIDE THE ASTRONAUT DETAILS OF THE LM OR CSM GROUND TRACK WITHOUT
025515,000027:                                                                                                  #  THE NEED FOR GROUND COMMUNICATION (REQUESTED BY DSKY).
025516,000028:                                                                                                  #  CALLING SEQUENCE -
025517,000029: 
025518,000030:                                                                                                  #        ASTRONAUT REQUEST THROUGH DSKY V37E21E
025519,000031:                                                                                                  #  SUBROUTINES CALLED -
025520,000032: 
025521,000033:                                                                                                  #  GOPERF4
025522,000034:                                                                                                  #  GOFLASH
025523,000035:                                                                                                  #  THISPREC
025524,000036:                                                                                                  #  OTHPREC
025525,000037:                                                                                                  #  LAT-LONG
025526,000038: 
025527,000039:                                                                                                  #  NORMAL EXIT MODES -
025528,000040: 
025529,000041:                                                                                                  #  ASTRONAUT REQUEST TROUGH DSKY TO TERMINATE PROGRAM V34E
025530,000042:                                                                                                  #  ALARM OR ABORT EXIT MODES -
025531,000043: 
025532,000044:                                                                                                  #  NONE
025533,000045:                                                                                                  #  OUTPUT -
025534,000046: 
025535,000047:                                                                                                  #  OCTAL DISPLAY OF OPTION CODE AND VEHICLE WHOSE GROUND TRACK IS TO BE
025536,000048:                                                                                                  #  COMPUTED
025537,000049:                                                                                                  #        OPTION CODE     00002
025538,000050:                                                                                                  #        THIS            00001
025539,000051:                                                                                                  #        OTHER           00002
025540,000052:                                                                                                  #  DECIMAL DISPLAY OF TIME TO BE INTEGRATED TO HOURS , MINUTES , SECONDS
025541,000053:                                                                                                  #  DECIMAL DISPLAY OF LAT,LONG,ALT
025542,000054: 
025543,000055:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
025544,000056: 
025545,000057:                                                                                                  #  AX0           2DEC    4.652459653 E-5 RADIANS         %68-69 CONSTANTS"
025546,000058: 
025547,000059:                                                                                                  #  -AY0          2DEC    2.147535898 E-5 RADIANS
025548,000060: 
025549,000061:                                                                                                  #  AZ0           2DEC    .7753206164     REVOLUTIONS
025550,000062:                                                                                                  #  FOR LUNAR ORBITS 504LM VECTOR IS NEEDED
025551,000063: 
025552,000064:                                                                                                  #  504LM         2DEC    -2.700340600 E-5 RADIANS
025553,000065: 
025554,000066:                                                                                                  #  504LM _2      2DEC    -7.514128400 E-4 RADIANS
025555,000067: 
025556,000068:                                                                                                  #  504LM _4      2DEC    _2.553198641 E-4 RADIANS
025557,000069: 
025558,000070:                                                                                                  #  NONE
025559,000071:                                                                                                  #  DEBRIS
025560,000072: 
025561,000073:                                                                                                  #  CENTRALS-A,Q,L
025562,000074:                                                                                                  #  OTHER - THOSE USED BY THE ABOVE LISTED SUBROUTINES
025563,000075:                                                                                                  #  SEE LEMPREC, LAT-LONG
025564,000076: 
025565,000077: 34,3411  30,2000                                  SBANK=   LOWSUPER                              #  FOR LOW 2CADR'S.
025566,000078: 
025567,000079: 33,2000                                           BANK     33                                    
025568,000080: 24,2000                                           SETLOC   P20S                                  
025569,000081: 24,2000                                           BANK                                           
025570,000082: 
025571,000083: 24,3120  E7,1745                                  EBANK=   P21TIME                               
025572,000084: 24,3120                                           COUNT*   $$/P21                                
025573,000085: 24,3120           35026        PROG21             CAF      ONE                                   
025574,000086: 24,3121           55156                           TS       OPTION2                               #  ASSUMED VEHICLE IS LM, R2 = 00001
025575,000087: 24,3122           35025                           CAF      BIT2                                  #  OPTION 2
025576,000088: 24,3123           04655                           TC       BANKCALL                              
025577,000089: 24,3124           20542                           CADR     GOPERF4                               
025578,000090: 24,3125           04106                           TC       GOTOPOOH                              #  TERMINATE
025579,000091: 24,3126           03130                           TC       +2                                    #  PROCEED VALUE OF ASSUMED VEHICLE OK
025580,000092: 24,3127           03122                           TC       -5                                    #  R2 LOADED THROUGH DSKY
025581,000093: 24,3130           33221        P21PROG1           CAF      V6N34                                 #  LOAD DESIRED TIME OF LAT-LONG.
025582,000094: 24,3131           04655                           TC       BANKCALL                              
025583,000095: 24,3132           20406                           CADR     GOFLASH                               
025584,000096: 24,3133           04106                           TC       GOTOPOOH                              #  TERM
025585,000097: 24,3134           03136                           TC       +2                                    #  PROCEED VALUES OK
025586,000098: 24,3135           03130                           TC       -5                                    #  TIME LOADED THROUGH DSKY
025587,000099: 24,3136           06014                           TC       INTPRET                               
025588,000100: 24,3137           77745                           DLOAD                                          
025589,000101: 24,3140           01047                                    DSPTEM1                               
025590,000102: 24,3141           03746                           STORE    P21TIME                               
025591,000103: 24,3142           45335                           SLOAD    DSU                                   
025592,000104: 24,3143           01157                                    OPTION2                               
025593,000105: 24,3144           11217                                    P21ONENN                              
025594,000106: 24,3145           71230                           BHIZ     DLOAD                                 
025595,000107: 24,3146           51161                                    P21PROG2                              #  VEHICLE TO BE INTEGRATED IS LEM
025596,000108: 24,3147           03746                                    P21TIME                               #  VEHICLE TO BE INTEGRATED IS CSM
025597,000109: 24,3150           34041                           STCALL   TDEC1                                 #  INTEGRATE TO TIME SPECIFIED IN TDEC
025598,000110: 24,3151           27014                                    OTHPREC                               #  ADJUST UNITS FOR LAT-LONG ROUTINE
025599,000111: 24,3152           46135        P21PROGA           SLOAD    BHIZ                                  
025600,000112: 24,3153           00050                                    X2                                    
025601,000113: 24,3154           51167                                    P21PROG3                              
025602,000114: 24,3155           43175                           VLOAD    SETGO                                 
025603,000115: 24,3156           00001                                    RATT                                  
025604,000116: 24,3157           01423                                    LUNAFLAG                              
025605,000117: 24,3160           51172                                    P21PROG4                              
025606,000118: 24,3161           77745        P21PROG2           DLOAD                                          
025607,000119: 24,3162           03746                                    P21TIME                               
025608,000120: 24,3163           34041                           STCALL   TDEC1                                 
025609,000121: 24,3164           27030                                    THISPREC                              
025610,000122: 24,3165           77650                           GOTO                                           
025611,000123: 24,3166           51152                                    P21PROGA                              
025612,000124: 24,3167           43175        P21PROG3           VLOAD    CLEAR                                 
025613,000125: 24,3170           00001                                    RATT                                  
025614,000126: 24,3171           01663                                    LUNAFLAG                              
025615,000127: 24,3172           16034        P21PROG4           STODL    ALPHAV                                
025616,000128: 24,3173           00015                                    TAT                                   
025617,000129: 24,3174           45014                           CLEAR    CALL                                  
025618,000130: 24,3175           00662                                    ERADFLAG                              
025619,000131: 24,3176           26323                                    LAT-LONG                              
025620,000132: 24,3177           77776                           EXIT                                           
025621,000133: 24,3200           33220                           CAF      V06N43                                #  DISPLAY LAT,LONG,ALT
025622,000134: 24,3201           04655                           TC       BANKCALL                              #  LAT,LONG = 1/2 REVS B0
025623,000135: 24,3202           20406                           CADR     GOFLASH                               #  ALT = KM B14
025624,000136: 24,3203           04106                           TC       GOTOPOOH                              #  TERM
025625,000137: 24,3204           04106                           TC       GOTOPOOH                              
025626,000138: 24,3205           06014                           TC       INTPRET                               #  V32E RECYCLE
025627,000139: 24,3206           43345                           DLOAD    DAD                                   
025628,000140: 24,3207           03746                                    P21TIME                               
025629,000141: 24,3210           11215                                    600SEC                                #  600 SECONDS OR 10 MIN
025630,000142: 24,3211           01047                           STORE    DSPTEM1                               
025631,000143: 24,3212           77634                           RTB                                            
025632,000144: 24,3213           51130                                    P21PROG1                              
025633,000145: 24,3214           00003 25140  600SEC             2DEC     60000      B-28                       #  10 MIN
025634,000146: 
025635,000147: 24,3216           00001        P21ONENN           OCT      00001                                 #  NEEDED TO DETERMINE VEHICLE
025636,000148: 24,3217           00000                           OCT      00000                                 #  TO BE INTEGRATED
025637,000149: 24,3220           01453        V06N43             VN       00643                                 
025638,000150: 24,3221           01442        V6N34              VN       00634                                 
025639,000151: 
025640,000152: 

End of include-file GROUND_TRACKING_DETERMINATION_PROGRAM_-_P21.agc.  Parent file is MAIN.agc