Source Code

These source-code files were transcribed from scans made from Don Eyles's personal copy of Luminary 069. They were scanned at archive.org's Boston facility, and the scanning was sponsored by Onno Hommes. The code was transcribed from these scans by a team of volunteers who are referenced in the program comments. Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". In some cases, where similar code blocks exist in previously-transcribed AGC programs (primarily Luminary 99, from Apollo 11) those code blocks were used as a starting point and then corrected to agree with the Luminary 69 scans. The full scans are available at the Virtual AGC project's collection at archive.org, while more-convenient reduced-size (but reduced-quality) images are available at the main Virtual AGC website. Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 069 OF AGC PROGRAM LUMINARY BY NASA 2021112-011
	19:02 NOV. 25,1968
Note that the date is the date of the printout, not the date of the program revision.

028899,000002:                                                                                                  ## Copyright:   Public domain.
028900,000003:                                                                                                  ## Filename:    GENERAL_LAMBERT_AIMPOINT_GUIDANCE.agc
028901,000004:                                                                                                  ## Purpose:     The main source file for Luminary revision 069.
028902,000005:                                                                                                  ##              It is part of the source code for the original release
028903,000006:                                                                                                  ##              of the flight software for the Lunar Module's (LM) Apollo
028904,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 10. The actual flown
028905,000008:                                                                                                  ##              version was Luminary 69 revision 2, which included a
028906,000009:                                                                                                  ##              newer lunar gravity model and only affected module 2.
028907,000010:                                                                                                  ##              This file is intended to be a faithful transcription, except
028908,000011:                                                                                                  ##              that the code format has been changed to conform to the
028909,000012:                                                                                                  ##              requirements of the yaYUL assembler rather than the
028910,000013:                                                                                                  ##              original YUL assembler.
028911,000014:                                                                                                  ## Reference:   pp. 661-663
028912,000015:                                                                                                  ## Assembler:   yaYUL
028913,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
028914,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
028915,000018:                                                                                                  ## Mod history: 2016-12-13 MAS  Created from Luminary 99.
028916,000019:                                                                                                  ##              2016-12-14 MAS  Updated from comment-proofed Luminary 99 version.
028917,000020:                                                                                                  ##              2016-12-17 RRB  Updated for Luminary 69.
028918,000021:                                                                                                  ##              2017-01-28 RSB  Proofed comment text using octopus/prooferComments
028919,000022:                                                                                                  ##                              and fixed errors found.
028920,000023: 

Page 661

028922,000025: 
028923,000026:                                                                                                  #  GENERAL LAMBERT AIMPOINT GUIDANCE **
028924,000027:                                                                                                  #  WRITTEN BY RAMA M AIYAWAR
028925,000028: 
028926,000029:                                                                                                  #  PROGRAM P-31 DESCRIPTION **
028927,000030: 
028928,000031:                                                                                                  #  1.    TO ACCEPT TARGETING PARAMETERS OBTAINED FROM A SOURCE EXTERNAL
028929,000032:                                                                                                  #        TO THE LEM AND COMPUTE THERE FROM THE REQUIRED-VELOCITY AND
028930,000033:                                                                                                  #        OTHER INITIAL CONDITIONS REQUIRED BY LM FOR DESIRED MANEUVER.
028931,000034:                                                                                                  #        THE TARGETING PARAMETERS ARE TIG (TIME OF IGNITION), TARGET 
028932,000035:                                                                                                  #        VECTOR (RTARG), AND THE TIME FROM TIG UNTIL THE TARGET IS
028933,000036:                                                                                                  #        REACHED(DELLT4), DESIRED TIME OF FLIGHT FROM RINIT TO RTARG..
028934,000037: 
028935,000038:                                                                                                  #  ASSUMPTIONS **
028936,000039: 
028937,000040:                                                                                                  #  1.    THE TARGET PARAMETERS MAY HAVE BEEN LOADED PRIOR TO THE
028938,000041:                                                                                                  #        EXECUTION OF THIS PROGRAM.
028939,000042:                                                                                                  #  2.    THIS PROGRAM IS APPLICABLE IN EITHER EARTH OR LUNAR ORBIT.
028940,000043:                                                                                                  #  3.    THIS PROGRAM IS DESIGNED FOR ONE-MAN OPERATION, AND SHOULD
028941,000044:                                                                                                  #        BE SELECTED BY THE ASTRONAUT BY DSKY ENTRY V37 E31.
028942,000045: 
028943,000046:                                                                                                  #  SUBROUTINES USED **
028944,000047:                                                                                                  #  
028945,000048:                                                                                                  #  MANUPARM, TTG/N35, R02BOTH, MIDGIM, DISPMGA, FLAGDOWN, BANKCALL,
028946,000049:                                                                                                  #  GOTOPOOH, ENDOFJOB, PHASCHNG, GOFLASHR, GOFLASH.
028947,000050: 
028948,000051:                                                                                                  #  MANUPARM      CALCULATES APOGEE, PERIGEE ALTITUDES AND DELTAV DESIRED
028949,000052:                                                                                                  #                FOR THE MANEUVER.
028950,000053: 
028951,000054:                                                                                                  #  TTG/N35       CLOCKTASK - UPDATES CLOCK.
028952,000055: 
028953,000056:                                                                                                  #  MIDGIM        CALCULATES MIDDLE GIMBAL ANGLE FOR DISPLAY.
028954,000057: 
028955,000058:                                                                                                  #  R02BOTH       IMU - STATUS CHECK ROUTINE.
028956,000059: 
028957,000060:                                                                                                  #  DISPLAYS USED IN P-31LM **
028958,000061: 
028959,000062:                                                                                                  #  V06N33        DISPLAY SOTRED TIG (IN HRS. MINS. SECS)
028960,000063:                                                                                                  #  V06N42        DISPLAY APOGEE, PERIGEE, DELTAV.
028961,000064:                                                                                                  #  V16N35        DISPLAY TIME FROM TIG.
028962,000065:                                                                                                  #  V06N45        TIME FROM IGNITION AND MIDDLE GIMBAL ANGLE.
028963,000066: 
028964,000067:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED **
028965,000068: 
028966,000069:                                                                                                  #  TIG           TIME OF IGNITION                DP      (B+28) CS.
028967,000070: 
028968,000071:                                                                                                  #  DELLT4        DESIRED TIME OF FLIGHT          DP      (B+28) CS
028969,000072:                                                                                                  #                FROM RINIT TO RTARG.
028970,000073:                                                                                                  #  RTARG         RADIUS VECTOR OF TARGET POSITION VECTOR
028971,000074:                                                                                                  #                RADIUS VECTOR   SCALED TO  (B+29)METERS IF EARTH ORBIT

Page 662

028973,000076:                                                                                                  #                RADIUS VECTOR SCALED TO    (B+27)METERS IF MOON ORBIT
028974,000077: 
028975,000078:                                                                                                  #  OUTPUT **
028976,000079: 
028977,000080:                                                                                                  #  HAPO          APOGEE ALTITUDE
028978,000081:                                                                                                  #  HPER          PERIGEE ALTITUDE
028979,000082:                                                                                                  #  VGDISP        MAG.OF DELTAV FOR DISPLAY ,SCALING      B+7 M/CS EARTH
028980,000083:                                                                                                  #                MAG.OF DELTAV FOR DISPLAY, SCALING      B+5 M/CS MOON
028981,000084:                                                                                                  #  MIDGIM        MIDDLE GIMBAL ANGLE
028982,000085:                                                                                                  #  XDELVFLG      RESETS XDELVFLG FOR LAMBERT VG COMPUTATIONS
028983,000086: 
028984,000087:                                                                                                  #  ALARMS OR ABORTS      NONE **
028985,000088: 
028986,000089:                                                                                                  #  RESTARTS ARE VIA GROUP 4 **
028987,000090: 
028988,000091: 35,2000                                           SETLOC   GLM                                   
028989,000092: 35,2000                                           BANK                                           
028990,000093: 
028991,000094: 35,2414  E7,1466                                  EBANK=   SUBEXIT                               
028992,000095: 
028993,000096: 35,2414                                           COUNT*   $$/P31                                
028994,000097: 35,2414           02325        P31                TC       P20FLGON                              
028995,000098: 35,2415           32025                           CAF      V06N33                                #  TIG
028996,000099: 35,2416           03651                           TC       VNPOOH                                
028997,000100: 35,2417           06036                           TC       INTPRET                               
028998,000101: 35,2420           71214                           CLEAR    DLOAD                                 
028999,000102: 35,2421           00670                                    UPDATFLG                              
029000,000103: 35,2422           03440                                    TIG                                   
029001,000104: 35,2423           34041                           STCALL   TDEC1                                 #  INTEGRATE STATE VECTORS TO TIG
029002,000105: 35,2424           27057                                    LEMPREC                               
029003,000106: 35,2425           40375                           VLOAD    SETPD                                 
029004,000107: 35,2426           00001                                    RATT                                  
029005,000108: 35,2427           00001                                    0D                                    
029006,000109: 35,2430           03640                           STORE    RTIG                                  
029007,000110: 35,2431           26327                           STOVL    RINIT                                 
029008,000111: 35,2432           00007                                    VATT                                  
029009,000112: 35,2433           03646                           STORE    VTIG                                  
029010,000113: 35,2434           16335                           STODL    VINIT                                 
029011,000114: 35,2435           32364                                    P30ZERO                               
029012,000115: 35,2436           65206                           PUSH     PDDL                                  #  E4 AND NUMIT = 0
029013,000116: 35,2437           03450                                    DELLT4                                
029014,000117: 35,2440           66015                           DAD      SXA,1                                 
029015,000118: 35,2441           03440                                    TIG                                   
029016,000119: 35,2442           03375                                    RTX1                                  
029017,000120: 35,2443           03627                           STORE    TPASS4                                
029018,000121: 35,2444           45134                           SXA,2    CALL                                  
029019,000122: 35,2445           03376                                    RTX2                                  
029020,000123: 35,2446           22000                                    INITVEL                               
029021,000124: 35,2447           41575                           VLOAD    PUSH                                  

Page 663

029023,000126: 35,2450           03366                                    DELVEET3                              
029024,000127: 35,2451           03654                           STORE    DELVSIN                               
029025,000128: 35,2452           43046                           ABVAL    CLEAR                                 
029026,000129: 35,2453           01267                                    XDELVFLG                              
029027,000130: 35,2454           37662                           STCALL   VGDISP                                
029028,000131: 35,2455           20021                                    GET.LVC                               
029029,000132: 35,2456           63375                           VLOAD    PDVL                                  
029030,000133: 35,2457           03640                                    RTIG                                  
029031,000134: 35,2460           02343                                    VIPRIME                               
029032,000135: 35,2461           77624                           CALL                                           
029033,000136: 35,2462           46277                                    PERIAPO1                              
029034,000137: 35,2463           77624                           CALL                                           
029035,000138: 35,2464           46407                                    SHIFTR1                               
029036,000139: 35,2465           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
029037,000140: 35,2466           45636                                    MAXCHK                                
029038,000141: 35,2467           16325                           STODL    HPER                                  
029039,000142: 35,2470           00005                                    4D                                    
029040,000143: 35,2471           77624                           CALL                                           
029041,000144: 35,2472           46407                                    SHIFTR1                               
029042,000145: 35,2473           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
029043,000146: 35,2474           45636                                    MAXCHK                                
029044,000147: 35,2475           02323                           STORE    HAPO                                  
029045,000148: 35,2476           77776                           EXIT                                           
029046,000149: 35,2477           33666                           CAF      V06N81                                #  DELVLVC
029047,000150: 35,2500           03651                           TC       VNPOOH                                
029048,000151: 35,2501           32026                           CAF      V06N42                                #  HAPO, HPER, VGDISP
029049,000152: 35,2502           03651                           TC       VNPOOH                                
029050,000153: 35,2503           06036                           TC       INTPRET                               
029051,000154: 35,2504           45014        REVN1645           SET      CALL                                  #  TRKMKCNT, TTOGO, +MGA
029052,000155: 35,2505           01071                                    FINALFLG                              
029053,000156: 35,2506           73542                                    VN1645                                
029054,000157: 35,2507           77650                           GOTO                                           
029055,000158: 35,2510           72504                                    REVN1645                              

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