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.

025296,000002:                                                                                                  ## Copyright:   Public domain.
025297,000003:                                                                                                  ## Filename:    GENERAL_LAMBERT_AIMPOINT_GUIDANCE.agc
025298,000004:                                                                                                  ## Purpose:     A section of an attempt to reconstruct Sundance revision 306
025299,000005:                                                                                                  ##              as closely as possible with available information. Sundance
025300,000006:                                                                                                  ##              306 is the source code for the Lunar Module's (LM) Apollo
025301,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 9. This program was created
025302,000008:                                                                                                  ##              using the mixed-revision SundanceXXX as a starting point, and
025303,000009:                                                                                                  ##              pulling back features from Luminary 69 believed to have been
025304,000010:                                                                                                  ##              added based on memos, checklists, observed address changes,
025305,000011:                                                                                                  ##              or the Sundance GSOPs.
025306,000012:                                                                                                  ## Assembler:   yaYUL
025307,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
025308,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
025309,000015:                                                                                                  ## Mod history: 2020-07-24 MAS  Created from SundanceXXX.
025310,000016: 
025311,000017: 
025312,000018: 
025313,000019:                                                                                                  #  GENERAL LAMBERT AIMPOINT GUIDANCE **
025314,000020:                                                                                                  #  WRITTEN BY RAMA M AIYAWAR
025315,000021: 
025316,000022:                                                                                                  #  PROGRAM P-31 DESCRIPTION **
025317,000023: 
025318,000024:                                                                                                  #  1.    TO ACCEPT TARGETING PARAMETERS OBTAINED FROM A SOURCE EXTERNAL
025319,000025:                                                                                                  #        TO THE LEM AND COMPUTE THERE FROM THE REQUIRED-VELOCITY AND
025320,000026:                                                                                                  #        OTHER INITIAL CONDITIONS REQUIRED BY LM FOR DESIRED MANEUVER.
025321,000027:                                                                                                  #        THE TARGETING PARAMETERS ARE TIG (TIME OF IGNITION), TARGET 
025322,000028:                                                                                                  #        VECTOR (RTARG), AND THE TIME FROM TIG UNTIL THE TARGET IS
025323,000029:                                                                                                  #        REACHED(DELLT4), DESIRED TIME OF FLIGHT FROM RINIT TO RTARG..
025324,000030: 
025325,000031:                                                                                                  #  ASSUMPTIONS **
025326,000032: 
025327,000033:                                                                                                  #  1.    THE TARGET PARAMETERS MAY HAVE BEEN LOADED PRIOR TO THE
025328,000034:                                                                                                  #        EXECUTION OF THIS PROGRAM.
025329,000035:                                                                                                  #  2.    THIS PROGRAM IS APPLICABLE IN EITHER EARTH OR LUNAR ORBIT.
025330,000036:                                                                                                  #  3.    THIS PROGRAM IS DESIGNED FOR ONE-MAN OPERATION, AND SHOULD
025331,000037:                                                                                                  #        BE SELECTED BY THE ASTRONAUT BY DSKY ENTRY V37 E31.
025332,000038: 
025333,000039:                                                                                                  #  SUBROUTINES USED **
025334,000040:                                                                                                  #  
025335,000041:                                                                                                  #  MANUPARM, TTG/N35, R02BOTH, MIDGIM, DISPMGA, FLAGDOWN, BANKCALL,
025336,000042:                                                                                                  #  GOTOPOOH, ENDOFJOB, PHASCHNG, GOFLASHR, GOFLASH.
025337,000043: 
025338,000044:                                                                                                  #  MANUPARM      CALCULATES APOGEE, PERIGEE ALTITUDES AND DELTAV DESIRED
025339,000045:                                                                                                  #                FOR THE MANEUVER.
025340,000046: 
025341,000047:                                                                                                  #  TTG/N35       CLOCKTASK - UPDATES CLOCK.
025342,000048: 
025343,000049:                                                                                                  #  MIDGIM        CALCULATES MIDDLE GIMBAL ANGLE FOR DISPLAY.
025344,000050: 
025345,000051:                                                                                                  #  R02BOTH       IMU - STATUS CHECK ROUTINE.
025346,000052: 
025347,000053:                                                                                                  #  DISPLAYS USED IN P-31LM **
025348,000054: 
025349,000055:                                                                                                  #  V06N33        DISPLAY SOTRED TIG (IN HRS. MINS. SECS)
025350,000056:                                                                                                  #  V06N42        DISPLAY APOGEE, PERIGEE, DELTAV.
025351,000057:                                                                                                  #  V16N35        DISPLAY TIME FROM TIG.
025352,000058:                                                                                                  #  V06N45        TIME FROM IGNITION AND MIDDLE GIMBAL ANGLE.
025353,000059: 
025354,000060:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED **
025355,000061: 
025356,000062:                                                                                                  #  TIG           TIME OF IGNITION                DP      (B+28) CS.
025357,000063: 
025358,000064:                                                                                                  #  DELLT4        DESIRED TIME OF FLIGHT          DP      (B+28) CS
025359,000065:                                                                                                  #                FROM RINIT TO RTARG.
025360,000066:                                                                                                  #  RTARG         RADIUS VECTOR OF TARGET POSITION VECTOR
025361,000067:                                                                                                  #                RADIUS VECTOR   SCALED TO  (B+29)METERS IF EARTH ORBIT
025362,000068:                                                                                                  #                RADIUS VECTOR SCALED TO    (B+27)METERS IF MOON ORBIT
025363,000069: 
025364,000070:                                                                                                  #  OUTPUT **
025365,000071: 
025366,000072:                                                                                                  #  HAPO          APOGEE ALTITUDE
025367,000073:                                                                                                  #  HPER          PERIGEE ALTITUDE
025368,000074:                                                                                                  #  VGDISP        MAG.OF DELTAV FOR DISPLAY ,SCALING      B+7 M/CS EARTH
025369,000075:                                                                                                  #                MAG.OF DELTAV FOR DISPLAY, SCALING      B+5 M/CS MOON
025370,000076:                                                                                                  #  MIDGIM        MIDDLE GIMBAL ANGLE
025371,000077:                                                                                                  #  XDELVFLG      RESETS XDELVFLG FOR LAMBERT VG COMPUTATIONS
025372,000078: 
025373,000079:                                                                                                  #  ALARMS OR ABORTS      NONE **
025374,000080: 
025375,000081:                                                                                                  #  RESTARTS ARE VIA GROUP 4 **
025376,000082: 
025377,000083: 34,2000                                           SETLOC   GLM                                   
025378,000084: 34,2000                                           BANK                                           
025379,000085: 
025380,000086: 34,3254  E7,1455                                  EBANK=   SUBEXIT                               
025381,000087: 
025382,000088: 34,3254                                           COUNT*   $$/P31                                
025383,000089: 34,3254           05423        P31LM              TC       PHASCHNG                              
025384,000090: 34,3255           05024                           OCT      05024                                 
025385,000091: 34,3256           13000                           OCT      13000                                 
025386,000092: 
025387,000093: 34,3257           33342                           CAF      V06N33*                               #  TIG
025388,000094: 34,3260           04655                           TC       BANKCALL                              
025389,000095: 34,3261           20406                           CADR     GOFLASH                               
025390,000096: 34,3262           14106                           TCF      GOTOPOOH                              
025391,000097: 34,3263           13265                           TCF      +2                                    
025392,000098: 34,3264           13257                           TCF      -5                                    
025393,000099: 
025394,000100: 34,3265           06014                           TC       INTPRET                               
025395,000101: 34,3266           77624                           CALL                                           
025396,000102: 34,3267           71345                                    P31INT                                
025397,000103: 34,3270           77776                           EXIT                                           
025398,000104: 
025399,000105: 34,3271           33343                           CAF      V06N42*                               #  HAPO, HPER, VGDISP
025400,000106: 34,3272           04655                           TC       BANKCALL                              
025401,000107: 34,3273           20544                           CADR     GOFLASHR                              
025402,000108: 34,3274           14106                           TCF      GOTOPOOH                              
025403,000109: 34,3275           13302                           TCF      +5                                    
025404,000110: 34,3276           13271                           TCF      -5                                    
025405,000111: 34,3277           05423                           TC       PHASCHNG                              
025406,000112: 34,3300           00014                           OCT      00014                                 
025407,000113: 34,3301           05225                           TC       ENDOFJOB                              
025408,000114: 
025409,000115: 34,3302           04655                           TC       BANKCALL                              
025410,000116: 34,3303           72465                           CADR     COMPTGO                               
025411,000117: 34,3304           33344                           CAF      V16N35                                
025412,000118: 34,3305           03311                           TC       VNPOOH2                               
025413,000119: 34,3306           35006                           CAF      POSMAX                                
025414,000120: 34,3307           55175                           TS       DISPDEX                               
025415,000121: 34,3310           03325                           TC       P31EXIT                               
025416,000122: 
025417,000123: 34,3311           00006        VNPOOH2            EXTEND                                         
025418,000124: 34,3312           23452                           QXCH     RTRN                                  
025419,000125: 34,3313           55602                           TS       VERBNOUN                              
025420,000126: 34,3314           31602                           CA       VERBNOUN                              
025421,000127: 34,3315           04655                           TCR      BANKCALL                              
025422,000128: 34,3316           20544                           CADR     GOFLASHR                              
025423,000129: 34,3317           04106                           TC       GOTOPOOH                              
025424,000130: 34,3320           01452                           TC       RTRN                                  
025425,000131: 34,3321           13314                           TCF      -5                                    
025426,000132: 34,3322           05423                           TC       PHASCHNG                              
025427,000133: 34,3323           00014                           OCT      00014                                 
025428,000134: 34,3324           05225                           TC       ENDOFJOB                              
025429,000135: 
025430,000136: 34,3325           04655        P31EXIT            TC       BANKCALL                              
025431,000137: 34,3326           11067                           CADR     R02BOTH                               
025432,000138: 34,3327           06014                           TC       INTPRET                               
025433,000139: 34,3330           41575                           VLOAD    PUSH                                  
025434,000140: 34,3331           03363                                    DELVEET3                              
025435,000141: 34,3332           77624                           CALL                                           
025436,000142: 34,3333           20002                                    MIDGIM                                
025437,000143: 34,3334           77624                           CALL                                           
025438,000144: 34,3335           72000                                    REVN1645                              
025439,000145: 34,3336           77776                           EXIT                                           
025440,000146: 34,3337           05600                           TC       DOWNFLAG                              
025441,000147: 34,3340           00045                           ADRES    XDELVFLG                              
025442,000148: 34,3341           04106                           TC       GOTOPOOH                              
025443,000149: 
025444,000150: 34,3342           01441        V06N33*            VN       0633                                  
025445,000151: 34,3343           01452        V06N42*            VN       0642                                  
025446,000152: 34,3344           04043        V16N35             VN       1635                                  
025447,000153: 
025448,000154: 34,3345           71220        P31INT             STQ      DLOAD                                 
025449,000155: 34,3346           03617                                    QTEMP                                 
025450,000156: 34,3347           03425                                    TIG                                   
025451,000157: 34,3350           34041                           STCALL   TDEC1                                 #  INTEGRATE STATE VECTORS TO TIG
025452,000158: 34,3351           27030                                    LEMPREC                               
025453,000159: 34,3352           77330                           SXA,1    VLOAD                                 
025454,000160: 34,3353           02773                                    P30EXIT                               
025455,000161: 34,3354           00025                                    VATT1                                 
025456,000162: 34,3355           26347                           STOVL    VINIT                                 
025457,000163: 34,3356           00017                                    RATT1                                 
025458,000164: 34,3357           02341                           STORE    RINIT                                 
025459,000165: 34,3360           67201                           SETPD    SLOAD                                 
025460,000166: 34,3361           00001                                    0D                                    
025461,000167: 34,3362           14423                                    P31ZERO                               
025462,000168: 34,3363           41525                           PDDL     PUSH                                  #  E4 AND NUMIT = 0
025463,000169: 34,3364           31410                                    P31ANGLE                              
025464,000170: 34,3365           77624                           CALL                                           
025465,000171: 34,3366           22022                                    INITVEL                               
025466,000172: 34,3367           77350                           LXA,1    VLOAD                                 
025467,000173: 34,3370           02773                                    P30EXIT                               
025468,000174: 34,3371           03363                                    DELVEET3                              
025469,000175: 34,3372           77646                           ABVAL                                          
025470,000176: 34,3373           27651                           STOVL    VGDISP                                
025471,000177: 34,3374           02357                                    VIPRIME                               
025472,000178: 34,3375           26744                           STOVL    VVEC                                  
025473,000179: 34,3376           02341                                    RINIT                                 
025474,000180: 34,3377           36655                           STCALL   RVEC                                  
025475,000181: 34,3400           46116                                    PERIAPO                               
025476,000182: 34,3401           77745                           DLOAD                                          
025477,000183: 34,3402           00005                                    4D                                    
025478,000184: 34,3403           16261                           STODL    HAPO                                  
025479,000185: 34,3404           00011                                    8D                                    
025480,000186: 34,3405           36263                           STCALL   HPER                                  
025481,000187: 34,3406           03617                                    QTEMP                                 
025482,000188: 
025483,000189: 34,3407           01616 07071  P31ANGLE           2DEC     .0555555555                            
025484,000190: 34,3411  26,2422               P31ZERO            =        1BITDP                                
025485,000191: 
025486,000192: 
025487,000193: 

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