Source Code

These source-code files derive from a printout of Luminary 210 (Apollo 15-17 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Jim Lawton, and transcribed to source code by a team of volunteers. This colorized, syntax-highlighted form was created by assembling that transcribed source code. Note that the full page images are available on the Virtual AGC project page at archive.org, while reduced-size images are presented at the VirtualAGC project website. Report or fix any transcription errors at the Virtual AGC project code repository.

Notations on the program listing read, in part:

	GAP: ASSEMBLE REVISION 210 OF AGC PROGRAM LUMINARY 
	BY NASA 2021112-161 17:11 MAR. 19,1971
Note that the date is the date of the printout, not the date of the program revision.

015188,000002:                                                                                                  ## Copyright:   Public domain.
015189,000003:                                                                                                  ## Filename:    R63.agc
015190,000004:                                                                                                  ## Purpose:     A section of Luminary revision 210.
015191,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
015192,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 15-17.
015193,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
015194,000008:                                                                                                  ##              that the code format has been changed to conform to the
015195,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
015196,000010:                                                                                                  ##              original YUL assembler.
015197,000011:                                                                                                  ## Reference:   pp. 350-353
015198,000012:                                                                                                  ## Assembler:   yaYUL
015199,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
015200,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
015201,000015:                                                                                                  ## Mod history: 2016-11-17 JL   Created from Luminary131 version.
015202,000016:                                                                                                  ##              2016-11-24 HG   Transcribed
015203,000017:                                                                                                  ##              2016-12-07 HG   Fix P00 -> POO (appears only in comments)
015204,000018:                                                                                                  ##                              revert above changes
015205,000019:                                                                                                  ##              2016-12-23 RSB  Proofed comment text with octopus/ProoferComments
015206,000020:                                                                                                  ##                              and fixed all errors found.
015207,000021: 

Page 350

015209,000023:                                                                                                  #  SUBROUTINE NAME:    V89CALL
015210,000024:                                                                                                  #  MOD NO:  0                       DATE: 9 JAN 1968
015211,000025:                                                                                                  #  MOD BY:  DIGITAL DEVEL GROUP     LOG SECTION: R63
015212,000026: 
015213,000027:                                                                                                  #  FUNCTIONAL DESCRIPTION:
015214,000028: 
015215,000029:                                                                                                  #  CALLED BY VERB 89 ENTER DURING P00. PRIO 10 USED.  CALCULATES AND
015216,000030:                                                                                                  #  DISPLAYS FINAL FDAI BALL ANGLES TO POINT LM +X OR +Z AXIS AT CSM.
015217,000031: 
015218,000032:                                                                                                  #  1. KEY IN V 89 E ONLY IF IN PROG 00. IF NOT IN P00, OPERATOR ERROR AND
015219,000033:                                                                                                  #  EXIT R63, OTHERWISE CONTINUE.
015220,000034: 
015221,000035:                                                                                                  #  2. IF IN P00, DO IMU STATUS CHECK ROUTINE (R02BOTH). IF IMU ON AND ITS
015222,000036:                                                                                                  #  ORIENTATION KNOWN TO LGC, CONTINUE.
015223,000037: 
015224,000038:                                                                                                  #  3. FLASH DISPLAY V 04 N 06.  R2 INDICATES WHICH SPACECRAFT AXIS IS TO
015225,000039:                                                                                                  #  BE POINTED AT CSM.  INITIAL CHOICE IS PREFERRED (+Z) AXIS (R2=1).
015226,000040:                                                                                                  #  ASTRONAUT CAN CHANGE TO (+X) AXIS (R2 NOT = 1) BY V 22 E 2 E.  CONTINUE
015227,000041:                                                                                                  #  AFTER KEYING IN PROCEED.
015228,000042: 
015229,000043:                                                                                                  #  4. BOTH VEHICLE STATE VECTORS UPDATED BY CONIC EQS.
015230,000044: 
015231,000045:                                                                                                  #  5. HALF MAGNITUDE UNIT LOS VECTOR (IN STABLE MEMBER COORDINATES) AND
015232,000046:                                                                                                  #  HALF MAGNITUDE UNIT SPACECRAFT AXIS VECTOR (IN BODY COORDINATES)
015233,000047:                                                                                                  #  PREPARED FOR VECPOINT.
015234,000048: 
015235,000049:                                                                                                  #  6. GIMBAL ANGLES FROM VECPOINT TRANSFORMED INTO FDAI BALL ANGLES BY
015236,000050:                                                                                                  #  BALLANGS. FLASH DISPLAY V 06 N 18 AND AWAIT RESPONSE.
015237,000051: 
015238,000052:                                                                                                  #  7. RECYCLE - RETURN TO STEP 4.
015239,000053:                                                                                                  #     TERMINATE - EXIT R63.
015240,000054:                                                                                                  #     PROCEED - RESET 3AXISFLG AND CALL R60LEM FOR ATTITUDE MANEUVER.
015241,000055: 
015242,000056: 
015243,000057:                                                                                                  #  CALLING SEQUENCE:  V 89 E.
015244,000058: 
015245,000059:                                                                                                  #  SUBROUTINES CALLED:  CHKPOOH, R02BOTH, GOXDSPF, CSMCONIC, LEMCONIC,
015246,000060:                                                                                                  #                       VECPOINT, BALLANGS, R60LEM.
015247,000061: 
015248,000062:                                                                                                  #  NORMAL EXIT MODES:  TC ENDEXT
015249,000063: 
015250,000064:                                                                                                  #  ALARMS:  1. OPERATOR ERROR IF NOT IN P00.
015251,000065:                                                                                                  #           2. PROGRAM ALARM IF IMU IS OFF.
015252,000066:                                                                                                  #           3. PROGRAM ALARM IF IMU ORIENTATION IS UNKNOWN.
015253,000067: 
015254,000068:                                                                                                  #  OUTPUT:  NONE
015255,000069: 
015256,000070:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED:  NONE
015257,000071: 
015258,000072:                                                                                                  #  DEBRIS:  OPTION1, +1, TDEC1, POINTVSM, SCAXIS, CPHI, CTHETA, CPSI,
015259,000073: 

Page 351

015261,000075:                                                                                                  #           3AXISFLG.
015262,000076: 
015263,000077: 06,3765  E4,1577                                  EBANK=   RONE                                  
015264,000078: 32,2213                                           BANK     32                                    
015265,000079: 26,2000                                           SETLOC   BAWLANGS                              
015266,000080: 26,2000                                           BANK                                           
015267,000081: 
015268,000082: 
015269,000083: 26,2024                                           COUNT*   $$/R63                                
015270,000084: 26,2024           04607        V89CALL            TC       BANKCALL                              #  IMU STATUS CHECK. RETURNS IF ORIENTATION
015271,000085: 26,2025           33757                           CADR     R02BOTH                               #  KNOWN. ALARMS IF NOT.
015272,000086: 26,2026           36266                           CAF      THREE                                 #  ALLOW ASTRONAUT TO SELECT DESIRED
015273,000087: 26,2027           55050                           TS       OPTIONX                               #  TRACKING ATTITUDE AXIS.
015274,000088: 26,2030           34744                           CAF      ONE                                   
015275,000089: 26,2031           55051                           TS       OPTIONX    +1                         
015276,000090: 26,2032           32121                           CAF      VB04N12                               #  V 04 N 12
015277,000091: 26,2033           04607                           TC       BANKCALL                              
015278,000092: 26,2034           20471                           CADR     GOFLASH                               
015279,000093: 26,2035           05474                           TC       ENDEXT                                #  TERMINATE
015280,000094: 26,2036           02040                           TC       +2                                    #  PROCEED
015281,000095: 26,2037           02032                           TC       -5                                    #  DATA IN. OPTION1+1 = 1 FOR Z AXIS
015282,000096: 26,2040           06060        V89RECL            TC       INTPRET                               #                    = 2 FOR X AXIS
015283,000097: 26,2041           43234                           RTB      DAD                                   
015284,000098: 26,2042           21603                                    LOADTIME                              #  READ PRESENT TIME
015285,000099: 26,2043           14124                                    DP1MIN                                
015286,000100: 26,2044           02176                           STORE    TSTART82                              #  SAVE TIME FOR LEMCONIC CALL
015287,000101: 26,2045           34041                           STCALL   TDEC1                                 #  STORE TIME FOR CSMCONIC CALL
015288,000102: 26,2046           27124                                    CSMCONIC                              #  CSM STATE VECTOR UPDATE
015289,000103: 26,2047           77775                           VLOAD                                          #  CSMCONIC LEFT R VECTOR IN RATT
015290,000104: 26,2050           00001                                    RATT                                  
015291,000105: 26,2051           16200                           STODL    RONE                                  #  SAVE FOR LINE OF SIGHT (LOS) COMPUTATION
015292,000106: 26,2052           02176                                    TSTART82                              
015293,000107: 26,2053           34041                           STCALL   TDEC1                                 #  STORE TIME FOR LEMCONIC CALL
015294,000108: 26,2054           27136                                    LEMCONIC                              #  LEM STATE VECTOR UPDATE
015295,000109: 26,2055           52375                           VLOAD    VSU                                   #  CSM POSITION - LEM POSITION = LOS
015296,000110: 26,2056           02200                                    RONE                                  #  LOS VECTOR LEFT IN MPAC
015297,000111: 26,2057           00001                                    RATT                                  
015298,000112: 26,2060           47121                           MXV      RTB                                   #  (REFSMMAT X LOS). TRANSFORMS LOS FROM
015299,000113: 26,2061           01732                                    REFSMMAT                              #  REFERENCE COORD TO STAB MEMB COORD.
015300,000114: 26,2062           21724                                    NORMUNIT                              
015301,000115: 26,2063           03773                           STORE    POINTVSM                              #  STORE LOS FOR VECPOINT CALL
015302,000116: 26,2064           77776                           EXIT                                           
015303,000117: 26,2065           41051                           CS       OPTIONX    +1                         #  1 FOR Z AXIS. 2 FOR X AXIS.
015304,000118: 26,2066           64744                           AD       ONE                                   
015305,000119: 26,2067           00006                           EXTEND                                         
015306,000120: 26,2070           12115                           BZF      ALINEZ                                
015307,000121: 26,2071           06060        ALINEX             TC       INTPRET                               #  X AXIS ALIGNMENT
015308,000122: 26,2072           77775                           VLOAD                                          
015309,000123: 26,2073           06503                                    UNITX                                 #  READ (.5, 0, 0)
015310,000124: 

Page 352

015312,000126: 26,2074           37765        V89CALL1           STCALL   SCAXIS                                #  STORE SELECTED ALIGNMENT AXIS
015313,000127: 26,2075           56040                                    VECPOINT                              #  PUTS DESIRED GIM ANG (OG,IG,MG) IN TMPAC
015314,000128: 26,2076           00322                           STORE    CPHI                                  #  STORE GIMBAL ANGLES FOR BALLANGS CALL.
015315,000129: 26,2077           77776                           EXIT                                           
015316,000130: 26,2100           04607                           TC       BANKCALL                              
015317,000131: 26,2101           54300                           CADR     BALLANGS                              #  PUTS DESIRED BALL ANGLES IN FDAIX,Y,Z
015318,000132: 26,2102           32122                           CAF      VB06N18                               #  V 06 N 18
015319,000133: 26,2103           04607                           TC       BANKCALL                              #  NOUN 18 REFERS TO FDAIX,Y,Z
015320,000134: 26,2104           20471                           CADR     GOFLASH                               
015321,000135: 26,2105           05474                           TC       ENDEXT                                #  TERMINATE
015322,000136: 26,2106           02110                           TC       +2                                    #  PROCEED
015323,000137: 26,2107           02040                           TC       V89RECL                               #  RECYCLE
015324,000138: 26,2110           05520                           TC       DOWNFLAG                              #  RESET 3 AXIS FLAG
015325,000139: 26,2111           00124                           ADRES    3AXISFLG                              #  RESET BIT6 FLAG WORD 5
015326,000140: 26,2112           04607                           TC       BANKCALL                              #  PERFORMS LEM MANEUVER TO ALIGN SELECTED
015327,000141: 26,2113           54125                           CADR     R60LEM                                #  SPACECRAFT AXIS TO CSM.
015328,000142: 26,2114           15474                           TCF      ENDEXT                                #  TERMINATE R63
015329,000143: 
015330,000144: 
015331,000145: 26,2115           06060        ALINEZ             TC       INTPRET                               #  Z AXIS ALIGNMENT
015332,000146: 26,2116           52175                           VLOAD    GOTO                                  
015333,000147: 26,2117           06477                                    UNITZ                                 #  READ (0, 0, .5)
015334,000148: 26,2120           54074                                    V89CALL1                              
015335,000149: 
015336,000150: 
015337,000151: 26,2121           01014        VB04N12            VN       412                                   
015338,000152: 26,2122           01422        VB06N18            VN       0618                                  
015339,000153: 

Page 353

015341,000155: 26,2123           00000 13560  DP1MIN             2DEC     6000       B-28                       

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