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.

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

Page 651

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

Page 652

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

Page 653

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

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