Source Code

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

The reconstruction began with source code of Luminary 99 revision 1 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes described in original Luminary memos 83 and 85, using asterisks indicating changed lines in the listing as a guide. 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 97 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.

027501,000002:                                                                                                  ## Copyright:   Public domain.
027502,000003:                                                                                                  ## Filename:    LAMBERT_AIMPOINT_GUIDANCE.agc
027503,000004:                                                                                                  ## Purpose:     A section of Luminary revision 97.
027504,000005:                                                                                                  ##              It is part of the reconstructed source code for the
027505,000006:                                                                                                  ##              original release of the flight software for the Lunar 
027506,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
027507,000008:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
027508,000009:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
027509,000010:                                                                                                  ##              the listing and Luminary Memos #83 and #85, which list 
027510,000011:                                                                                                  ##              changes between Luminary 97 and 98, and 98 and 99. The
027511,000012:                                                                                                  ##              code has been adapted such that the resulting bugger words
027512,000013:                                                                                                  ##              exactly match those specified for Luminary 97 in NASA drawing
027513,000014:                                                                                                  ##              2021152D, which gives relatively high confidence that the
027514,000015:                                                                                                  ##              reconstruction is correct.
027515,000016:                                                                                                  ## Reference:   pp. 651-653
027516,000017:                                                                                                  ## Assembler:   yaYUL
027517,000018:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
027518,000019:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
027519,000020:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
027520,000021: 

Page 651

027522,000023: 
027523,000024:                                                                                                  #  GENERAL LAMBERT AIMPOINT GUIDANCE **
027524,000025:                                                                                                  #  WRITTEN BY RAMA M AIYAWAR
027525,000026: 
027526,000027:                                                                                                  #  PROGRAM P-31 DESCRIPTION **
027527,000028: 
027528,000029:                                                                                                  #  1.    TO ACCEPT TARGETING PARAMETERS OBTAINED FROM A SOURCE EXTERNAL
027529,000030:                                                                                                  #        TO THE LEM AND COMPUTE THERE FROM THE REQUIRED-VELOCITY AND
027530,000031:                                                                                                  #        OTHER INITIAL CONDITIONS REQUIRED BY LM FOR DESIRED MANEUVER.
027531,000032:                                                                                                  #        THE TARGETING PARAMETERS ARE TIG (TIME OF IGNITION), TARGET 
027532,000033:                                                                                                  #        VECTOR (RTARG), AND THE TIME FROM TIG UNTIL THE TARGET IS
027533,000034:                                                                                                  #        REACHED (DELLT4), DESIRED TIME OF FLIGHT FROM RINIT TO RTARG..
027534,000035: 
027535,000036:                                                                                                  #  ASSUMPTIONS **
027536,000037: 
027537,000038:                                                                                                  #  1.    THE TARGET PARAMETERS MAY HAVE BEEN LOADED PRIOR TO THE
027538,000039:                                                                                                  #        EXECUTION OF THIS PROGRAM.
027539,000040:                                                                                                  #  2.    THIS PROGRAM IS APPLICABLE IN EITHER EARTH OR LUNAR ORBIT.
027540,000041:                                                                                                  #  3.    THIS PROGRAM IS DESIGNED FOR ONE-MAN OPERATION, AND SHOULD
027541,000042:                                                                                                  #        BE SELECTED BY THE ASTRONAUT BY DSKY ENTRY V37 E31.
027542,000043: 
027543,000044:                                                                                                  #  SUBROUTINES USED **
027544,000045:                                                                                                  #  
027545,000046:                                                                                                  #  MANUPARM, TTG/N35, R02BOTH, MIDGIM, DISPMGA, FLAGDOWN, BANKCALL,
027546,000047:                                                                                                  #  GOTOPOOH, ENDOFJOB, PHASCHNG, GOFLASHR, GOFLASH.
027547,000048: 
027548,000049:                                                                                                  #  MANUPARM      CALCULATES APOGEE, PERIGEE ALTITUDES AND DELTAV DESIRED
027549,000050:                                                                                                  #                FOR THE MANEUVER.
027550,000051: 
027551,000052:                                                                                                  #  TTG/N35       CLOCKTASK - UPDATES CLOCK.
027552,000053: 
027553,000054:                                                                                                  #  MIDGIM        CALCULATES MIDDLE GIMBAL ANGLE FOR DISPLAY.
027554,000055: 
027555,000056:                                                                                                  #  R02BOTH       IMU - STATUS CHECK ROUTINE.
027556,000057: 
027557,000058:                                                                                                  #  DISPLAYS USED IN P-31LM **
027558,000059: 
027559,000060:                                                                                                  #  V06N33        DISPLAY SOTRED TIG (IN HRS. MINS. SECS)
027560,000061:                                                                                                  #  V06N42        DISPLAY APOGEE, PERIGEE, DELTAV.
027561,000062:                                                                                                  #  V16N35        DISPLAY TIME FROM TIG.
027562,000063:                                                                                                  #  V06N45        TIME FROM IGNITION AND MIDDLE GIMBAL ANGLE.
027563,000064: 
027564,000065:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED **
027565,000066: 
027566,000067:                                                                                                  #  TIG           TIME OF IGNITION                DP      (B+28) CS.
027567,000068: 
027568,000069:                                                                                                  #  DELLT4        DESIRED TIME OF FLIGHT          DP      (B+28) CS
027569,000070:                                                                                                  #                FROM RINIT TO RTARG.
027570,000071: 
027571,000072:                                                                                                  #  RTARG         RADIUS VECTOR OF TARGET POSITION VECTOR
027572,000073:                                                                                                  #                RADIUS VECTOR SCALED TO (B+29)METERS IF EARTH ORBIT

Page 652

027574,000075:                                                                                                  #                RADIUS VECTOR SCALED TO (B+27)METERS IF MOON ORBIT
027575,000076: 
027576,000077:                                                                                                  #  OUTPUT **
027577,000078: 
027578,000079:                                                                                                  #  HAPO          APOGEE ALTITUDE
027579,000080:                                                                                                  #  HPER          PERIGEE ALTITUDE
027580,000081:                                                                                                  #  VGDISP        MAG. OF DELTAV FOR DISPLAY, SCALING     B+7 M/CS EARTH
027581,000082:                                                                                                  #                MAG. OF DELTAV FOR DISPLAY, SCALING     B+5 M/CS MOON
027582,000083:                                                                                                  #  MIDGIM        MIDDLE GIMBAL ANGLE
027583,000084:                                                                                                  #  XDELVFLG      RESETS XDELVFLG FOR LAMBERT VG COMPUTATIONS
027584,000085: 
027585,000086:                                                                                                  #  ALARMS OR ABORTS      NONE **
027586,000087: 
027587,000088:                                                                                                  #  RESTARTS ARE VIA GROUP 4 **
027588,000089: 
027589,000090: 35,2000                                           SETLOC   GLM                                   
027590,000091: 35,2000                                           BANK                                           
027591,000092: 
027592,000093: 35,2450  E7,1470                                  EBANK=   SUBEXIT                               
027593,000094: 
027594,000095: 35,2450                                           COUNT*   $$/P31                                
027595,000096: 35,2450           02361        P31                TC       P20FLGON                              
027596,000097: 35,2451           32025                           CAF      V06N33                                #  TIG
027597,000098: 35,2452           03712                           TC       VNPOOH                                
027598,000099: 35,2453           06037                           TC       INTPRET                               
027599,000100: 35,2454           71214                           CLEAR    DLOAD                                 
027600,000101: 35,2455           00670                                    UPDATFLG                              
027601,000102: 35,2456           03442                                    TIG                                   
027602,000103: 35,2457           34041                           STCALL   TDEC1                                 #  INTEGRATE STATE VECTORS TO TIG
027603,000104: 35,2460           27057                                    LEMPREC                               
027604,000105: 35,2461           40375                           VLOAD    SETPD                                 
027605,000106: 35,2462           00001                                    RATT                                  
027606,000107: 35,2463           00001                                    0D                                    
027607,000108: 35,2464           03642                           STORE    RTIG                                  
027608,000109: 35,2465           26323                           STOVL    RINIT                                 
027609,000110: 35,2466           00007                                    VATT                                  
027610,000111: 35,2467           03650                           STORE    VTIG                                  
027611,000112: 35,2470           16331                           STODL    VINIT                                 
027612,000113: 35,2471           32420                                    P30ZERO                               
027613,000114: 35,2472           65206                           PUSH     PDDL                                  #  E4 AND NUMIT = 0
027614,000115: 35,2473           03452                                    DELLT4                                
027615,000116: 35,2474           66015                           DAD      SXA,1                                 
027616,000117: 35,2475           03442                                    TIG                                   
027617,000118: 35,2476           02776                                    RTX1                                  
027618,000119: 35,2477           03631                           STORE    TPASS4                                
027619,000120: 35,2500           45134                           SXA,2    CALL                                  
027620,000121: 35,2501           02777                                    RTX2                                  
027621,000122: 35,2502           22000                                    INITVEL                               
027622,000123: 35,2503           41575                           VLOAD    PUSH                                  

Page 653

027624,000125: 35,2504           02366                                    DELVEET3                              
027625,000126: 35,2505           03656                           STORE    DELVSIN                               
027626,000127: 35,2506           43046                           ABVAL    CLEAR                                 
027627,000128: 35,2507           01267                                    XDELVFLG                              
027628,000129: 35,2510           37664                           STCALL   VGDISP                                
027629,000130: 35,2511           15733                                    GET.LVC                               
027630,000131: 35,2512           63375                           VLOAD    PDVL                                  
027631,000132: 35,2513           03642                                    RTIG                                  
027632,000133: 35,2514           02337                                    VIPRIME                               
027633,000134: 35,2515           77624                           CALL                                           
027634,000135: 35,2516           46316                                    PERIAPO1                              
027635,000136: 35,2517           77624                           CALL                                           
027636,000137: 35,2520           46426                                    SHIFTR1                               
027637,000138: 35,2521           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
027638,000139: 35,2522           45636                                    MAXCHK                                
027639,000140: 35,2523           16321                           STODL    HPER                                  
027640,000141: 35,2524           00005                                    4D                                    
027641,000142: 35,2525           77624                           CALL                                           
027642,000143: 35,2526           46426                                    SHIFTR1                               
027643,000144: 35,2527           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
027644,000145: 35,2530           45636                                    MAXCHK                                
027645,000146: 35,2531           02317                           STORE    HAPO                                  
027646,000147: 35,2532           77776                           EXIT                                           
027647,000148: 35,2533           33727                           CAF      V06N81                                #  DELVLVC
027648,000149: 35,2534           03712                           TC       VNPOOH                                
027649,000150: 35,2535           32026                           CAF      V06N42                                #  HAPO, HPER, VGDISP
027650,000151: 35,2536           03712                           TC       VNPOOH                                
027651,000152: 35,2537           06037                           TC       INTPRET                               
027652,000153: 35,2540           45014        REVN1645           SET      CALL                                  #  TRKMKCNT, TTOGO, +MGA
027653,000154: 35,2541           01071                                    FINALFLG                              
027654,000155: 35,2542           73606                                    VN1645                                
027655,000156: 35,2543           77650                           GOTO                                           
027656,000157: 35,2544           72540                                    REVN1645                              
027657,000158: 

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