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.

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

Page 661

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

Page 662

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

Page 663

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

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