Source Code

These source-code files are part of a reconstructed copy of Luminary 96, the original release of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with reconstructed source code for Luminary 97. Changes between revisions 96 and 97 were backed out, as described by anomal report LNY-59. transcribed from a digitized copy of that program. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152D. Note that page numbers in the reconstructed code match those on the Luminary 099 revision 001 printout, although the added code would likely have changed page numbers for a real Luminary 96 listing.

Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

027448,000002:                                                                                                  ## Copyright:   Public domain.
027449,000003:                                                                                                  ## Filename:    LAMBERT_AIMPOINT_GUIDANCE.agc
027450,000004:                                                                                                  ## Purpose:     A section of Luminary revision 96.
027451,000005:                                                                                                  ##              It is part of the reconstructed source code for the
027452,000006:                                                                                                  ##              original release of the flight software for the Lunar 
027453,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
027454,000008:                                                                                                  ##              The code has been recreated from a previously reconstructed
027455,000009:                                                                                                  ##              copy of Luminary 97 by undoing changes described in anomaly
027456,000010:                                                                                                  ##              report LNY-59. The code has been adapted such that the
027457,000011:                                                                                                  ##              resulting bugger words exactly match those specified for
027458,000012:                                                                                                  ##              Luminary 96 in NASA drawing 2021152D, which gives relatively
027459,000013:                                                                                                  ##              high confidence that the reconstruction is correct.
027460,000014:                                                                                                  ## Reference:   pp. 651-653
027461,000015:                                                                                                  ## Assembler:   yaYUL
027462,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
027463,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
027464,000018:                                                                                                  ## Mod history: 2019-08-04 MAS  Created from Luminary 97.
027465,000019: 

Page 651

027467,000021: 
027468,000022:                                                                                                  #  GENERAL LAMBERT AIMPOINT GUIDANCE **
027469,000023:                                                                                                  #  WRITTEN BY RAMA M AIYAWAR
027470,000024: 
027471,000025:                                                                                                  #  PROGRAM P-31 DESCRIPTION **
027472,000026: 
027473,000027:                                                                                                  #  1.    TO ACCEPT TARGETING PARAMETERS OBTAINED FROM A SOURCE EXTERNAL
027474,000028:                                                                                                  #        TO THE LEM AND COMPUTE THERE FROM THE REQUIRED-VELOCITY AND
027475,000029:                                                                                                  #        OTHER INITIAL CONDITIONS REQUIRED BY LM FOR DESIRED MANEUVER.
027476,000030:                                                                                                  #        THE TARGETING PARAMETERS ARE TIG (TIME OF IGNITION), TARGET 
027477,000031:                                                                                                  #        VECTOR (RTARG), AND THE TIME FROM TIG UNTIL THE TARGET IS
027478,000032:                                                                                                  #        REACHED (DELLT4), DESIRED TIME OF FLIGHT FROM RINIT TO RTARG..
027479,000033: 
027480,000034:                                                                                                  #  ASSUMPTIONS **
027481,000035: 
027482,000036:                                                                                                  #  1.    THE TARGET PARAMETERS MAY HAVE BEEN LOADED PRIOR TO THE
027483,000037:                                                                                                  #        EXECUTION OF THIS PROGRAM.
027484,000038:                                                                                                  #  2.    THIS PROGRAM IS APPLICABLE IN EITHER EARTH OR LUNAR ORBIT.
027485,000039:                                                                                                  #  3.    THIS PROGRAM IS DESIGNED FOR ONE-MAN OPERATION, AND SHOULD
027486,000040:                                                                                                  #        BE SELECTED BY THE ASTRONAUT BY DSKY ENTRY V37 E31.
027487,000041: 
027488,000042:                                                                                                  #  SUBROUTINES USED **
027489,000043:                                                                                                  #  
027490,000044:                                                                                                  #  MANUPARM, TTG/N35, R02BOTH, MIDGIM, DISPMGA, FLAGDOWN, BANKCALL,
027491,000045:                                                                                                  #  GOTOPOOH, ENDOFJOB, PHASCHNG, GOFLASHR, GOFLASH.
027492,000046: 
027493,000047:                                                                                                  #  MANUPARM      CALCULATES APOGEE, PERIGEE ALTITUDES AND DELTAV DESIRED
027494,000048:                                                                                                  #                FOR THE MANEUVER.
027495,000049: 
027496,000050:                                                                                                  #  TTG/N35       CLOCKTASK - UPDATES CLOCK.
027497,000051: 
027498,000052:                                                                                                  #  MIDGIM        CALCULATES MIDDLE GIMBAL ANGLE FOR DISPLAY.
027499,000053: 
027500,000054:                                                                                                  #  R02BOTH       IMU - STATUS CHECK ROUTINE.
027501,000055: 
027502,000056:                                                                                                  #  DISPLAYS USED IN P-31LM **
027503,000057: 
027504,000058:                                                                                                  #  V06N33        DISPLAY SOTRED TIG (IN HRS. MINS. SECS)
027505,000059:                                                                                                  #  V06N42        DISPLAY APOGEE, PERIGEE, DELTAV.
027506,000060:                                                                                                  #  V16N35        DISPLAY TIME FROM TIG.
027507,000061:                                                                                                  #  V06N45        TIME FROM IGNITION AND MIDDLE GIMBAL ANGLE.
027508,000062: 
027509,000063:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED **
027510,000064: 
027511,000065:                                                                                                  #  TIG           TIME OF IGNITION                DP      (B+28) CS.
027512,000066: 
027513,000067:                                                                                                  #  DELLT4        DESIRED TIME OF FLIGHT          DP      (B+28) CS
027514,000068:                                                                                                  #                FROM RINIT TO RTARG.
027515,000069: 
027516,000070:                                                                                                  #  RTARG         RADIUS VECTOR OF TARGET POSITION VECTOR
027517,000071:                                                                                                  #                RADIUS VECTOR SCALED TO (B+29)METERS IF EARTH ORBIT

Page 652

027519,000073:                                                                                                  #                RADIUS VECTOR SCALED TO (B+27)METERS IF MOON ORBIT
027520,000074: 
027521,000075:                                                                                                  #  OUTPUT **
027522,000076: 
027523,000077:                                                                                                  #  HAPO          APOGEE ALTITUDE
027524,000078:                                                                                                  #  HPER          PERIGEE ALTITUDE
027525,000079:                                                                                                  #  VGDISP        MAG. OF DELTAV FOR DISPLAY, SCALING     B+7 M/CS EARTH
027526,000080:                                                                                                  #                MAG. OF DELTAV FOR DISPLAY, SCALING     B+5 M/CS MOON
027527,000081:                                                                                                  #  MIDGIM        MIDDLE GIMBAL ANGLE
027528,000082:                                                                                                  #  XDELVFLG      RESETS XDELVFLG FOR LAMBERT VG COMPUTATIONS
027529,000083: 
027530,000084:                                                                                                  #  ALARMS OR ABORTS      NONE **
027531,000085: 
027532,000086:                                                                                                  #  RESTARTS ARE VIA GROUP 4 **
027533,000087: 
027534,000088: 35,2000                                           SETLOC   GLM                                   
027535,000089: 35,2000                                           BANK                                           
027536,000090: 
027537,000091: 35,2450  E7,1470                                  EBANK=   SUBEXIT                               
027538,000092: 
027539,000093: 35,2450                                           COUNT*   $$/P31                                
027540,000094: 35,2450           02361        P31                TC       P20FLGON                              
027541,000095: 35,2451           32025                           CAF      V06N33                                #  TIG
027542,000096: 35,2452           03712                           TC       VNPOOH                                
027543,000097: 35,2453           06037                           TC       INTPRET                               
027544,000098: 35,2454           71214                           CLEAR    DLOAD                                 
027545,000099: 35,2455           00670                                    UPDATFLG                              
027546,000100: 35,2456           03442                                    TIG                                   
027547,000101: 35,2457           34041                           STCALL   TDEC1                                 #  INTEGRATE STATE VECTORS TO TIG
027548,000102: 35,2460           27057                                    LEMPREC                               
027549,000103: 35,2461           40375                           VLOAD    SETPD                                 
027550,000104: 35,2462           00001                                    RATT                                  
027551,000105: 35,2463           00001                                    0D                                    
027552,000106: 35,2464           03642                           STORE    RTIG                                  
027553,000107: 35,2465           26323                           STOVL    RINIT                                 
027554,000108: 35,2466           00007                                    VATT                                  
027555,000109: 35,2467           03650                           STORE    VTIG                                  
027556,000110: 35,2470           16331                           STODL    VINIT                                 
027557,000111: 35,2471           32420                                    P30ZERO                               
027558,000112: 35,2472           65206                           PUSH     PDDL                                  #  E4 AND NUMIT = 0
027559,000113: 35,2473           03452                                    DELLT4                                
027560,000114: 35,2474           66015                           DAD      SXA,1                                 
027561,000115: 35,2475           03442                                    TIG                                   
027562,000116: 35,2476           02776                                    RTX1                                  
027563,000117: 35,2477           03631                           STORE    TPASS4                                
027564,000118: 35,2500           45134                           SXA,2    CALL                                  
027565,000119: 35,2501           02777                                    RTX2                                  
027566,000120: 35,2502           22000                                    INITVEL                               
027567,000121: 35,2503           41575                           VLOAD    PUSH                                  

Page 653

027569,000123: 35,2504           02366                                    DELVEET3                              
027570,000124: 35,2505           03656                           STORE    DELVSIN                               
027571,000125: 35,2506           43046                           ABVAL    CLEAR                                 
027572,000126: 35,2507           01267                                    XDELVFLG                              
027573,000127: 35,2510           37664                           STCALL   VGDISP                                
027574,000128: 35,2511           15733                                    GET.LVC                               
027575,000129: 35,2512           63375                           VLOAD    PDVL                                  
027576,000130: 35,2513           03642                                    RTIG                                  
027577,000131: 35,2514           02337                                    VIPRIME                               
027578,000132: 35,2515           77624                           CALL                                           
027579,000133: 35,2516           46316                                    PERIAPO1                              
027580,000134: 35,2517           77624                           CALL                                           
027581,000135: 35,2520           46426                                    SHIFTR1                               
027582,000136: 35,2521           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
027583,000137: 35,2522           45636                                    MAXCHK                                
027584,000138: 35,2523           16321                           STODL    HPER                                  
027585,000139: 35,2524           00005                                    4D                                    
027586,000140: 35,2525           77624                           CALL                                           
027587,000141: 35,2526           46426                                    SHIFTR1                               
027588,000142: 35,2527           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
027589,000143: 35,2530           45636                                    MAXCHK                                
027590,000144: 35,2531           02317                           STORE    HAPO                                  
027591,000145: 35,2532           77776                           EXIT                                           
027592,000146: 35,2533           33727                           CAF      V06N81                                #  DELVLVC
027593,000147: 35,2534           03712                           TC       VNPOOH                                
027594,000148: 35,2535           32026                           CAF      V06N42                                #  HAPO, HPER, VGDISP
027595,000149: 35,2536           03712                           TC       VNPOOH                                
027596,000150: 35,2537           06037                           TC       INTPRET                               
027597,000151: 35,2540           45014        REVN1645           SET      CALL                                  #  TRKMKCNT, TTOGO, +MGA
027598,000152: 35,2541           01071                                    FINALFLG                              
027599,000153: 35,2542           73606                                    VN1645                                
027600,000154: 35,2543           77650                           GOTO                                           
027601,000155: 35,2544           72540                                    REVN1645                              
027602,000156: 

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