Source Code

These source-code files are part of a reconstructed copy of Luminary 97, the second release of the Apollo 11 Lunar Module (LM) Apollo Guidance Computer (AGC) software. It was created to fix two incorrect ephemeris constants in Luminary 96, as described by anomaly report LNY-59.

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.

027575,000002:                                                                                                  ## Copyright:   Public domain.
027576,000003:                                                                                                  ## Filename:    LAMBERT_AIMPOINT_GUIDANCE.agc
027577,000004:                                                                                                  ## Purpose:     A section of Luminary revision 97.
027578,000005:                                                                                                  ##              It is part of the reconstructed source code for the
027579,000006:                                                                                                  ##              second release of the flight software for the Lunar 
027580,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
027581,000008:                                                                                                  ##              It was created to fix two incorrect ephemeris constants in
027582,000009:                                                                                                  ##              Luminary 96, as described by anomaly report LNY-59.
027583,000010:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
027584,000011:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
027585,000012:                                                                                                  ##              the listing and Luminary Memos #83 and #85, which list 
027586,000013:                                                                                                  ##              changes between Luminary 97 and 98, and 98 and 99. The
027587,000014:                                                                                                  ##              code has been adapted such that the resulting bugger words
027588,000015:                                                                                                  ##              exactly match those specified for Luminary 97 in NASA drawing
027589,000016:                                                                                                  ##              2021152D, which gives relatively high confidence that the
027590,000017:                                                                                                  ##              reconstruction is correct.
027591,000018:                                                                                                  ## Reference:   pp. 651-653
027592,000019:                                                                                                  ## Assembler:   yaYUL
027593,000020:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
027594,000021:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
027595,000022:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
027596,000023: 

Page 651

027598,000025: 
027599,000026:                                                                                                  #  GENERAL LAMBERT AIMPOINT GUIDANCE **
027600,000027:                                                                                                  #  WRITTEN BY RAMA M AIYAWAR
027601,000028: 
027602,000029:                                                                                                  #  PROGRAM P-31 DESCRIPTION **
027603,000030: 
027604,000031:                                                                                                  #  1.    TO ACCEPT TARGETING PARAMETERS OBTAINED FROM A SOURCE EXTERNAL
027605,000032:                                                                                                  #        TO THE LEM AND COMPUTE THERE FROM THE REQUIRED-VELOCITY AND
027606,000033:                                                                                                  #        OTHER INITIAL CONDITIONS REQUIRED BY LM FOR DESIRED MANEUVER.
027607,000034:                                                                                                  #        THE TARGETING PARAMETERS ARE TIG (TIME OF IGNITION), TARGET 
027608,000035:                                                                                                  #        VECTOR (RTARG), AND THE TIME FROM TIG UNTIL THE TARGET IS
027609,000036:                                                                                                  #        REACHED (DELLT4), DESIRED TIME OF FLIGHT FROM RINIT TO RTARG..
027610,000037: 
027611,000038:                                                                                                  #  ASSUMPTIONS **
027612,000039: 
027613,000040:                                                                                                  #  1.    THE TARGET PARAMETERS MAY HAVE BEEN LOADED PRIOR TO THE
027614,000041:                                                                                                  #        EXECUTION OF THIS PROGRAM.
027615,000042:                                                                                                  #  2.    THIS PROGRAM IS APPLICABLE IN EITHER EARTH OR LUNAR ORBIT.
027616,000043:                                                                                                  #  3.    THIS PROGRAM IS DESIGNED FOR ONE-MAN OPERATION, AND SHOULD
027617,000044:                                                                                                  #        BE SELECTED BY THE ASTRONAUT BY DSKY ENTRY V37 E31.
027618,000045: 
027619,000046:                                                                                                  #  SUBROUTINES USED **
027620,000047:                                                                                                  #  
027621,000048:                                                                                                  #  MANUPARM, TTG/N35, R02BOTH, MIDGIM, DISPMGA, FLAGDOWN, BANKCALL,
027622,000049:                                                                                                  #  GOTOPOOH, ENDOFJOB, PHASCHNG, GOFLASHR, GOFLASH.
027623,000050: 
027624,000051:                                                                                                  #  MANUPARM      CALCULATES APOGEE, PERIGEE ALTITUDES AND DELTAV DESIRED
027625,000052:                                                                                                  #                FOR THE MANEUVER.
027626,000053: 
027627,000054:                                                                                                  #  TTG/N35       CLOCKTASK - UPDATES CLOCK.
027628,000055: 
027629,000056:                                                                                                  #  MIDGIM        CALCULATES MIDDLE GIMBAL ANGLE FOR DISPLAY.
027630,000057: 
027631,000058:                                                                                                  #  R02BOTH       IMU - STATUS CHECK ROUTINE.
027632,000059: 
027633,000060:                                                                                                  #  DISPLAYS USED IN P-31LM **
027634,000061: 
027635,000062:                                                                                                  #  V06N33        DISPLAY SOTRED TIG (IN HRS. MINS. SECS)
027636,000063:                                                                                                  #  V06N42        DISPLAY APOGEE, PERIGEE, DELTAV.
027637,000064:                                                                                                  #  V16N35        DISPLAY TIME FROM TIG.
027638,000065:                                                                                                  #  V06N45        TIME FROM IGNITION AND MIDDLE GIMBAL ANGLE.
027639,000066: 
027640,000067:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED **
027641,000068: 
027642,000069:                                                                                                  #  TIG           TIME OF IGNITION                DP      (B+28) CS.
027643,000070: 
027644,000071:                                                                                                  #  DELLT4        DESIRED TIME OF FLIGHT          DP      (B+28) CS
027645,000072:                                                                                                  #                FROM RINIT TO RTARG.
027646,000073: 
027647,000074:                                                                                                  #  RTARG         RADIUS VECTOR OF TARGET POSITION VECTOR
027648,000075:                                                                                                  #                RADIUS VECTOR SCALED TO (B+29)METERS IF EARTH ORBIT

Page 652

027650,000077:                                                                                                  #                RADIUS VECTOR SCALED TO (B+27)METERS IF MOON ORBIT
027651,000078: 
027652,000079:                                                                                                  #  OUTPUT **
027653,000080: 
027654,000081:                                                                                                  #  HAPO          APOGEE ALTITUDE
027655,000082:                                                                                                  #  HPER          PERIGEE ALTITUDE
027656,000083:                                                                                                  #  VGDISP        MAG. OF DELTAV FOR DISPLAY, SCALING     B+7 M/CS EARTH
027657,000084:                                                                                                  #                MAG. OF DELTAV FOR DISPLAY, SCALING     B+5 M/CS MOON
027658,000085:                                                                                                  #  MIDGIM        MIDDLE GIMBAL ANGLE
027659,000086:                                                                                                  #  XDELVFLG      RESETS XDELVFLG FOR LAMBERT VG COMPUTATIONS
027660,000087: 
027661,000088:                                                                                                  #  ALARMS OR ABORTS      NONE **
027662,000089: 
027663,000090:                                                                                                  #  RESTARTS ARE VIA GROUP 4 **
027664,000091: 
027665,000092: 35,2000                                           SETLOC   GLM                                   
027666,000093: 35,2000                                           BANK                                           
027667,000094: 
027668,000095: 35,2450  E7,1470                                  EBANK=   SUBEXIT                               
027669,000096: 
027670,000097: 35,2450                                           COUNT*   $$/P31                                
027671,000098: 35,2450           02361        P31                TC       P20FLGON                              
027672,000099: 35,2451           32025                           CAF      V06N33                                #  TIG
027673,000100: 35,2452           03712                           TC       VNPOOH                                
027674,000101: 35,2453           06037                           TC       INTPRET                               
027675,000102: 35,2454           71214                           CLEAR    DLOAD                                 
027676,000103: 35,2455           00670                                    UPDATFLG                              
027677,000104: 35,2456           03442                                    TIG                                   
027678,000105: 35,2457           34041                           STCALL   TDEC1                                 #  INTEGRATE STATE VECTORS TO TIG
027679,000106: 35,2460           27057                                    LEMPREC                               
027680,000107: 35,2461           40375                           VLOAD    SETPD                                 
027681,000108: 35,2462           00001                                    RATT                                  
027682,000109: 35,2463           00001                                    0D                                    
027683,000110: 35,2464           03642                           STORE    RTIG                                  
027684,000111: 35,2465           26323                           STOVL    RINIT                                 
027685,000112: 35,2466           00007                                    VATT                                  
027686,000113: 35,2467           03650                           STORE    VTIG                                  
027687,000114: 35,2470           16331                           STODL    VINIT                                 
027688,000115: 35,2471           32420                                    P30ZERO                               
027689,000116: 35,2472           65206                           PUSH     PDDL                                  #  E4 AND NUMIT = 0
027690,000117: 35,2473           03452                                    DELLT4                                
027691,000118: 35,2474           66015                           DAD      SXA,1                                 
027692,000119: 35,2475           03442                                    TIG                                   
027693,000120: 35,2476           02776                                    RTX1                                  
027694,000121: 35,2477           03631                           STORE    TPASS4                                
027695,000122: 35,2500           45134                           SXA,2    CALL                                  
027696,000123: 35,2501           02777                                    RTX2                                  
027697,000124: 35,2502           22000                                    INITVEL                               
027698,000125: 35,2503           41575                           VLOAD    PUSH                                  

Page 653

027700,000127: 35,2504           02366                                    DELVEET3                              
027701,000128: 35,2505           03656                           STORE    DELVSIN                               
027702,000129: 35,2506           43046                           ABVAL    CLEAR                                 
027703,000130: 35,2507           01267                                    XDELVFLG                              
027704,000131: 35,2510           37664                           STCALL   VGDISP                                
027705,000132: 35,2511           15733                                    GET.LVC                               
027706,000133: 35,2512           63375                           VLOAD    PDVL                                  
027707,000134: 35,2513           03642                                    RTIG                                  
027708,000135: 35,2514           02337                                    VIPRIME                               
027709,000136: 35,2515           77624                           CALL                                           
027710,000137: 35,2516           46316                                    PERIAPO1                              
027711,000138: 35,2517           77624                           CALL                                           
027712,000139: 35,2520           46426                                    SHIFTR1                               
027713,000140: 35,2521           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
027714,000141: 35,2522           45636                                    MAXCHK                                
027715,000142: 35,2523           16321                           STODL    HPER                                  
027716,000143: 35,2524           00005                                    4D                                    
027717,000144: 35,2525           77624                           CALL                                           
027718,000145: 35,2526           46426                                    SHIFTR1                               
027719,000146: 35,2527           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
027720,000147: 35,2530           45636                                    MAXCHK                                
027721,000148: 35,2531           02317                           STORE    HAPO                                  
027722,000149: 35,2532           77776                           EXIT                                           
027723,000150: 35,2533           33727                           CAF      V06N81                                #  DELVLVC
027724,000151: 35,2534           03712                           TC       VNPOOH                                
027725,000152: 35,2535           32026                           CAF      V06N42                                #  HAPO, HPER, VGDISP
027726,000153: 35,2536           03712                           TC       VNPOOH                                
027727,000154: 35,2537           06037                           TC       INTPRET                               
027728,000155: 35,2540           45014        REVN1645           SET      CALL                                  #  TRKMKCNT, TTOGO, +MGA
027729,000156: 35,2541           01071                                    FINALFLG                              
027730,000157: 35,2542           73606                                    VN1645                                
027731,000158: 35,2543           77650                           GOTO                                           
027732,000159: 35,2544           72540                                    REVN1645                              
027733,000160: 

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