Source Code

These source-code files are part of a reconstructed copy of Luminary 178, the final release of the Apollo 14 Lunar Module (LM) Apollo Guidance Computer (AGC) software.

The reconstruction began with source code of Zerlina 56, Luminary 210, and Luminary 131, previously transcribed from digitized copies of those programs. The code was created by combining the three, using Zerlina 56 as a base, since it was based off of Luminary 183. The differences between the three were carefully merged using the Luminary memos as a guide, with all changes made after Luminary 178 being backed out. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021152N. Note that page numbers in the reconstructed code match those for the baseline log section mentioned in each file's changelog; the page numbers for a real Luminary 178 listing would be different.

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.

026538,000002:                                                                                                  ## Copyright:   Public domain.
026539,000003:                                                                                                  ## Filename:    P30,P37.agc
026540,000004:                                                                                                  ## Purpose:     A section of Luminary revision 178.
026541,000005:                                                                                                  ##              It is part of the reconstructed source code for the final
026542,000006:                                                                                                  ##              release of the flight software for the Lunar Module's
026543,000007:                                                                                                  ##              (LM) Apollo Guidance Computer (AGC) for Apollo 14. The
026544,000008:                                                                                                  ##              code has been recreated from copies of Zerlina 56, Luminary
026545,000009:                                                                                                  ##              210, and Luminary 131, as well as many Luminary memos.
026546,000010:                                                                                                  ##              It has been adapted such that the resulting bugger words
026547,000011:                                                                                                  ##              exactly match those specified for Luminary 178 in NASA
026548,000012:                                                                                                  ##              drawing 2021152N, which gives relatively high confidence
026549,000013:                                                                                                  ##              that the reconstruction is correct.
026550,000014:                                                                                                  ## Reference:   pp. 612-615
026551,000015:                                                                                                  ## Assembler:   yaYUL
026552,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
026553,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
026554,000018:                                                                                                  ## Mod history: 2019-08-14 MAS  Created from Zerlina 56.
026555,000019: 

Page 612

026557,000021:                                                                                                  #  PROGRAM DESCRIPTION  P30    DATE 3-6-67
026558,000022: 
026559,000023:                                                                                                  #  MOD.1  BY RAMA AIYAWAR
026560,000024:                                                                                                  #  FUNCTIONAL DESCRIPTION
026561,000025:                                                                                                  #     ACCEPT ASTRONAUT INPUTS OF TIG,DELV(LV)
026562,000026:                                                                                                  #     CALL IMU STATUS CHECK ROUTINE (R02)
026563,000027:                                                                                                  #     DISPLAY TIME TO GO, APOGEE, PERIGEE, DELV(MAG), MGA AT IGN
026564,000028:                                                                                                  #     REQUEST BURN PROGRAM
026565,000029: 
026566,000030:                                                                                                  #  CALLING SEQUENCE VIA JOB FROM V37
026567,000031: 
026568,000032:                                                                                                  #  EXIT VIA V37 CALL OR TO GOTOPOOH (V34E)
026569,000033: 
026570,000034:                                                                                                  #  SUBROUTINE CALLS-FLAGUP, PHASCHNG, BANKCALL, ENDOFJOB, GOFLASH, GOFLASHR
026571,000035:                                                                                                  #                   GOPERF3R, INTPRET, BLANKET, GOTOPOOH, R02BOTH, S30.1,
026572,000036:                                                                                                  #                   TTG/N35, MIDGIM, DISPMGA
026573,000037: 
026574,000038:                                                                                                  #  ERASABLE INITIALIZATION- STATE VECTOR
026575,000039: 
026576,000040:                                                                                                  #  OUTPUT-RINIT, VINIT, +MGA, VTIG, RTIG, DELVSIN, DELVSAB, DELVSLV, HAPO,
026577,000041:                                                                                                  #         HPER, TTOGO
026578,000042: 
026579,000043:                                                                                                  #  DEBRIS- A, L, MPAC, PUSHLIST
026580,000044: 
026581,000045: 32,2550                                           BANK     32                                    
026582,000046: 35,2000                                           SETLOC   P30S                                  
026583,000047: 35,2000                                           BANK                                           
026584,000048: 35,2000  E4,1652                                  EBANK=   +MGA                                  
026585,000049: 35,2000                                           COUNT*   $$/P30                                
026586,000050: 35,2000           05515        P30                TC       UPFLAG                                #  SET UPDATE FLAG
026587,000051: 35,2001           00027                           ADRES    UPDATFLG                              
026588,000052: 35,2002           05515                           TC       UPFLAG                                #  SET TRACK FLAG
026589,000053: 35,2003           00031                           ADRES    TRACKFLG                              
026590,000054: 
026591,000055: 35,2004           32032        P30N33             CAF      V06N33                                #  T OF IGN
026592,000056: 35,2005           03627                           TC       VNPOOH                                #  RETURNS ON PROCEED, POOH ON TERMINATE
026593,000057: 
026594,000058: 35,2006           33644                           CAF      V06N81                                #  DISPLAY DELTA V (LV)
026595,000059: 35,2007           03627                           TC       VNPOOH                                #      REDISPLAY ON RECYCLE
026596,000060: 
026597,000061: 35,2010           05527                           TC       DOWNFLAG                              #  RESET UPDATE FLAG
026598,000062: 35,2011           00027                           ADRES    UPDATFLG                              
026599,000063: 35,2012           06042                           TC       INTPRET                               
026600,000064: 35,2013           77624                           CALL                                           
026601,000065: 35,2014           70000                                    S30.1                                 
026602,000066: 35,2015           43014                           SET      SET                                   
026603,000067: 35,2016           00470                                    UPDATFLG                              
026604,000068: 35,2017           01067                                    XDELVFLG                              
026605,000069: 35,2020           77776                           EXIT                                           
026606,000070: 35,2021           32033        PARAM30            CAF      V06N42                                #  DISPLAY APOGEE,PERIGEE ,DELTA V
026607,000071: 

Page 613

026609,000073: 35,2022           03627                           TC       VNPOOH                                
026610,000074: 
026611,000075: 35,2023           06042                           TC       INTPRET                               
026612,000076: 35,2024           77614                           SET                                            
026613,000077: 35,2025           01071                                    FINALFLG                              
026614,000078: 35,2026           77624        REVN1645           CALL                                           
026615,000079: 35,2027           73523                                    VN1645                                
026616,000080: 35,2030           77650                           GOTO                                           #  COMES HERE ON RECYCLE RESPONSE
026617,000081: 35,2031           72026                                    REVN1645                              
026618,000082: 
026619,000083: 35,2032           01441        V06N33             VN       0633                                  
026620,000084: 35,2033           01452        V06N42             VN       0642                                  
026621,000085: 

Page 614

026623,000087:                                                                                                  #  PROGRAM DESCRIPTION S30.1      DATE 9NOV66
026624,000088: 
026625,000089:                                                                                                  #  MOD NO 1        LOG SECTION  P30,P37
026626,000090:                                                                                                  #  MOD  BY  RAMA AIYAWAR **
026627,000091:                                                                                                  #  FUNCTIONAL DESCRIPTION
026628,000092:                                                                                                  #           BASED ON STORED TARGET PARAMETERS(R OF IGNITION(RTIG),V OF
026629,000093:                                                                                                  #           IGNITION(VTIG),TIME OF IGNITION (TIG)),COMPUTE PERIGEE ALTITUDE
026630,000094:                                                                                                  #           APOGEE ALTITUDE AND DELTAV REQUIRED(DELVSIN).
026631,000095:                                                                                                  #  CALLING SEQUENCE
026632,000096:                                                                                                  #      L    CALL
026633,000097:                                                                                                  #      L+1         S30.1
026634,000098:                                                                                                  #  NORMAL EXIT MODE
026635,000099:                                                                                                  #      AT L+2 OR CALLING SEQUENCE (GOTO L+2)
026636,000100:                                                                                                  #  SUBROUTINES CALLED
026637,000101:                                                                                                  #           LEMPREC
026638,000102:                                                                                                  #           PERIAPO
026639,000103:                                                                                                  #  ALARM OR ABORT EXIT MODES
026640,000104:                                                                                                  #                  NONE
026641,000105:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED
026642,000106:                                                                                                  #           TIG       TIME OF IGNITION                   DP     B28CS
026643,000107:                                                                                                  #           DELVSLV   SPECIFIED DELTA-V IN LOCAL VERT.
026644,000108:                                                                                                  #                     COORDS. OF ACTIVE VEHICLE AT
026645,000109:                                                                                                  #                  TIME OF IGNITION      VECTOR  B+7  METERS/CS
026646,000110:                                                                                                  #  OUTPUT
026647,000111:                                                                                                  #           RTIG   POSITION AT TIG       VECTOR  B+29 METERS
026648,000112:                                                                                                  #           VTIG   VELOCITY AT TIG       VECTOR  B+29 METERS/CS
026649,000113:                                                                                                  #           PDL 4D APOGEE ALTITUDE       DP      B+29 M ,  B+27 METERS.
026650,000114:                                                                                                  #           HAPO   APOGEE ALTITUDE       DP      B+29 METERS
026651,000115:                                                                                                  #           PDL 8D PERIGEE ALTITUDE      DP      B+29 M ,  B+27 METERS.
026652,000116:                                                                                                  #           HPER   PERIGEE ALTITUDE      DP      B+29 METERS
026653,000117:                                                                                                  #           DELVSIN   SPECIFIED DELTA-V IN INERTIAL
026654,000118:                                                                                                  #                     COORD. OF ACTIVE VEHICLE AT
026655,000119:                                                                                                  #                  TIME OF IGNITION      VECTOR  B+7  METERS/CS
026656,000120:                                                                                                  #           DELVSAB MAG. OF DELVSIN      VECTOR  B+7  METERS/CS
026657,000121:                                                                                                  #  DEBRIS QTEMP    TEMP. ERASABLE
026658,000122:                                                                                                  #         QPRET,MPAC
026659,000123:                                                                                                  #         PUSHLIST
026660,000124: 
026661,000125: 34,2000                                           SETLOC   P30S1                                 
026662,000126: 34,2000                                           BANK                                           
026663,000127: 
026664,000128: 34,2000                                           COUNT*   $$/S30S                               
026665,000129: 
026666,000130: 34,2000           71220        S30.1              STQ      DLOAD                                 
026667,000131: 34,2001           03632                                    QTEMP                                 
026668,000132: 34,2002           03442                                    TIG                                   #  TIME IGNITION SCALED AT 2(+28)CS
026669,000133: 34,2003           34041                           STCALL   TDEC1                                 
026670,000134: 34,2004           27056                                    LEMPREC                               #  ENCKE ROUTINE FOR LEM
026671,000135: 
026672,000136: 34,2005           67175                           VLOAD    SXA,2                                 
026673,000137: 

Page 615

026675,000139: 34,2006           00001                                    RATT                                  
026676,000140: 34,2007           02777                                    RTX2                                  
026677,000141: 34,2010           03642                           STORE    RTIG                                  #  RADIUS VECTOR AT IGNITION TIME
026678,000142: 34,2011           57456                           UNIT     VCOMP                                 
026679,000143: 34,2012           27656                           STOVL    DELVSIN                               #  ZRF/LV IN DELVSIN SCALED AT 2
026680,000144: 34,2013           00007                                    VATT                                  #  VELOCITY VECTOR AT TIG, SCALED 2(7) M/CS
026681,000145: 34,2014           03650                           STORE    VTIG                                  
026682,000146: 34,2015           53435                           VXV      UNIT                                  
026683,000147: 34,2016           03642                                    RTIG                                  
026684,000148: 34,2017           66001                           SETPD    SXA,1                                 
026685,000149: 34,2020           00001                                    0                                     
026686,000150: 34,2021           02776                                    RTX1                                  
026687,000151: 34,2022           47206                           PUSH     VXV                                   #  YRF/LV PDL 0  SCALED AT 2
026688,000152: 34,2023           03656                                    DELVSIN                               
026689,000153: 34,2024           63372                           VSL1     PDVL                                  
026690,000154: 34,2025           63315                           PDVL     PDVL                                  #  YRF/LV PDL 6   SCALED AT 2
026691,000155: 34,2026           03656                                    DELVSIN                               #  ZRF/LV PDL 12D SCALED AT 2
026692,000156: 34,2027           03434                                    DELVSLV                               
026693,000157: 34,2030           76505                           VXM      VSL1                                  
026694,000158: 34,2031           00001                                    0                                     
026695,000159: 34,2032           03656                           STORE    DELVSIN                               #  DELTAV IN INERT. COOR. SCALED TO B+7M/CS
026696,000160: 34,2033           77646                           ABVAL                                          
026697,000161: 34,2034           27664                           STOVL    DELVSAB                               #  DELTA V MAG.
026698,000162: 34,2035           03642                                    RTIG                                  #  (FOR PERIAPO)
026699,000163: 34,2036           53315                           PDVL     VAD                                   #  VREQUIRED = VTIG + DELVSIN (FOR PERIAPO)
026700,000164: 34,2037           03650                                    VTIG                                  
026701,000165: 34,2040           03656                                    DELVSIN                               
026702,000166: 34,2041           77624                           CALL                                           
026703,000167: 34,2042           46335                                    PERIAPO1                              
026704,000168: 34,2043           77624                           CALL                                           
026705,000169: 34,2044           46445                                    SHIFTR1                               #  RESCALE IF NEEDED
026706,000170: 34,2045           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
026707,000171: 34,2046           45636                                    MAXCHK                                
026708,000172: 34,2047           16321                           STODL    HPER                                  #  PERIGEE ALT 2(29) METERS, FOR DISPLAY
026709,000173: 34,2050           00005                                    4D                                    
026710,000174: 34,2051           77624                           CALL                                           
026711,000175: 34,2052           46445                                    SHIFTR1                               #  RESCALE IF NEEDED
026712,000176: 34,2053           77624                           CALL                                           #  LIMIT DISPLAY TO 9999.9 N. MI.
026713,000177: 34,2054           45636                                    MAXCHK                                
026714,000178: 34,2055           36317                           STCALL   HAPO                                  #  APOGEE  ALT 2(29) METERS, FOR DISPLAY
026715,000179: 34,2056           03632                                    QTEMP                                 

End of include-file P30,P37.agc.  Parent file is MAIN.agc