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.

031227,000002:                                                                                                  ## Copyright:   Public domain.
031228,000003:                                                                                                  ## Filename:    R30.agc
031229,000004:                                                                                                  ## Purpose:     A section of Luminary revision 210.
031230,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
031231,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 15-17.
031232,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
031233,000008:                                                                                                  ##              that the code format has been changed to conform to the
031234,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
031235,000010:                                                                                                  ##              original YUL assembler.
031236,000011:                                                                                                  ## Reference:   pp. 715-725
031237,000012:                                                                                                  ## Assembler:   yaYUL
031238,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
031239,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
031240,000015:                                                                                                  ## Mod history: 2016-11-17 JL   Created from Luminary131 version.
031241,000016:                                                                                                  ##              2016-12-01 RSB  Completed transcription.  The only changes were
031242,000017:                                                                                                  ##                              correction of typos and column alignment in the
031243,000018:                                                                                                  ##                              program comments.
031244,000019:                                                                                                  ##              2016-12-25 RSB  Comment-text proofed using ProoferComments
031245,000020:                                                                                                  ##                              and corrected errors found.
031246,000021:                                                                                                  ##              2017-02-08 RSB  Comment-text fixes discovered while proofing Artemis 72.
031247,000022:                                                                                                  ##              2017-03-17 RSB  Comment-text fixes identified in diff'ing
031248,000023:                                                                                                  ##                              Luminary 99 vs Comanche 55.
031249,000024: 

Page 715

031251,000026:                                                                                                  #  SUBROUTINE NAME:     V82CALL
031252,000027:                                                                                                  #  MOD NO:  0                                                              DATE:           16 FEB 67
031253,000028:                                                                                                  #  MOD BY:  RR BAIRNSFATHER                                                LOG SECTION:    R30
031254,000029:                                                                                                  #  MOD NO: 1            MOD BY: RR BAIRNSFATHER       DATE: 11 APR 67      SR30.1 CHANGED TO ALLOW MONITOR OPERN
031255,000030:                                                                                                  #  MOD  NO: 2           MOD  BY ALONSO                DATE : 11 DEC 67     VB82 PROGRAM REWRITTEN
031256,000031:                                                                                                  #  MOD NO: 3            MOD  BY ALONSO                DATE: 26 MAR 68      PROG MOD TO HANDLE DIF EARTH/MOON SCALE
031257,000032:                                                                                                  #   NEW FUNCTIONAL DESCRIPTION:    CALLED BY VERB 82 ENTER.  PRIORITY 10
031258,000033:                                                                                                  #    USED THROUGHOUT.              CALCULATE AND DISPLAY ORBITAL PARAMETERS
031259,000034: 
031260,000035:                                                                                                  #  1. IF AVERAGE G IS OFF:
031261,000036:                                                                                                  #           FLASH DISPLAY V04N06. R2 INDICATES WHICH SHIP'S STATE VECTOR IS
031262,000037:                                                                                                  #            TO BE UPDATED. INITIAL CHOICE IS THIS SHIP (R2=1). ASTRONAUT
031263,000038:                                                                                                  #            CAN CHANGE TO OTHER SHIP BY V22EXE, WHERE X NOT EQ 1.
031264,000039:                                                                                                  #           SELECTED STATE VECTOR UPDATED BY THISPREC (OTHPREC).
031265,000040:                                                                                                  #           CALLS SR30.1 (WHICH CALLS TFFCONMU + TFFRP/RA) TO CALCULATE
031266,000041:                                                                                                  #            RPER (PERIGEE RADIUS), RAPO (APOGEE RADIUS), HPER (PERIGEE
031267,000042:                                                                                                  #            HEIGHT ABOVE LAUNCH PAD OR LUNAR LANDING SITE), HAPO (APOGEE
031268,000043:                                                                                                  #            HEIGHT AS ABOVE), TPER (TIME TO PERIGEE), TFF (TIME TO
031269,000044:                                                                                                  #            INTERSECT 300 KFT ABOVE PAD OR 35KFT ABOVE LANDING SITE).
031270,000045:                                                                                                  #           FLASH MONITOR V16N44 (HAPO, HPER, TFF).TFF IS -59M59S IF IT WAS
031271,000046:                                                                                                  #            NOT COMPUTABLE, OTHERWISE IT INCREMENTS ONCE PER SECOND.
031272,000047:                                                                                                  #            ASTRONAUT HAS OPTION TO MONITOR TPER BY KEYING IN N 32 E.
031273,000048:                                                                                                  #            DISPLAY IS IN HMS, IS NEGATIVE (AS WAS TFF), AND INCREMENTS
031274,000049:                                                                                                  #            ONCE PER SECOND ONLY IF TFF DISPLAY WAS -59M59S.
031275,000050: 
031276,000051:                                                                                                  #  2. IF AVERAGE G IS ON:
031277,000052:                                                                                                  #           CALLS SR30.1 APPROX EVERY TWO SECS.  STATE VECTOR IS ALWAYS
031278,000053:                                                                                                  #            FOR THIS VEHICLE. V82 DOES NOT DISTURB STATE VECTOR.  RESULTS
031279,000054:                                                                                                  #            OF SR30.1 ARE RAPO, RPER, HAPO, HPER, TPER, TFF.
031280,000055:                                                                                                  #           FLASH MONITOR V16N44 (HAPO, HPER, TFF).
031281,000056:                                                                                                  #  ADDENDUM: HAPO AND HPER SHOULD BE CHANGED TO READ HAPOX AND HPERX IN THE
031282,000057:                                                                                                  #            ABOVE REMARKS.
031283,000058: 
031284,000059:                                                                                                  #  CALLING SEQUENCE:  VERB 82 ENTER.
031285,000060: 
031286,000061: 
031287,000062:                                                                                                  #  SUBROUTINES CALLED:  SR30.1, GOXDSPF
031288,000063:                                                                                                  #                       MAYBE - THISPREC , OTHPREC, LOADTIME, DELRSPL
031289,000064:                                                                                                  #  NORMAL EXIT MODES:  TC ENDEXT
031290,000065: 
031291,000066:                                                                                                  #  ALARMS:  NONE
031292,000067: 
031293,000068:                                                                                                  #  OUTPUT:  HAPOX    (-29) M
031294,000069:                                                                                                  #           HPERX    (-29) M
031295,000070:                                                                                                  #           RAPO     (-29) M EARTH
031296,000071:                                                                                                  #                    (-27) M MOON
031297,000072:                                                                                                  #           RPER     (-29) M EARTH
031298,000073:                                                                                                  #                    (-27) M MOON
031299,000074:                                                                                                  #           TFF      (-28) CS      CONTAINS NEGATIVE QUANTITY
031300,000075:                                                                                                  #           -TPER    (-28) CS      CONTAINS NEGATIVE QUANTITY
031301,000076: 

Page 716

031303,000078:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED: STATE VECTOR.
031304,000079: 
031305,000080:                                                                                                  #  DEBRIS:  QPRET, RONE, VONE,TFF/RTMU, HPERMIN, RPADTEM, V82EMFLG.
031306,000081:                                                                                                  #           MAYBE: TSTART82, V82FLAGS, TDEC1.
031307,000082: 
031308,000083: 13,2374  E4,1512                                  EBANK=   HAPOX                                 
031309,000084: 31,2144                                           BANK     31                                    
031310,000085: 22,2000                                           SETLOC   R30LOC                                
031311,000086: 22,2000                                           BANK                                           
031312,000087: 22,3244                                           COUNT*   $$/R30                                
031313,000088: 
031314,000089: 22,3244           06060        V82CALL            TC       INTPRET                               
031315,000090: 22,3245           52014                           BON      GOTO                                  
031316,000091: 22,3246           03712                                    AVEGFLAG                              
031317,000092: 22,3247           45467                                    V82GON                                #  IF AVERAGE G ON
031318,000093: 22,3250           45251                                    V82GOFF                               #  IF AVERAGE G OFF
031319,000094: 
031320,000095: 22,3251           77776        V82GOFF            EXIT                                           #  ALLOW ASTRONAUT TO SELECT VEHICLE
031321,000096: 22,3252           34743                           CAF      TWO                                   #  DESIRED FOR ORBITAL PARAMETERS
031322,000097: 22,3253           55050                           TS       OPTIONX                               #  CALCULATION AND DISPLAY.
031323,000098: 22,3254           34744                           CAF      ONE                                   
031324,000099: 22,3255           55051                           TS       OPTIONX    +1                         
031325,000100: 22,3256           33320                           CAF      OPTIONVN                              #  V 04 N 06
031326,000101: 22,3257           04607                           TC       BANKCALL                              
031327,000102: 22,3260           20323                           CADR     GOXDSPF                               
031328,000103: 22,3261           05474                           TC       ENDEXT                                #  TERMINATE
031329,000104: 22,3262           03264                           TC       +2                                    #  PROCEED
031330,000105: 22,3263           03256                           TC       -5                                    #  DATA IN. OPTION1+1 = 1 FOR THIS VEHICLE.
031331,000106:                                                                                                  #                 UNEQ 1 FOR OTHER VEHICLE.
031332,000107: 22,3264           34741                           CAF      BIT4                                  #  80 MS
031333,000108: 22,3265           05205                           TC       WAITLIST                              
031334,000109: 22,3266  E4,1531                                  EBANK=   TFF                                   
031335,000110: 22,3266           03432 44064                     2CADR    TICKTEST                              
031336,000111: 
031337,000112: 22,3270           00003                           RELINT                                         
031338,000113: 22,3271           33322        V82GOFLP           CAF      TFFBANK                               #  MAJOR RECYCLE LOOP ENTRY
031339,000114: 22,3272           54003                           TS       EBANK                                 
031340,000115: 22,3273           34746                           CAF      ZERO                                  
031341,000116: 22,3274           55530                           TS       V82FLAGS                              #  ZERO FLAGS FOR TICKTEST. INHIBITS
031342,000117:                                                                                                  #  DECREMENTING OF TFF AND -TPER.
031343,000118: 22,3275           35012                           CAF      PRIO7                                 
031344,000119: 22,3276           05076                           TC       FINDVAC                               #  V82GOFF1 WILL EXECUTE STATE VECTOR
031345,000120: 22,3277  E4,1531                                  EBANK=   TFF                                   #  UPDATE AND ORBIT CALCULATIONS FOR
031346,000121: 22,3277           03323 44064                     2CADR    V82GOFF1                              #  SELECTED VEHICLE ABOUT PROPER BODY.
031347,000122: 
031348,000123: 22,3301           00003                           RELINT                                         
031349,000124: 22,3302           36266        V82STALL           CAF      THREE                                 #  STALL IN THIS LOOP AND WITHOLD V 16 N 44

Page 717

031351,000126: 22,3303           71530                           MASK     V82FLAGS                              #  UNTIL STATE VECTOR UPDATE SETS ONE OF
031352,000127: 22,3304           10000                           CCS      A                                     #  OUR FLAG BITS.
031353,000128: 22,3305           03312                           TC       FLAGGON                               #  EXIT FROM STALL LOOP.
031354,000129: 22,3306           34770                           CAF      1SEC                                  
031355,000130: 22,3307           04607                           TC       BANKCALL                              
031356,000131: 22,3310           01736                           CADR     DELAYJOB                              
031357,000132: 22,3311           03302                           TC       V82STALL                              
031358,000133: 
031359,000134: 22,3312           33321        FLAGGON            CAF      V16N44                                #  MONITOR HAPO,HPER,TFF.
031360,000135: 22,3313           04607                           TC       BANKCALL                              
031361,000136: 22,3314           20323                           CADR     GOXDSPF                               
031362,000137: 22,3315           05565                           TC       B5OFF                                 #  TERM  THIS TELLS TICKTEST TO KILL ITSELF
031363,000138: 22,3316           05565                           TC       B5OFF                                 #  PROCEED  DITTO
031364,000139: 22,3317           03271                           TC       V82GOFLP                              #  RECYCLE  RECOMPUTE STATE VECT + DISPLAY
031365,000140: 
031366,000141: 22,3320           01014        OPTIONVN           VN       412                                   
031367,000142: 22,3321           04054        V16N44             VN       1644                                  
031368,000143: 22,3322           02131        TFFBANK            ECADR    TFF                                   
031369,000144: 
031370,000145: 22,3323           06060        V82GOFF1           TC       INTPRET                               
031371,000146: 22,3324           77634                           RTB                                            
031372,000147: 22,3325           21603                                    LOADTIME                              
031373,000148: 22,3326           00041                           STORE    TDEC1                                 #  TIME FOR STATE VECTOR UPDATE.
031374,000149: 22,3327           02176                           STORE    TSTART82                              #  TIME FOR INTERNAL USE.
031375,000150: 22,3330           77776                           EXIT                                           
031376,000151: 22,3331           41051                           CS       OPTIONX    +1                         #  1 FOR THIS VEHICLE, NOT 1 FOR OTHER.
031377,000152: 22,3332           64744                           AD       ONE                                   
031378,000153: 22,3333           00006                           EXTEND                                         
031379,000154: 22,3334           13360                           BZF      THISSHIP                              
031380,000155: 22,3335           06060        OTHSHIP            TC       INTPRET                               
031381,000156: 22,3336           77624                           CALL                                           #  CALL STATE VECTOR UPDATE FOR OTHER SHIP.
031382,000157: 22,3337           27101                                    OTHPREC                               
031383,000158: 22,3340           77775        BOTHSHIP           VLOAD                                          #  MOVE RESULTS INTO TFFCONIC STORAGE AREAS
031384,000159: 22,3341           00001                                    RATT                                  #   TO BE CALLED BY SR30.1.
031385,000160: 22,3342           26200                           STOVL    RONE                                  #  RATT AT (-29)M FOR EARTH OR MOON
031386,000161: 22,3343           00007                                    VATT                                  
031387,000162: 22,3344           02206                           STORE    VONE                                  #   VATT AT (-7)M/CS FOR EARTH OR MOON
031388,000163: 22,3345           77743                           DLOAD*                                         
031389,000164: 22,3346           73774                                    1/RTMUE,2                             #   X2 IS 0 FOR EARTH CENTERED STATE VEC
031390,000165: 22,3347           00037                           STORE    TFF/RTMU                              #   X2 IS 2 FOR MOON
031391,000166: 22,3350           77743                           DLOAD*                                         #  AS LEFT BY THISPREC OR OTHPREC.
031392,000167: 22,3351           72407                                    MINPERE,2                             
031393,000168: 22,3352           02172                           STORE    HPERMIN                               #    TFFRTMU, HPERMIN AND RPADTEM ARE ALL
031394,000169: 22,3353           46135                           SLOAD    BHIZ                                  #  EARTH/MOON PARAMETERS AS SET HERE.
031395,000170: 22,3354           00050                                    X2                                    
031396,000171: 22,3355           45371                                    EARTHPAD                              
031397,000172: 22,3356           77650                           GOTO                                           
031398,000173: 22,3357           45375                                    MOONPAD                               

Page 718

031400,000175: 22,3360           06060        THISSHIP           TC       INTPRET                               
031401,000176: 22,3361           77624                           CALL                                           #  CALL STATE VECTOR UPDATE FOR THIS SHIP.
031402,000177: 22,3362           27115                                    THISPREC                              
031403,000178: 22,3363           77650                           GOTO                                           
031404,000179: 22,3364           45340                                    BOTHSHIP                              
031405,000180: 
031406,000181:                                                                                                  #  THE FOLLOWING CONSTANTS ARE PAIRWISE INDEXED. DO NOT SEPARATE PAIRS.
031407,000182: 
031408,000183: 22,3365           00001 11530  MINPERM            2DEC     10668      B-27                       #  35 KFT MIN PERIGEE HEIGHT FOR MOON(-27)M
031409,000184: 
031410,000185: 22,3367           00002 31230  MINPERE            2DEC     91440      B-29                       #  300 KFT (-29)M FOR EARTH
031411,000186: 
031412,000187: 22,3371           43145        EARTHPAD           DLOAD    CLRGO                                 #   PAD 37-B RADIUS.  SCALED AT (-29)M.
031413,000188: 22,3372           06336                                    RPAD                                  
031414,000189: 22,3373           03635                                    V82EMFLG                              #   INDICATE EARTH SCALING FOR SR30.1
031415,000190: 22,3374           45401                                    BOTHPAD                               
031416,000191: 
031417,000192: 22,3375           51575        MOONPAD            VLOAD    ABVAL                                 #  COMPUTE MOON PAD RADIUS FROM RLS VECTOR.
031418,000193: 22,3376           02021                                    RLS                                   #   SCALED AT (-27)M.
031419,000194: 22,3377           77614                           SET                                            
031420,000195: 22,3400           03475                                    V82EMFLG                              #   INDICATE MOON SCALING FOR SR30.1
031421,000196: 22,3401           36174        BOTHPAD            STCALL   RPADTEM                               
031422,000197: 22,3402           45553                                    SR30.1                                #  CALCULATE ORBITAL PARAMETERS
031423,000198: 22,3403           45234                           RTB      DSU                                   
031424,000199: 22,3404           21603                                    LOADTIME                              
031425,000200: 22,3405           02176                                    TSTART82                              #  PRESENT TIME - TIME V82GOFF1 BEGAN
031426,000201: 22,3406           02176                           STORE    TSTART82                              #                 SAVE IT
031427,000202: 22,3407           53145                           DLOAD    BZE                                   #  SR30.1 SETS -TPER=0 IF HPER L/
031428,000203: 22,3410           02134                                    -TPER                                 #   HPERMIN (300 OR 35) KFT.
031429,000204: 22,3411           45422                                    TICKTIFF                              #  (-TPER = 0)
031430,000205: 22,3412           43345        TICKTPER           DLOAD    DAD                                   #  (-TPER NON ZERO)  TFF WAS NOT COMPUTED,
031431,000206: 22,3413           02134                                    -TPER                                 #  BUT WAS SET TO 59M59S.DONT TICK TFF, DO
031432,000207: 22,3414           02176                                    TSTART82                              #  TICK -TPER. DISPLAY BOTH.
031433,000208: 22,3415           02134                           STORE    -TPER                                 #  -TPER CORRECTED FOR TIME SINCE V82GOFF1
031434,000209: 22,3416           77776                           EXIT                                           #  BEGAN.
031435,000210: 22,3417           34744                           CAF      BIT1                                  
031436,000211: 22,3420           55530                           TS       V82FLAGS                              #  INFORMS TICKTEST TO INCREMENT ONLY -TPER
031437,000212: 22,3421           05146                           TC       ENDOFJOB                              
031438,000213: 
031439,000214: 22,3422           43345        TICKTIFF           DLOAD    DAD                                   #  (-TPER=0) TFF WAS COMPUTED.TICK TFF.
031440,000215: 22,3423           02132                                    TFF                                   #  DO NOT TICK -TPER.DISPLAY TFF, BUT NOT
031441,000216: 22,3424           02176                                    TSTART82                              #  -TPER.
031442,000217: 22,3425           02132                           STORE    TFF                                   #  TFF CORRECTED FOR TIME SINCE V82GOFF1
031443,000218: 22,3426           77776                           EXIT                                           #  BEGAN.
031444,000219: 22,3427           34743                           CAF      BIT2                                  
031445,000220: 22,3430           55530                           TS       V82FLAGS                              #  INFORMS TICKTEST TO INCREMENT ONLY TFF.
031446,000221: 22,3431           05146                           TC       ENDOFJOB                              
031447,000222: 

Page 719

031449,000224: 22,3432           34740        TICKTEST           CAF      BIT5                                  #  THIS WAITLIST PROGRAM PERPETUATES ITSELF
031450,000225: 22,3433           71043                           MASK     EXTVBACT                              #  ONCE A SEC UNTIL BIT 5 OF EXTVBACT =0.
031451,000226: 22,3434           10000                           CCS      A                                     
031452,000227: 22,3435           03443                           TC       DOTICK                                
031453,000228: 22,3436           37734                           CAF      PRIO25                                
031454,000229: 22,3437           05063                           TC       NOVAC                                 #  TERMINATE V 82.CANT CALL ENDEXT IN RUPT.
031455,000230: 22,3440     1043                                  EBANK=   EXTVBACT                              
031456,000231: 22,3440           05474 04062                     2CADR    ENDEXT                                
031457,000232: 
031458,000233: 22,3442           05263                           TC       TASKOVER                              
031459,000234: 22,3443           34770        DOTICK             CAF      1SEC                                  #  RE-REQUEST TICKTEST.
031460,000235: 22,3444           05205                           TC       WAITLIST                              
031461,000236: 22,3445  E4,1531                                  EBANK=   TFF                                   
031462,000237: 22,3445           03432 44064                     2CADR    TICKTEST                              
031463,000238: 
031464,000239: 22,3447           36266                           CAF      THREE                                 
031465,000240: 22,3450           71530                           MASK     V82FLAGS                              
031466,000241: 22,3451           50000                           INDEX    A                                     
031467,000242: 22,3452           03453                           TC       +1                                    
031468,000243: 22,3453           05263                           TC       TASKOVER                              #  IF NO FLAGBITS SET DONT CHANGE TFF OR
031469,000244:                                                                                                  #  -TPER, BUT CONTINUE LOOP.
031470,000245: 22,3454           03462                           TC       TPERTICK                              #  ONLY BIT 1 SET. INCR -TPER BY 1 SEC.
031471,000246: 22,3455           34770        TFFTICK            CAF      1SEC                                  #  ONLY BIT 2 SET. INCR TFF BY 1 SEC.
031472,000247: 22,3456           54001                           TS       L                                     
031473,000248: 22,3457           34746                           CAF      ZERO                                  
031474,000249: 22,3460           21532                           DAS      TFF                                   
031475,000250: 22,3461           05263                           TC       TASKOVER                              
031476,000251: 22,3462           34770        TPERTICK           CAF      1SEC                                  
031477,000252: 22,3463           54001                           TS       L                                     
031478,000253: 22,3464           34746                           CAF      ZERO                                  
031479,000254: 22,3465           21534                           DAS      -TPER                                 
031480,000255: 22,3466           05263                           TC       TASKOVER                              
031481,000256: 

Page 720

031483,000258: 22,3467           77776        V82GON             EXIT                                           #   AVERAGE G ON.  USE CURRENT STATE VECTOR
031484,000259:                                                                                                  #  FOR ORBITAL PARAMETER CALCULATIONS.
031485,000260: 22,3470           35012                           CAF      PRIO7                                 #  LESS THAN LAMBERT
031486,000261: 22,3471           05076                           TC       FINDVAC                               #  V82GON1 WILL PERFORM ORBIT CALCULATIONS
031487,000262: 22,3472  E4,1531                                  EBANK=   TFF                                   #  ABOUT PROPER BODY APPROX ONCE PER SEC.
031488,000263: 22,3472           03505 44064                     2CADR    V82GON1                               
031489,000264: 
031490,000265: 22,3474           00003                           RELINT                                         
031491,000266: 22,3475           10067                           CCS      NEWJOB                                #  WITHOLD V16 N44 UNTIL FIRST ORBIT CALC
031492,000267: 22,3476           05113                           TC       CHANG1                                #  IS DONE. NOTE: V82GON1 (PRIO7, FINDVAC
031493,000268:                                                                                                  #  JOB) IS COMPLETED BEFORE V82GON (PRIO7,
031494,000269:                                                                                                  #  NOVAC JOB).
031495,000270: 22,3477           33321        V82REDSP           CAF      V16N44                                #  MONITOR HAPO, HPER, TFF
031496,000271: 22,3500           04607                           TC       BANKCALL                              
031497,000272: 22,3501           20323                           CADR     GOXDSPF                               
031498,000273: 22,3502           05565                           TC       B5OFF                                 #  TERM THIS TELLS V82GON1 TO KILL ITSELF.
031499,000274: 22,3503           05565                           TC       B5OFF                                 #  PROC DITTO.
031500,000275: 22,3504           03477                           TC       V82REDSP                              #  RECYCLE
031501,000276: 
031502,000277: 22,3505           06060        V82GON1            TC       INTPRET                               #  THIS EXEC PROGRAM PERPETUATES ITSELF
031503,000278:                                                                                                  #  ONCE A SEC UNTIL BIT 5 OF EXTVBACT =0.
031504,000279: 22,3506           52175                           VLOAD    GOTO                                  #  HOLDS OFF CCS NEWJOB BETWEEN RN AND
031505,000280: 22,3507           01220                                    RN                                    #    VN FETCH SO RN , VN ARE FROM SAME
031506,000281: 22,3510           45511                                    NEXTLINE                              #    STATE VECTOR UPDATE.
031507,000282: 22,3511           26200        NEXTLINE           STOVL    RONE                                  #   RN AT (-29)M FOR EARTH OR MOON
031508,000283: 22,3512           01226                                    VN                                    
031509,000284: 22,3513           02206                           STORE    VONE                                  #  VN AT (-7)M/CS FOR EARTH OR MOON
031510,000285: 22,3514           52014                           BON      GOTO                                  
031511,000286: 22,3515           04304                                    MOONTHIS                              #  FLAG INDICATES BODY ABOUT WHICH ORBITAL
031512,000287: 22,3516           45520                                    MOONGON                               #     CALCULATIONS ARE TO BE PERFORMED.
031513,000288: 22,3517           45531                                    EARTHGON                              #    IF SET - MOON , IF RESET - EARTH.
031514,000289: 
031515,000290: 22,3520           71214        MOONGON            SET      DLOAD                                 
031516,000291: 22,3521           03475                                    V82EMFLG                              #  INDICATE MOON SCALING FOR SR30.1
031517,000292: 22,3522           04001                                    1/RTMUM                               #  LUNAR PARAMETERS LOADED HERE FOR SR30.1
031518,000293: 22,3523           14037                           STODL    TFF/RTMU                              
031519,000294: 22,3524           05366                                    MINPERM                               
031520,000295: 22,3525           26172                           STOVL    HPERMIN                               
031521,000296: 22,3526           02021                                    RLS                                   #   SCALED AT (-27)M.
031522,000297: 22,3527           52046                           ABVAL    GOTO                                  
031523,000298: 22,3530           45540                                    V82GON2                               
031524,000299: 22,3531           71214        EARTHGON           CLEAR    DLOAD                                 
031525,000300: 22,3532           03675                                    V82EMFLG                              #  INDICATE EARTH SCALING FOR SR30.1
031526,000301: 22,3533           04003                                    1/RTMUE                               #  EARTH PARAMETERS LOADED HERE FOR SR30.1
031527,000302: 22,3534           14037                           STODL    TFF/RTMU                              
031528,000303: 22,3535           05370                                    MINPERE                               
031529,000304: 22,3536           16172                           STODL    HPERMIN                               
031530,000305: 22,3537           06336                                    RPAD                                  
031531,000306: 22,3540           36174        V82GON2            STCALL   RPADTEM                               #  COMMON CODE FOR EARTH & MOON.
031532,000307: 22,3541           45553                                    SR30.1                                

Page 721

031534,000309: 22,3542           77776                           EXIT                                           
031535,000310: 22,3543           34740        V82GON3            CAF      BIT5                                  
031536,000311: 22,3544           71043                           MASK     EXTVBACT                              #  SEE IF ASTRONAUT HAS SIGNALLED TERMINATE
031537,000312: 22,3545           00006                           EXTEND                                         
031538,000313: 22,3546           15474                           BZF      ENDEXT                                #  YES, TERMINATE VB 82 LOOP
031539,000314: 22,3547           34770                           CAF      1SEC                                  
031540,000315: 22,3550           04607                           TC       BANKCALL                              #  WAIT ONE SECOND BEFORE REPEATING
031541,000316: 22,3551           01736                           CADR     DELAYJOB                              #    ORBITAL PARAMETER COMPUTATION.
031542,000317: 22,3552           03505                           TC       V82GON1                               
031543,000318: 
031544,000319: 22,3553  22,3543               SPLRET             =        V82GON3                               
031545,000320: 

Page 722

031547,000322:                                                                                                  #  SUBROUTINE NAME: SR30.1
031548,000323:                                                                                                  #  MOD NO:  0                                                              DATE:           16 FEB 67
031549,000324:                                                                                                  #  MOD BY:  RR BAIRNSFATHER                                                LOG SECTION:    R32
031550,000325:                                                                                                  #  MOD NO:  1           MOD BY:  RR BAIRNSFATHER      DATE: 11 APR 67      SR30.1 CHANGED TO ALLOW MONITOR OPERN
031551,000326:                                                                                                  #  MOD NO:  2           MOD BY:  RR BAIRNSFATHER      DATE:  14 APR 67     ADD OVFL CK FOR RAPO
031552,000327:                                                                                                  #  MOD NO:  3           MOD BY ALONSO                 DATE: 11 DEC 67      SUBROUTINE REWRITTEN
031553,000328:                                                                                                  #  MOD NO: 4            MOD BY ALONSO                 DATE: 26 MAR 68      PROG MOD TO HANDLE DIF EARTH/MOON SCALE
031554,000329:                                                                                                  #  MOD NO:  5           MOD BY:  RR BAIRNSFATHER      DATE:  6 AUG 68      OVFL CK FOR HAPO & HPER.VOIDS MOD #2.
031555,000330: 
031556,000331:                                                                                                  #  NEW FUNCTIONAL DESCRIPTION:     ORBITAL PARAMETERS DISPLAY FOR NOUNS 32  AND 44.
031557,000332:                                                                                                  #  SR30.1 CALLS TFFCONMU AND TFFRP/RA TO CALCULATE RPER (PERIGEE RADIUS),
031558,000333:                                                                                                  #  RAPO (APOGEE RADIUS), HPER (PERIGEE HEIGHT ABOVE LAUNCH PAD OR LUNAR
031559,000334:                                                                                                  #  LANDING SITE), HAPO (APOGEE HEIGHT AS ABOVE), TPER (TIME TO PERIGEE),
031560,000335:                                                                                                  #  TFF (TIME TO INTERSECT 300 KFT ABOVE PAD OR 35KFT ABOVE LANDING SITE).
031561,000336:                                                                                                  #  IF HPER IS GREATER THAN OR EQUAL TO HPERMIN, CALCULATES TPER AND STORES
031562,000337:                                                                                                  #  NEGATIVE    IN -TPER. OTHERWISE STORES +0 IN -TPER. WHENEVER TPER IS
031563,000338:                                                                                                  #  CALCULATED, TFF IS NOT COMPUTABLE AND DEFAULTS TO -59MIN 59SEC. IF HAPO
031564,000339:                                                                                                  #  WOULD EXCEED 9999.9 NM, IT IS LIMITED TO THAT VALUE FOR DISPLAY.
031565,000340: 
031566,000341:                                                                                                  #  ADDENDUM: HAPO AND HPER SHOULD BE CHANGED TO READ HAPOX AND HPERX IN THE
031567,000342:                                                                                                  #            ABOVE REMARKS.
031568,000343: 
031569,000344:                                                                                                  #  CALLING SEQUENCE:         CALL
031570,000345:                                                                                                  #                                  SR30.1
031571,000346:                                                                                                  #  SUBROUTINES CALLED:       TFFCONMU, TFFRP/RA, CALCTPER, CALCTFF
031572,000347:                                                                                                  #  NORMAL EXIT MODE:         CALLING LINE +1 (STILL IN INTERPRETIVE MODE)
031573,000348:                                                                                                  #  ALARMS:                   NONE
031574,000349:                                                                                                  #  OUTPUT:  RAPO   (-29) M EARTH   APOGEE RADIUS   EARTH CENTERED COORD.
031575,000350:                                                                                                  #                  (-27) M MOON                    MOON CENTERED COORD.
031576,000351:                                                                                                  #           RPER   (-29) M EARTH   PERIGEE RADIUS  EARTH CENTERED COORD.
031577,000352:                                                                                                  #                  (-27) M MOON                    MOON CENTERED COORD.
031578,000353:                                                                                                  #           HAPOX  (-29) M         APOGEE ALTITUDE ABOVE PAD OR LAND. SITE MAX VALUE LIMITED TO 9999.9 NM.
031579,000354:                                                                                                  #           HPERX  (-29) M         PERIGEE ALT. ABOVE PAD OR LAND. SITE    MAX VALUE LIMITED TO 9999.9 NM.
031580,000355:                                                                                                  #           TFF    (-28) CS        TIME TO 300KFT OR 35KFT ALTITUDE
031581,000356:                                                                                                  #           -TPER  (-28) CS        TIME TO PERIGEE
031582,000357:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED-
031583,000358:                                                                                                  #           TFF/RTMU (+17) EARTH   RECIPROCAL OF PROPER GRAV CONSTANT FOR
031584,000359:                                                                                                  #                    (+14) MOON    EARTH OR MOON = 1/SQRT(MU).
031585,000360:                                                                                                  #           RONE    (-29) M        STATE VECTOR
031586,000361:                                                                                                  #           VONE    (-7) M/CS      STATE VECTOR
031587,000362:                                                                                                  #           RPADTEM (-29) M EARTH  RADIUS OF LAUNCH PAD OR LUNAR LANDING
031588,000363:                                                                                                  #                   (-27) M MOON   SITE.
031589,000364:                                                                                                  #           HPERMIN (-29) M EARTH  (300 OR 35)KFT MINIMUM PERIGEE ALTITUDE
031590,000365:                                                                                                  #                   (-27) M MOON   ABOVE LAUNCH PAD OR LUNAR LANDING SITE.
031591,000366:                                                                                                  #           V82EMFLG (INT SW BIT) RESET FOR EARTH, SET FOR MOON.
031592,000367: 
031593,000368:                                                                                                  #  DEBRIS:       QPRET, PDL, S2
031594,000369: 

Page 723

031596,000371: 22,3553                                           COUNT*   $$/SR30S                              
031597,000372: 
031598,000373: 22,3553           44001        SR30.1             SETPD    STQ                                   #  INITIALIZE PUSHDOWN LIST.
031599,000374: 22,3554           00001                                    0                                     
031600,000375: 22,3555           00051                                    S2                                    
031601,000376:                                                                                                  #  SR30.1 INPUT: RONE AT (-29)M EARTH/MOON
031602,000377:                                                                                                  #                VONE AT (-7)M/CS
031603,000378:                                                                                                  #   TFFCONMU,TFFRP/RA,CALCTPER AND CALCTFF
031604,000379:                                                                                                  #   CALLS REQUIRE:
031605,000380:                                                                                                  #   EARTH CENTERED (NO RESCALING REQUIRED)
031606,000381:                                                                                                  #                 RONE SCALED TO B-29 M
031607,000382:                                                                                                  #                 VONE SCALED TO B-7 M/CS
031608,000383:                                                                                                  #   MOON CENTERED   (RESCALING REQUIRED)
031609,000384:                                                                                                  #                 RONE SCALED TO B-27 M
031610,000385:                                                                                                  #                 VONE SCALED TO B-5  M/CS
031611,000386: 22,3556           77214                           BOFF     VLOAD                                 
031612,000387: 22,3557           03755                                    V82EMFLG                              #    OFF FOR EARTH , ON FOR MOON.
031613,000388: 22,3560           45567                                    TFFCALLS                              
031614,000389: 22,3561           02200                                    RONE                                  
031615,000390: 22,3562           77752                           VSL2                                           
031616,000391: 22,3563           26200                           STOVL    RONE                                  
031617,000392: 22,3564           02206                                    VONE                                  
031618,000393: 22,3565           77752                           VSL2                                           
031619,000394: 22,3566           02206                           STORE    VONE                                  
031620,000395: 22,3567           77624        TFFCALLS           CALL                                           
031621,000396: 22,3570           57364                                    TFFCONMU                              
031622,000397: 22,3571           77624                           CALL                                           #  TFFRP/RA COMPUTES RAPO,RPER.
031623,000398: 22,3572           57432                                    TFFRP/RA                              
031624,000399:                                                                                                  #  RETURNS WITH RAPO IN D(MPAC).
031625,000400: 22,3573           77625                           DSU                                            
031626,000401: 22,3574           02174                                    RPADTEM                               
031627,000402: 22,3575           64414                           BOFF     SR2R                                  #  NEED HAPO AT (-29)M FOR DISPLAY.
031628,000403:                                                                                                  #  IF MOON CENTERED, RESCALE FROM (-27)M.
031629,000404:                                                                                                  #   IF EARTH CENTERED ALREADY AT (-29)M.
031630,000405: 22,3576           03755                                    V82EMFLG                              #   OFF FOR EARTH , ON FOR MOON.
031631,000406: 22,3577           45600                                    +1                                    
031632,000407: 22,3600           77624                           CALL                                           #  IF HAPO > MAXNM, SET HAPO =9999.9 NM.
031633,000408: 22,3601           45640                                    MAXCHK                                #  OTHERWISE STORE (RAPO-RPADTEM) IN HAPO.
031634,000409: 22,3602           16113        STORHAPO           STODL    HAPOX                                 
031635,000410: 22,3603           00017                                    RPER                                  
031636,000411: 22,3604           77625                           DSU                                            
031637,000412: 22,3605           02174                                    RPADTEM                               #  GIVES HPER AT (-29)M EARTH, (-27)M MOON.
031638,000413: 22,3606           00161                           STORE    MPAC       +4                         #  SAVE THIS FOR COMPARISON TO HPERMIN.
031639,000414: 22,3607           64414                           BOFF     SR2R                                  #  NEED HPER AT (-29)M FOR DISPLAY.
031640,000415:                                                                                                  #  IF MOON CENTERED, RESCALE FROM (-27)M.
031641,000416:                                                                                                  #  IF EARTH CENTERED ALREADY AT (-29)M.
031642,000417: 22,3610           03755                                    V82EMFLG                              #  OFF FOR EARTH,  ON FOR MOON.
031643,000418: 22,3611           45612                                    +1                                    
031644,000419: 22,3612           77624                           CALL                                           #  IF HPER > MAXNM, SET HPER = 9999.9 NM.
031645,000420: 22,3613           45640                                    MAXCHK                                

Page 724

031647,000422: 22,3614           16115        STORHPER           STODL    HPERX                                 #  STORE (RPER - RPADTEM) INTO HPERX.
031648,000423: 22,3615           00161                                    MPAC       +4                         
031649,000424: 22,3616           51025                           DSU      BPL                                   #  HPERMIN AT (-29)M FOR EARTH, (-27)M MOON
031650,000425: 22,3617           02172                                    HPERMIN                               #  IF HPER L/   HPERMIN (300 OR 35) KFT,
031651,000426: 22,3620           45624                                    DOTPER                                #   THEN ZERO INTO -TPER.
031652,000427: 22,3621           52145                           DLOAD    GOTO                                  #    OTHERWISE CALCULATE TPER.
031653,000428: 22,3622           06505                                    HI6ZEROS                              
031654,000429: 22,3623           45630                                    SKIPTPER                              
031655,000430: 22,3624           45145        DOTPER             DLOAD    CALL                                  
031656,000431: 22,3625           00017                                    RPER                                  
031657,000432: 22,3626           57470                                    CALCTPER                              
031658,000433: 22,3627           77676                           DCOMP                                          #  TPER IS PUT NEG INTO -TPER.
031659,000434: 22,3630           16134        SKIPTPER           STODL    -TPER                                 
031660,000435: 22,3631           02172                                    HPERMIN                               #  HPERMIN AT (-29)M FOR EARTH, (-27)M MOON
031661,000436: 22,3632           45015                           DAD      CALL                                  
031662,000437: 22,3633           02174                                    RPADTEM                               #  RPADTEM AT (-29)M FOR EARTH, (-27)M MOON
031663,000438: 22,3634           57473                                    CALCTFF                               #  GIVES 59M59S FOR TFF IF RPER G/
031664,000439: 22,3635           77676                           DCOMP                                          #    HPERMIN + RPADTEM. (TPER WAS NON ZERO)
031665,000440: 22,3636           36132                           STCALL   TFF                                   #  OTHERWISE COMPUTES TFF.       (GOTO)
031666,000441: 22,3637           00051                                    S2                                    
031667,000442: 
031668,000443: 22,3640           51025        MAXCHK             DSU      BPL                                   #  IF C(MPAC) > 9999.9 NM, MPAC = 9999.9 NM
031669,000444: 22,3641           05650                                    MAXNM                                 
031670,000445: 22,3642           45645                                    +3                                    #  OTHERWISE C(MPAC) = B(MPAC).
031671,000446: 22,3643           43415                           DAD      RVQ                                   
031672,000447: 22,3644           05650                                    MAXNM                                 
031673,000448: 22,3645           43545                 +3        DLOAD    RVQ                                   #  (USED BY P30 - P37 ALSO)
031674,000449: 22,3646           05650                                    MAXNM                                 
031675,000450: 
031676,000451: 22,3647           01065 05603  MAXNM              2OCT     0106505603                            
031677,000452: 

Page 725 This page of the original assembly-listing hardcopy was empty, except for messages generated by the assembler.


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