Source Code

These source-code files are part of a reconstructed copy of Luminary 98, a development version 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 memo 85, using asterisks indicating changed lines in the listing as a guide. While no listing of this version is known to exist, nor are the memory-bank checksums available, the reconstruction is believed to be correct because it was an an intermediate step in reconstructing Luminary 97 whose reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152G. 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 98 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.

027385,000002:                                                                                                  ## Copyright:   Public domain.
027386,000003:                                                                                                  ## Filename:    LAMBERT_AIMPOINT_GUIDANCE.agc
027387,000004:                                                                                                  ## Purpose:     A section of Luminary revision 98.
027388,000005:                                                                                                  ##              It is part of the reconstructed source code for the a
027389,000006:                                                                                                  ##              development version of the flight software for the Lunar 
027390,000007:                                                                                                  ##              Module's (LM) Apollo Guidance Computer (AGC) for Apollo 11.
027391,000008:                                                                                                  ##              The code has been recreated from a copy of Luminary 99
027392,000009:                                                                                                  ##              revision 001, using asterisks indicating changed lines in
027393,000010:                                                                                                  ##              the listing and Luminary Memo #85, which lists changes between
027394,000011:                                                                                                  ##              Luminary 98 and 99.
027395,000012:                                                                                                  ## Reference:   pp. 651-653
027396,000013:                                                                                                  ## Assembler:   yaYUL
027397,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
027398,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
027399,000016:                                                                                                  ## Mod history: 2019-07-28 MAS  Created from Luminary 99.
027400,000017: 

Page 651

027402,000019: 
027403,000020:                                                                                                  #  GENERAL LAMBERT AIMPOINT GUIDANCE **
027404,000021:                                                                                                  #  WRITTEN BY RAMA M AIYAWAR
027405,000022: 
027406,000023:                                                                                                  #  PROGRAM P-31 DESCRIPTION **
027407,000024: 
027408,000025:                                                                                                  #  1.    TO ACCEPT TARGETING PARAMETERS OBTAINED FROM A SOURCE EXTERNAL
027409,000026:                                                                                                  #        TO THE LEM AND COMPUTE THERE FROM THE REQUIRED-VELOCITY AND
027410,000027:                                                                                                  #        OTHER INITIAL CONDITIONS REQUIRED BY LM FOR DESIRED MANEUVER.
027411,000028:                                                                                                  #        THE TARGETING PARAMETERS ARE TIG (TIME OF IGNITION), TARGET 
027412,000029:                                                                                                  #        VECTOR (RTARG), AND THE TIME FROM TIG UNTIL THE TARGET IS
027413,000030:                                                                                                  #        REACHED (DELLT4), DESIRED TIME OF FLIGHT FROM RINIT TO RTARG..
027414,000031: 
027415,000032:                                                                                                  #  ASSUMPTIONS **
027416,000033: 
027417,000034:                                                                                                  #  1.    THE TARGET PARAMETERS MAY HAVE BEEN LOADED PRIOR TO THE
027418,000035:                                                                                                  #        EXECUTION OF THIS PROGRAM.
027419,000036:                                                                                                  #  2.    THIS PROGRAM IS APPLICABLE IN EITHER EARTH OR LUNAR ORBIT.
027420,000037:                                                                                                  #  3.    THIS PROGRAM IS DESIGNED FOR ONE-MAN OPERATION, AND SHOULD
027421,000038:                                                                                                  #        BE SELECTED BY THE ASTRONAUT BY DSKY ENTRY V37 E31.
027422,000039: 
027423,000040:                                                                                                  #  SUBROUTINES USED **
027424,000041:                                                                                                  #  
027425,000042:                                                                                                  #  MANUPARM, TTG/N35, R02BOTH, MIDGIM, DISPMGA, FLAGDOWN, BANKCALL,
027426,000043:                                                                                                  #  GOTOPOOH, ENDOFJOB, PHASCHNG, GOFLASHR, GOFLASH.
027427,000044: 
027428,000045:                                                                                                  #  MANUPARM      CALCULATES APOGEE, PERIGEE ALTITUDES AND DELTAV DESIRED
027429,000046:                                                                                                  #                FOR THE MANEUVER.
027430,000047: 
027431,000048:                                                                                                  #  TTG/N35       CLOCKTASK - UPDATES CLOCK.
027432,000049: 
027433,000050:                                                                                                  #  MIDGIM        CALCULATES MIDDLE GIMBAL ANGLE FOR DISPLAY.
027434,000051: 
027435,000052:                                                                                                  #  R02BOTH       IMU - STATUS CHECK ROUTINE.
027436,000053: 
027437,000054:                                                                                                  #  DISPLAYS USED IN P-31LM **
027438,000055: 
027439,000056:                                                                                                  #  V06N33        DISPLAY SOTRED TIG (IN HRS. MINS. SECS)
027440,000057:                                                                                                  #  V06N42        DISPLAY APOGEE, PERIGEE, DELTAV.
027441,000058:                                                                                                  #  V16N35        DISPLAY TIME FROM TIG.
027442,000059:                                                                                                  #  V06N45        TIME FROM IGNITION AND MIDDLE GIMBAL ANGLE.
027443,000060: 
027444,000061:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED **
027445,000062: 
027446,000063:                                                                                                  #  TIG           TIME OF IGNITION                DP      (B+28) CS.
027447,000064: 
027448,000065:                                                                                                  #  DELLT4        DESIRED TIME OF FLIGHT          DP      (B+28) CS
027449,000066:                                                                                                  #                FROM RINIT TO RTARG.
027450,000067: 
027451,000068:                                                                                                  #  RTARG         RADIUS VECTOR OF TARGET POSITION VECTOR
027452,000069:                                                                                                  #                RADIUS VECTOR SCALED TO (B+29)METERS IF EARTH ORBIT

Page 652

027454,000071:                                                                                                  #                RADIUS VECTOR SCALED TO (B+27)METERS IF MOON ORBIT
027455,000072: 
027456,000073:                                                                                                  #  OUTPUT **
027457,000074: 
027458,000075:                                                                                                  #  HAPO          APOGEE ALTITUDE
027459,000076:                                                                                                  #  HPER          PERIGEE ALTITUDE
027460,000077:                                                                                                  #  VGDISP        MAG. OF DELTAV FOR DISPLAY, SCALING     B+7 M/CS EARTH
027461,000078:                                                                                                  #                MAG. OF DELTAV FOR DISPLAY, SCALING     B+5 M/CS MOON
027462,000079:                                                                                                  #  MIDGIM        MIDDLE GIMBAL ANGLE
027463,000080:                                                                                                  #  XDELVFLG      RESETS XDELVFLG FOR LAMBERT VG COMPUTATIONS
027464,000081: 
027465,000082:                                                                                                  #  ALARMS OR ABORTS      NONE **
027466,000083: 
027467,000084:                                                                                                  #  RESTARTS ARE VIA GROUP 4 **
027468,000085: 
027469,000086: 35,2000                                           SETLOC   GLM                                   
027470,000087: 35,2000                                           BANK                                           
027471,000088: 
027472,000089: 35,2450  E7,1470                                  EBANK=   SUBEXIT                               
027473,000090: 
027474,000091: 35,2450                                           COUNT*   $$/P31                                
027475,000092: 35,2450           02361        P31                TC       P20FLGON                              
027476,000093: 35,2451           32025                           CAF      V06N33                                #  TIG
027477,000094: 35,2452           03712                           TC       VNPOOH                                
027478,000095: 35,2453           06037                           TC       INTPRET                               
027479,000096: 35,2454           71214                           CLEAR    DLOAD                                 
027480,000097: 35,2455           00670                                    UPDATFLG                              
027481,000098: 35,2456           03442                                    TIG                                   
027482,000099: 35,2457           34041                           STCALL   TDEC1                                 #  INTEGRATE STATE VECTORS TO TIG
027483,000100: 35,2460           27057                                    LEMPREC                               
027484,000101: 35,2461           40375                           VLOAD    SETPD                                 
027485,000102: 35,2462           00001                                    RATT                                  
027486,000103: 35,2463           00001                                    0D                                    
027487,000104: 35,2464           03642                           STORE    RTIG                                  
027488,000105: 35,2465           26323                           STOVL    RINIT                                 
027489,000106: 35,2466           00007                                    VATT                                  
027490,000107: 35,2467           03650                           STORE    VTIG                                  
027491,000108: 35,2470           16331                           STODL    VINIT                                 
027492,000109: 35,2471           32420                                    P30ZERO                               
027493,000110: 35,2472           65206                           PUSH     PDDL                                  #  E4 AND NUMIT = 0
027494,000111: 35,2473           03452                                    DELLT4                                
027495,000112: 35,2474           66015                           DAD      SXA,1                                 
027496,000113: 35,2475           03442                                    TIG                                   
027497,000114: 35,2476           02776                                    RTX1                                  
027498,000115: 35,2477           03631                           STORE    TPASS4                                
027499,000116: 35,2500           45134                           SXA,2    CALL                                  
027500,000117: 35,2501           02777                                    RTX2                                  
027501,000118: 35,2502           22000                                    INITVEL                               
027502,000119: 35,2503           41575                           VLOAD    PUSH                                  

Page 653

027504,000121: 35,2504           02366                                    DELVEET3                              
027505,000122: 35,2505           03656                           STORE    DELVSIN                               
027506,000123: 35,2506           43046                           ABVAL    CLEAR                                 
027507,000124: 35,2507           01267                                    XDELVFLG                              
027508,000125: 35,2510           37664                           STCALL   VGDISP                                
027509,000126: 35,2511           15733                                    GET.LVC                               
027510,000127: 35,2512           63375                           VLOAD    PDVL                                  
027511,000128: 35,2513           03642                                    RTIG                                  
027512,000129: 35,2514           02337                                    VIPRIME                               
027513,000130: 35,2515           77624                           CALL                                           
027514,000131: 35,2516           46316                                    PERIAPO1                              
027515,000132: 35,2517           77624                           CALL                                           
027516,000133: 35,2520           46426                                    SHIFTR1                               
027517,000134: 35,2521           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
027518,000135: 35,2522           45636                                    MAXCHK                                
027519,000136: 35,2523           16321                           STODL    HPER                                  
027520,000137: 35,2524           00005                                    4D                                    
027521,000138: 35,2525           77624                           CALL                                           
027522,000139: 35,2526           46426                                    SHIFTR1                               
027523,000140: 35,2527           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
027524,000141: 35,2530           45636                                    MAXCHK                                
027525,000142: 35,2531           02317                           STORE    HAPO                                  
027526,000143: 35,2532           77776                           EXIT                                           
027527,000144: 35,2533           33727                           CAF      V06N81                                #  DELVLVC
027528,000145: 35,2534           03712                           TC       VNPOOH                                
027529,000146: 35,2535           32026                           CAF      V06N42                                #  HAPO, HPER, VGDISP
027530,000147: 35,2536           03712                           TC       VNPOOH                                
027531,000148: 35,2537           06037                           TC       INTPRET                               
027532,000149: 35,2540           45014        REVN1645           SET      CALL                                  #  TRKMKCNT, TTOGO, +MGA
027533,000150: 35,2541           01071                                    FINALFLG                              
027534,000151: 35,2542           73606                                    VN1645                                
027535,000152: 35,2543           77650                           GOTO                                           
027536,000153: 35,2544           72540                                    REVN1645                              
027537,000154: 

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