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.

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

Page 350

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

Page 351

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

Page 352

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

Page 353

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

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