Source Code

These source-code files are part of a reconstructed copy of Luminary 69/2, the flown, final release of the Apollo 10 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction is based on the source code of Luminary 69 — i.e., the initial, unflown version, "revision 0" — of which a contemporary listing was available. The code was then updated by incorporating the differences between Luminary 69 and Luminary 69/2, known from other contemporary documentation. The only such difference is the implementation in Luminary 69/2 of the "R-2 Lunar Potential Model", the source code for which was taken from program Luminary 99/1 (Apollo 11 LM), of which a contemporary listing was also available. Finally, the now-reconstructed Luminary 69/2 was then validated by assembling it to executable form and verifying that its memory banks had the correct checksums, known from still other contemporary documentation.

Note that page numbers in the reconstructed code match those in the original Luminary 69 program listing, or in the ORBITAL INTEGRATION log section, in Luminary 99/1. Page numbers would certainly differ somewhat in a contemporary Luminary 69/2 listing. Moreover, annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change in Luminary 69/2 relative to Luminary 69. Here's a guide to the Apollo documentation referenced in those annotations:
Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository.

028775,000002:                                                                                                  ## Copyright:   Public domain.
028776,000003:                                                                                                  ## Filename:    GENERAL_LAMBERT_AIMPOINT_GUIDANCE.agc
028777,000004:                                                                                                  ## Purpose:     A section of LUM69 revision 2.
028778,000005:                                                                                                  ##              It is part of the reconstructed source code for the flown
028779,000006:                                                                                                  ##              version of the flight software for the Lunar Module's (LM)
028780,000007:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 10. The code has
028781,000008:                                                                                                  ##              been recreated from a copy of Luminary revsion 069, using
028782,000009:                                                                                                  ##              changes present in Luminary 099 which were described in
028783,000010:                                                                                                  ##              Luminary memos 75 and 78. The code has been adapted such
028784,000011:                                                                                                  ##              that the resulting bugger words exactly match those specified
028785,000012:                                                                                                  ##              for LUM69 revision 2 in NASA drawing 2021152B, which gives
028786,000013:                                                                                                  ##              relatively high confidence that the reconstruction is correct.
028787,000014:                                                                                                  ## Reference:   pp. 661-663
028788,000015:                                                                                                  ## Assembler:   yaYUL
028789,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
028790,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
028791,000018:                                                                                                  ## Mod history: 2019-07-27 MAS  Created from Luminary 69.
028792,000019: 

Page 661

028794,000021: 
028795,000022:                                                                                                  #  GENERAL LAMBERT AIMPOINT GUIDANCE **
028796,000023:                                                                                                  #  WRITTEN BY RAMA M AIYAWAR
028797,000024: 
028798,000025:                                                                                                  #  PROGRAM P-31 DESCRIPTION **
028799,000026: 
028800,000027:                                                                                                  #  1.    TO ACCEPT TARGETING PARAMETERS OBTAINED FROM A SOURCE EXTERNAL
028801,000028:                                                                                                  #        TO THE LEM AND COMPUTE THERE FROM THE REQUIRED-VELOCITY AND
028802,000029:                                                                                                  #        OTHER INITIAL CONDITIONS REQUIRED BY LM FOR DESIRED MANEUVER.
028803,000030:                                                                                                  #        THE TARGETING PARAMETERS ARE TIG (TIME OF IGNITION), TARGET 
028804,000031:                                                                                                  #        VECTOR (RTARG), AND THE TIME FROM TIG UNTIL THE TARGET IS
028805,000032:                                                                                                  #        REACHED(DELLT4), DESIRED TIME OF FLIGHT FROM RINIT TO RTARG..
028806,000033: 
028807,000034:                                                                                                  #  ASSUMPTIONS **
028808,000035: 
028809,000036:                                                                                                  #  1.    THE TARGET PARAMETERS MAY HAVE BEEN LOADED PRIOR TO THE
028810,000037:                                                                                                  #        EXECUTION OF THIS PROGRAM.
028811,000038:                                                                                                  #  2.    THIS PROGRAM IS APPLICABLE IN EITHER EARTH OR LUNAR ORBIT.
028812,000039:                                                                                                  #  3.    THIS PROGRAM IS DESIGNED FOR ONE-MAN OPERATION, AND SHOULD
028813,000040:                                                                                                  #        BE SELECTED BY THE ASTRONAUT BY DSKY ENTRY V37 E31.
028814,000041: 
028815,000042:                                                                                                  #  SUBROUTINES USED **
028816,000043:                                                                                                  #  
028817,000044:                                                                                                  #  MANUPARM, TTG/N35, R02BOTH, MIDGIM, DISPMGA, FLAGDOWN, BANKCALL,
028818,000045:                                                                                                  #  GOTOPOOH, ENDOFJOB, PHASCHNG, GOFLASHR, GOFLASH.
028819,000046: 
028820,000047:                                                                                                  #  MANUPARM      CALCULATES APOGEE, PERIGEE ALTITUDES AND DELTAV DESIRED
028821,000048:                                                                                                  #                FOR THE MANEUVER.
028822,000049: 
028823,000050:                                                                                                  #  TTG/N35       CLOCKTASK - UPDATES CLOCK.
028824,000051: 
028825,000052:                                                                                                  #  MIDGIM        CALCULATES MIDDLE GIMBAL ANGLE FOR DISPLAY.
028826,000053: 
028827,000054:                                                                                                  #  R02BOTH       IMU - STATUS CHECK ROUTINE.
028828,000055: 
028829,000056:                                                                                                  #  DISPLAYS USED IN P-31LM **
028830,000057: 
028831,000058:                                                                                                  #  V06N33        DISPLAY SOTRED TIG (IN HRS. MINS. SECS)
028832,000059:                                                                                                  #  V06N42        DISPLAY APOGEE, PERIGEE, DELTAV.
028833,000060:                                                                                                  #  V16N35        DISPLAY TIME FROM TIG.
028834,000061:                                                                                                  #  V06N45        TIME FROM IGNITION AND MIDDLE GIMBAL ANGLE.
028835,000062: 
028836,000063:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED **
028837,000064: 
028838,000065:                                                                                                  #  TIG           TIME OF IGNITION                DP      (B+28) CS.
028839,000066: 
028840,000067:                                                                                                  #  DELLT4        DESIRED TIME OF FLIGHT          DP      (B+28) CS
028841,000068:                                                                                                  #                FROM RINIT TO RTARG.
028842,000069:                                                                                                  #  RTARG         RADIUS VECTOR OF TARGET POSITION VECTOR
028843,000070:                                                                                                  #                RADIUS VECTOR   SCALED TO  (B+29)METERS IF EARTH ORBIT

Page 662

028845,000072:                                                                                                  #                RADIUS VECTOR SCALED TO    (B+27)METERS IF MOON ORBIT
028846,000073: 
028847,000074:                                                                                                  #  OUTPUT **
028848,000075: 
028849,000076:                                                                                                  #  HAPO          APOGEE ALTITUDE
028850,000077:                                                                                                  #  HPER          PERIGEE ALTITUDE
028851,000078:                                                                                                  #  VGDISP        MAG.OF DELTAV FOR DISPLAY ,SCALING      B+7 M/CS EARTH
028852,000079:                                                                                                  #                MAG.OF DELTAV FOR DISPLAY, SCALING      B+5 M/CS MOON
028853,000080:                                                                                                  #  MIDGIM        MIDDLE GIMBAL ANGLE
028854,000081:                                                                                                  #  XDELVFLG      RESETS XDELVFLG FOR LAMBERT VG COMPUTATIONS
028855,000082: 
028856,000083:                                                                                                  #  ALARMS OR ABORTS      NONE **
028857,000084: 
028858,000085:                                                                                                  #  RESTARTS ARE VIA GROUP 4 **
028859,000086: 
028860,000087: 35,2000                                           SETLOC   GLM                                   
028861,000088: 35,2000                                           BANK                                           
028862,000089: 
028863,000090: 35,2414  E7,1466                                  EBANK=   SUBEXIT                               
028864,000091: 
028865,000092: 35,2414                                           COUNT*   $$/P31                                
028866,000093: 35,2414           02325        P31                TC       P20FLGON                              
028867,000094: 35,2415           32025                           CAF      V06N33                                #  TIG
028868,000095: 35,2416           03651                           TC       VNPOOH                                
028869,000096: 35,2417           06036                           TC       INTPRET                               
028870,000097: 35,2420           71214                           CLEAR    DLOAD                                 
028871,000098: 35,2421           00670                                    UPDATFLG                              
028872,000099: 35,2422           03440                                    TIG                                   
028873,000100: 35,2423           34041                           STCALL   TDEC1                                 #  INTEGRATE STATE VECTORS TO TIG
028874,000101: 35,2424           27057                                    LEMPREC                               
028875,000102: 35,2425           40375                           VLOAD    SETPD                                 
028876,000103: 35,2426           00001                                    RATT                                  
028877,000104: 35,2427           00001                                    0D                                    
028878,000105: 35,2430           03640                           STORE    RTIG                                  
028879,000106: 35,2431           26327                           STOVL    RINIT                                 
028880,000107: 35,2432           00007                                    VATT                                  
028881,000108: 35,2433           03646                           STORE    VTIG                                  
028882,000109: 35,2434           16335                           STODL    VINIT                                 
028883,000110: 35,2435           32364                                    P30ZERO                               
028884,000111: 35,2436           65206                           PUSH     PDDL                                  #  E4 AND NUMIT = 0
028885,000112: 35,2437           03450                                    DELLT4                                
028886,000113: 35,2440           66015                           DAD      SXA,1                                 
028887,000114: 35,2441           03440                                    TIG                                   
028888,000115: 35,2442           03375                                    RTX1                                  
028889,000116: 35,2443           03627                           STORE    TPASS4                                
028890,000117: 35,2444           45134                           SXA,2    CALL                                  
028891,000118: 35,2445           03376                                    RTX2                                  
028892,000119: 35,2446           22000                                    INITVEL                               
028893,000120: 35,2447           41575                           VLOAD    PUSH                                  

Page 663

028895,000122: 35,2450           03366                                    DELVEET3                              
028896,000123: 35,2451           03654                           STORE    DELVSIN                               
028897,000124: 35,2452           43046                           ABVAL    CLEAR                                 
028898,000125: 35,2453           01267                                    XDELVFLG                              
028899,000126: 35,2454           37662                           STCALL   VGDISP                                
028900,000127: 35,2455           20021                                    GET.LVC                               
028901,000128: 35,2456           63375                           VLOAD    PDVL                                  
028902,000129: 35,2457           03640                                    RTIG                                  
028903,000130: 35,2460           02343                                    VIPRIME                               
028904,000131: 35,2461           77624                           CALL                                           
028905,000132: 35,2462           46277                                    PERIAPO1                              
028906,000133: 35,2463           77624                           CALL                                           
028907,000134: 35,2464           46407                                    SHIFTR1                               
028908,000135: 35,2465           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
028909,000136: 35,2466           45636                                    MAXCHK                                
028910,000137: 35,2467           16325                           STODL    HPER                                  
028911,000138: 35,2470           00005                                    4D                                    
028912,000139: 35,2471           77624                           CALL                                           
028913,000140: 35,2472           46407                                    SHIFTR1                               
028914,000141: 35,2473           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
028915,000142: 35,2474           45636                                    MAXCHK                                
028916,000143: 35,2475           02323                           STORE    HAPO                                  
028917,000144: 35,2476           77776                           EXIT                                           
028918,000145: 35,2477           33666                           CAF      V06N81                                #  DELVLVC
028919,000146: 35,2500           03651                           TC       VNPOOH                                
028920,000147: 35,2501           32026                           CAF      V06N42                                #  HAPO, HPER, VGDISP
028921,000148: 35,2502           03651                           TC       VNPOOH                                
028922,000149: 35,2503           06036                           TC       INTPRET                               
028923,000150: 35,2504           45014        REVN1645           SET      CALL                                  #  TRKMKCNT, TTOGO, +MGA
028924,000151: 35,2505           01071                                    FINALFLG                              
028925,000152: 35,2506           73542                                    VN1645                                
028926,000153: 35,2507           77650                           GOTO                                           
028927,000154: 35,2510           72504                                    REVN1645                              

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