Source Code

These source-code files were from the printout at the MIT Museum, with many thanks to Deborah Douglas, the Museum's Curator of Science and Technology, for releasing it to us. The printout was digitally photographed by Paul Fjeld. A team of volunteers transcribed the source code manually from these images or, where appropriate, modified already-transcribed but similar source Luminary 131 (Apollo 13) source code to agree with the images from the printout. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 001 OF AGC PROGRAM LMY99 BY NASA 2021112-061
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

027988,000002:                                                                                                  ## Copyright:   Public domain.
027989,000003:                                                                                                  ## Filename:    LAMBERT_AIMPOINT_GUIDANCE.agc
027990,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
027991,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
027992,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
027993,000007:                                                                                                  ## Assembler:   yaYUL
027994,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
027995,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
027996,000010:                                                                                                  ## Pages:       651-653
027997,000011:                                                                                                  ## Mod history: 2009-05-18 RSB  Transcribed from Luminary 099
027998,000012:                                                                                                  ##                              page images.
027999,000013:                                                                                                  ##              2009-06-05 RSB  Corrected 4 typos.
028000,000014:                                                                                                  ##              2009-06-07 RSB  Fixed a typo.
028001,000015:                                                                                                  ##              2016-12-14 RSB  VNP00H -> VNPOOH.
028002,000016:                                                                                                  ##              2016-12-14 RSB  Proofed text comments with octopus/ProoferComments
028003,000017:                                                                                                  ##                              and corrected the errors found.
028004,000018:                                                                                                  ##
028005,000019:                                                                                                  ## This source code has been transcribed or otherwise adapted from
028006,000020:                                                                                                  ## digitized images of a hardcopy from the MIT Museum.  The digitization
028007,000021:                                                                                                  ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
028008,000022:                                                                                                  ## the Museum.  Many thanks to both.  The images (with suitable reduction
028009,000023:                                                                                                  ## in storage size and consequent reduction in image quality as well) are
028010,000024:                                                                                                  ## available online at www.ibiblio.org/apollo.  If for some reason you
028011,000025:                                                                                                  ## find that the images are illegible, contact me at info@sandroid.org
028012,000026:                                                                                                  ## about getting access to the (much) higher-quality images which Paul
028013,000027:                                                                                                  ## actually created.
028014,000028:                                                                                                  ##
028015,000029:                                                                                                  ## Notations on the hardcopy document read, in part:
028016,000030:                                                                                                  ##
028017,000031:                                                                                                  ##      Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
028018,000032:                                                                                                  ##      16:27 JULY 14, 1969 
028019,000033: 

Page 651

028021,000035: 
028022,000036:                                                                                                  #  GENERAL LAMBERT AIMPOINT GUIDANCE **
028023,000037:                                                                                                  #  WRITTEN BY RAMA M AIYAWAR
028024,000038: 
028025,000039:                                                                                                  #  PROGRAM P-31 DESCRIPTION **
028026,000040: 
028027,000041:                                                                                                  #  1.    TO ACCEPT TARGETING PARAMETERS OBTAINED FROM A SOURCE EXTERNAL
028028,000042:                                                                                                  #        TO THE LEM AND COMPUTE THERE FROM THE REQUIRED-VELOCITY AND
028029,000043:                                                                                                  #        OTHER INITIAL CONDITIONS REQUIRED BY LM FOR DESIRED MANEUVER.
028030,000044:                                                                                                  #        THE TARGETING PARAMETERS ARE TIG (TIME OF IGNITION), TARGET 
028031,000045:                                                                                                  #        VECTOR (RTARG), AND THE TIME FROM TIG UNTIL THE TARGET IS
028032,000046:                                                                                                  #        REACHED (DELLT4), DESIRED TIME OF FLIGHT FROM RINIT TO RTARG..
028033,000047: 
028034,000048:                                                                                                  #  ASSUMPTIONS **
028035,000049: 
028036,000050:                                                                                                  #  1.    THE TARGET PARAMETERS MAY HAVE BEEN LOADED PRIOR TO THE
028037,000051:                                                                                                  #        EXECUTION OF THIS PROGRAM.
028038,000052:                                                                                                  #  2.    THIS PROGRAM IS APPLICABLE IN EITHER EARTH OR LUNAR ORBIT.
028039,000053:                                                                                                  #  3.    THIS PROGRAM IS DESIGNED FOR ONE-MAN OPERATION, AND SHOULD
028040,000054:                                                                                                  #        BE SELECTED BY THE ASTRONAUT BY DSKY ENTRY V37 E31.
028041,000055: 
028042,000056:                                                                                                  #  SUBROUTINES USED **
028043,000057:                                                                                                  #  
028044,000058:                                                                                                  #  MANUPARM, TTG/N35, R02BOTH, MIDGIM, DISPMGA, FLAGDOWN, BANKCALL,
028045,000059:                                                                                                  #  GOTOPOOH, ENDOFJOB, PHASCHNG, GOFLASHR, GOFLASH.
028046,000060: 
028047,000061:                                                                                                  #  MANUPARM      CALCULATES APOGEE, PERIGEE ALTITUDES AND DELTAV DESIRED
028048,000062:                                                                                                  #                FOR THE MANEUVER.
028049,000063: 
028050,000064:                                                                                                  #  TTG/N35       CLOCKTASK - UPDATES CLOCK.
028051,000065: 
028052,000066:                                                                                                  #  MIDGIM        CALCULATES MIDDLE GIMBAL ANGLE FOR DISPLAY.
028053,000067: 
028054,000068:                                                                                                  #  R02BOTH       IMU - STATUS CHECK ROUTINE.
028055,000069: 
028056,000070:                                                                                                  #  DISPLAYS USED IN P-31LM **
028057,000071: 
028058,000072:                                                                                                  #  V06N33        DISPLAY SOTRED TIG (IN HRS. MINS. SECS)
028059,000073:                                                                                                  #  V06N42        DISPLAY APOGEE, PERIGEE, DELTAV.
028060,000074:                                                                                                  #  V16N35        DISPLAY TIME FROM TIG.
028061,000075:                                                                                                  #  V06N45        TIME FROM IGNITION AND MIDDLE GIMBAL ANGLE.
028062,000076: 
028063,000077:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED **
028064,000078: 
028065,000079:                                                                                                  #  TIG           TIME OF IGNITION                DP      (B+28) CS.
028066,000080: 
028067,000081:                                                                                                  #  DELLT4        DESIRED TIME OF FLIGHT          DP      (B+28) CS
028068,000082:                                                                                                  #                FROM RINIT TO RTARG.
028069,000083: 
028070,000084:                                                                                                  #  RTARG         RADIUS VECTOR OF TARGET POSITION VECTOR
028071,000085:                                                                                                  #                RADIUS VECTOR SCALED TO (B+29)METERS IF EARTH ORBIT

Page 652

028073,000087:                                                                                                  #                RADIUS VECTOR SCALED TO (B+27)METERS IF MOON ORBIT
028074,000088: 
028075,000089:                                                                                                  #  OUTPUT **
028076,000090: 
028077,000091:                                                                                                  #  HAPO          APOGEE ALTITUDE
028078,000092:                                                                                                  #  HPER          PERIGEE ALTITUDE
028079,000093:                                                                                                  #  VGDISP        MAG. OF DELTAV FOR DISPLAY, SCALING     B+7 M/CS EARTH
028080,000094:                                                                                                  #                MAG. OF DELTAV FOR DISPLAY, SCALING     B+5 M/CS MOON
028081,000095:                                                                                                  #  MIDGIM        MIDDLE GIMBAL ANGLE
028082,000096:                                                                                                  #  XDELVFLG      RESETS XDELVFLG FOR LAMBERT VG COMPUTATIONS
028083,000097: 
028084,000098:                                                                                                  #  ALARMS OR ABORTS      NONE **
028085,000099: 
028086,000100:                                                                                                  #  RESTARTS ARE VIA GROUP 4 **
028087,000101: 
028088,000102: 35,2000                                           SETLOC   GLM                                   
028089,000103: 35,2000                                           BANK                                           
028090,000104: 
028091,000105: 35,2450  E7,1470                                  EBANK=   SUBEXIT                               
028092,000106: 
028093,000107: 35,2450                                           COUNT*   $$/P31                                
028094,000108: 35,2450           02361        P31                TC       P20FLGON                              
028095,000109: 35,2451           32025                           CAF      V06N33                                #  TIG
028096,000110: 35,2452           03712                           TC       VNPOOH                                
028097,000111: 35,2453           06037                           TC       INTPRET                               
028098,000112: 35,2454           71214                           CLEAR    DLOAD                                 
028099,000113: 35,2455           00670                                    UPDATFLG                              
028100,000114: 35,2456           03442                                    TIG                                   
028101,000115: 35,2457           34041                           STCALL   TDEC1                                 #  INTEGRATE STATE VECTORS TO TIG
028102,000116: 35,2460           27057                                    LEMPREC                               
028103,000117: 35,2461           40375                           VLOAD    SETPD                                 
028104,000118: 35,2462           00001                                    RATT                                  
028105,000119: 35,2463           00001                                    0D                                    
028106,000120: 35,2464           03642                           STORE    RTIG                                  
028107,000121: 35,2465           26323                           STOVL    RINIT                                 
028108,000122: 35,2466           00007                                    VATT                                  
028109,000123: 35,2467           03650                           STORE    VTIG                                  
028110,000124: 35,2470           16331                           STODL    VINIT                                 
028111,000125: 35,2471           32420                                    P30ZERO                               
028112,000126: 35,2472           65206                           PUSH     PDDL                                  #  E4 AND NUMIT = 0
028113,000127: 35,2473           03452                                    DELLT4                                
028114,000128: 35,2474           66015                           DAD      SXA,1                                 
028115,000129: 35,2475           03442                                    TIG                                   
028116,000130: 35,2476           02776                                    RTX1                                  
028117,000131: 35,2477           03631                           STORE    TPASS4                                
028118,000132: 35,2500           45134                           SXA,2    CALL                                  
028119,000133: 35,2501           02777                                    RTX2                                  
028120,000134: 35,2502           22000                                    INITVEL                               
028121,000135: 35,2503           41575                           VLOAD    PUSH                                  

Page 653

028123,000137: 35,2504           02366                                    DELVEET3                              
028124,000138: 35,2505           03656                           STORE    DELVSIN                               
028125,000139: 35,2506           43046                           ABVAL    CLEAR                                 
028126,000140: 35,2507           01267                                    XDELVFLG                              
028127,000141: 35,2510           37664                           STCALL   VGDISP                                
028128,000142: 35,2511           15733                                    GET.LVC                               
028129,000143: 35,2512           63375                           VLOAD    PDVL                                  
028130,000144: 35,2513           03642                                    RTIG                                  
028131,000145: 35,2514           02337                                    VIPRIME                               
028132,000146: 35,2515           77624                           CALL                                           
028133,000147: 35,2516           46316                                    PERIAPO1                              
028134,000148: 35,2517           77624                           CALL                                           
028135,000149: 35,2520           46426                                    SHIFTR1                               
028136,000150: 35,2521           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
028137,000151: 35,2522           45636                                    MAXCHK                                
028138,000152: 35,2523           16321                           STODL    HPER                                  
028139,000153: 35,2524           00005                                    4D                                    
028140,000154: 35,2525           77624                           CALL                                           
028141,000155: 35,2526           46426                                    SHIFTR1                               
028142,000156: 35,2527           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
028143,000157: 35,2530           45636                                    MAXCHK                                
028144,000158: 35,2531           02317                           STORE    HAPO                                  
028145,000159: 35,2532           77776                           EXIT                                           
028146,000160: 35,2533           33727                           CAF      V06N81                                #  DELVLVC
028147,000161: 35,2534           03712                           TC       VNPOOH                                
028148,000162: 35,2535           32026                           CAF      V06N42                                #  HAPO, HPER, VGDISP
028149,000163: 35,2536           03712                           TC       VNPOOH                                
028150,000164: 35,2537           06037                           TC       INTPRET                               
028151,000165: 35,2540           45014        REVN1645           SET      CALL                                  #  TRKMKCNT, TTOGO, +MGA
028152,000166: 35,2541           01071                                    FINALFLG                              
028153,000167: 35,2542           73606                                    VN1645                                
028154,000168: 35,2543           77650                           GOTO                                           
028155,000169: 35,2544           72540                                    REVN1645                              
028156,000170: 

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