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
	16:27 JULY 14,1969
Note that the date is the date of the printout, not the date of the program revision.

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

Page 651

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

Page 652

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

Page 653

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

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