Source Code

These source-code files were transcribed from a printout in Don Eyles's personal collection, scanned by archive.org, and financially sponsored by Linden Sims. A team of volunteers performed the transcription and proof-reading. The scanned page images are available at the Virtual AGC Project website, as well as higher-quality (but much larger) images at the Virtual AGC Project's collection in the Internet Archive. Report any problems by creating "issues" at the Virtual AGC Project's GitHub Repository.

Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 56 OF AGC PROGRAM ZERLINA BY ZOROASTER
	9:12 OCT. 21,1970
Note that the date is the date of the printout, not the date of the program revision.

030694,000002:                                                                                                  ## Copyright:   Public domain.
030695,000003:                                                                                                  ## Filename:    R31.agc
030696,000004:                                                                                                  ## Purpose:     A log section of Zerlina 56, the final revision of
030697,000005:                                                                                                  ##              Don Eyles's offline development program for the variable 
030698,000006:                                                                                                  ##              guidance period servicer. It also includes a new P66 with LPD 
030699,000007:                                                                                                  ##              (Landing Point Designator) capability, based on an idea of John 
030700,000008:                                                                                                  ##              Young's. Neither of these advanced features were actually flown,
030701,000009:                                                                                                  ##              but Zerlina was also the birthplace of other big improvements to
030702,000010:                                                                                                  ##              Luminary including the terrain model and new (Luminary 1E)
030703,000011:                                                                                                  ##              analog display programs. Zerlina was branched off of Luminary 145,
030704,000012:                                                                                                  ##              and revision 56 includes all changes up to and including Luminary
030705,000013:                                                                                                  ##              183. It is therefore quite close to the Apollo 14 program,
030706,000014:                                                                                                  ##              Luminary 178, where not modified with new features.
030707,000015:                                                                                                  ## Reference:   pp. 698-702
030708,000016:                                                                                                  ## Assembler:   yaYUL
030709,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
030710,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
030711,000019:                                                                                                  ## Mod history: 2017-07-28 MAS  Created from Luminary 210.
030712,000020:                                                                                                  ##              2017-08-27 MAS  Updated for Zerlina 56.
030713,000021: 

Page 698

030715,000023: 40,3734                                           BANK     40                                    
030716,000024: 40,2000                                           SETLOC   R31LOC                                
030717,000025: 40,2000                                           BANK                                           
030718,000026: 
030719,000027: 40,3734                                           COUNT*   $$/R31                                
030720,000028: 
030721,000029: 40,3734           35015        R31CALL            CAF      PRIO3                                 
030722,000030: 40,3735           05105                           TC       FINDVAC                               
030723,000031: 40,3736  E7,1470                                  EBANK=   SUBEXIT                               
030724,000032: 40,3736           03262 76067                     2CADR    V83CALL                               
030725,000033: 
030726,000034: 40,3740           05232        DSPDELAY           TC       FIXDELAY                              
030727,000035: 40,3741           00144                           DEC      100        B-14                       
030728,000036: 40,3742           31043                           CA       EXTVBACT                              
030729,000037: 40,3743           74740                           MASK     BIT12                                 
030730,000038: 40,3744           00006                           EXTEND                                         
030731,000039: 40,3745           13740                           BZF      DSPDELAY                              
030732,000040: 
030733,000041: 40,3746           35017                           CAF      PRIO5                                 
030734,000042: 40,3747           05072                           TC       NOVAC                                 
030735,000043: 40,3750  E7,1611                                  EBANK=   TSTRT                                 
030736,000044: 40,3750           03754 60107                     2CADR    DISPN5X                               
030737,000045: 
030738,000046: 40,3752           15272                           TCF      TASKOVER                              
030739,000047: 
030740,000048: 40,3753           04066        V16N54             VN       1654                                  
030741,000049: 40,3754           33753        DISPN5X            CAF      V16N54                                
030742,000050: 40,3755           04616                           TC       BANKCALL                              
030743,000051: 40,3756           20334                           CADR     GOMARKF                               
030744,000052: 40,3757           05574                           TC       B5OFF                                 
030745,000053: 40,3760           05574                           TC       B5OFF                                 
030746,000054: 40,3761           13754                           TCF      DISPN5X                               
030747,000055: 
030748,000056: 37,3262                                           BANK     37                                    
030749,000057: 37,2000                                           SETLOC   R31                                   
030750,000058: 37,2000                                           BANK                                           
030751,000059: 
030752,000060: 37,3262           40103        V83CALL            CS       FLAGWRD7                              #  TEST AVERAGE G FLAG
030753,000061: 37,3263           74747                           MASK     AVEGFBIT                              
030754,000062: 37,3264           00006                           EXTEND                                         
030755,000063: 37,3265           13540                           BZF      MUNG?                                 #  ON - TEST MUNFLAG
030756,000064: 
030757,000065: 37,3266           40104                           CS       FLAGWRD8                              
030758,000066: 37,3267           74744                           MASK     SURFFBIT                              
030759,000067: 37,3270           00006                           EXTEND                                         
030760,000068: 37,3271           13544                           BZF      ONEBASE                               #  ON SURFACE - BYPASS LEMPREC
030761,000069: 
030762,000070: 37,3272           06051                           TC       INTPRET                               #  EXTRAPOLATE BOTH STATE VECTORS
030763,000071: 37,3273           77634                           RTB                                            

Page 699

030765,000073: 37,3274           21555                                    LOADTIME                              
030766,000074: 37,3275           34041                           STCALL   TDEC1                                 
030767,000075: 37,3276           27056                                    LEMPREC                               #  PRECISION BASE VECTOR FOR LM
030768,000076: 37,3277           77775                           VLOAD                                          
030769,000077: 37,3300           00017                                    RATT1                                 
030770,000078: 37,3301           26161                           STOVL    BASETHP                               
030771,000079: 37,3302           00025                                    VATT1                                 
030772,000080: 37,3303           16104                           STODL    BASETHV                               
030773,000081: 37,3304           00015                                    TAT                                   
030774,000082: 37,3305           02113        DOCMBASE           STORE    BASETIME                              #  PRECISION BASE VECTOR FOR CM
030775,000083: 37,3306           34041                           STCALL   TDEC1                                 
030776,000084: 37,3307           27042                                    CSMPREC                               
030777,000085: 37,3310           77775                           VLOAD                                          
030778,000086: 37,3311           00017                                    RATT1                                 
030779,000087: 37,3312           26131                           STOVL    BASEOTP                               
030780,000088: 37,3313           00025                                    VATT1                                 
030781,000089: 37,3314           02172                           STORE    BASEOTV                               
030782,000090: 37,3315           77776                           EXIT                                           
030783,000091: 
030784,000092: 37,3316           40103        REV83              CS       FLAGWRD7                              
030785,000093: 37,3317           74747                           MASK     AVEGFBIT                              
030786,000094: 37,3320           00006                           EXTEND                                         
030787,000095: 37,3321           13467                           BZF      GETRVN                                #  IF AVEGFLAG SET, USE RN,VN
030788,000096: 
030789,000097: 37,3322           40104                           CS       FLAGWRD8                              
030790,000098: 37,3323           74744                           MASK     SURFFBIT                              
030791,000099: 37,3324           00006                           EXTEND                                         
030792,000100: 37,3325           13531                           BZF      R31SURF                               #  IF ON SURFACE,USE LEMAREC
030793,000101: 
030794,000102: 37,3326           06051                           TC       INTPRET                               #  DO CONIC EXTRAPOLATION FOR BOTH VEHICLES
030795,000103: 37,3327           77634                           RTB                                            
030796,000104: 37,3330           21555                                    LOADTIME                              
030797,000105: 37,3331           34041                           STCALL   TDEC1                                 
030798,000106: 37,3332           27410                                    INTSTALL                              
030799,000107: 37,3333           43175                           VLOAD    CLEAR                                 
030800,000108: 37,3334           02161                                    BASETHP                               
030801,000109: 37,3335           00263                                    MOONFLAG                              
030802,000110: 37,3336           25535                           STOVL    RCV                                   
030803,000111: 37,3337           02104                                    BASETHV                               
030804,000112: 37,3340           15543                           STODL    VCV                                   
030805,000113: 37,3341           02113                                    BASETIME                              
030806,000114: 37,3342           43014                           BOF      SET                                   #  GET APPROPRIATE MOONFLAG SETTING
030807,000115: 37,3343           04344                                    MOONTHIS                              
030808,000116: 37,3344           77346                                    +2                                    
030809,000117: 37,3345           00063                                    MOONFLAG                              
030810,000118: 37,3346           77614                           SET                                            
030811,000119: 37,3347           01473                                    INTYPFLG                              #  CONIC EXTRAP.
030812,000120: 37,3350           35517                           STCALL   TET                                   
030813,000121: 37,3351           27106                                    INTEGRVS                              #  INTEGRATION --- AT LAST---
030814,000122: 37,3352           77775        OTHCONIC           VLOAD                                          

Page 700

030816,000124: 37,3353           00001                                    RATT                                  
030817,000125: 37,3354           26200                           STOVL    RONE                                  
030818,000126: 37,3355           00007                                    VATT                                  
030819,000127: 37,3356           36206                           STCALL   VONE                                  #  GET SET FOR CONIC EXTRAP.,OTHER.
030820,000128: 37,3357           27410                                    INTSTALL                              
030821,000129: 37,3360           71214                           SET      DLOAD                                 
030822,000130: 37,3361           01473                                    INTYPFLG                              
030823,000131: 37,3362           00015                                    TAT                                   
030824,000132: 37,3363           00041        OTHINT             STORE    TDEC1                                 
030825,000133: 37,3364           43175                           VLOAD    CLEAR                                 
030826,000134: 37,3365           02131                                    BASEOTP                               
030827,000135: 37,3366           00263                                    MOONFLAG                              
030828,000136: 37,3367           25535                           STOVL    RCV                                   
030829,000137: 37,3370           02172                                    BASEOTV                               
030830,000138: 37,3371           15543                           STODL    VCV                                   
030831,000139: 37,3372           02113                                    BASETIME                              
030832,000140: 37,3373           43014                           BOF      SET                                   
030833,000141: 37,3374           04344                                    MOONTHIS                              
030834,000142: 37,3375           77377                                    +2                                    
030835,000143: 37,3376           00063                                    MOONFLAG                              
030836,000144: 37,3377           35517                           STCALL   TET                                   
030837,000145: 37,3400           27106                                    INTEGRVS                              
030838,000146: 37,3401           52375        COMPDISP           VLOAD    VSU                                   
030839,000147: 37,3402           00001                                    RATT                                  
030840,000148: 37,3403           02200                                    RONE                                  
030841,000149: 37,3404           65234                           RTB      PDDL                                  
030842,000150: 37,3405           21706                                    NORMUNX1                              #  UNIT(RANGE) TO PD 0-5
030843,000151: 37,3406           00045                                    36D                                   
030844,000152: 37,3407           77657                           SL*                                            #  RESCALE AFTER NORMUNIT
030845,000153: 37,3410           20201                                    0,1                                   
030846,000154: 37,3411           26214                           STOVL    RANGE                                 #  SCALED 2(29)M
030847,000155: 37,3412           00007                                    VATT                                  
030848,000156: 37,3413           50251                           VSU      DOT                                   #  (VCM- VLM).UNIT(LOS), PD=0
030849,000157: 37,3414           02206                                    VONE                                  
030850,000158: 37,3415           77752                           SL1                                            #  SCALED 2(7)M/CS
030851,000159: 37,3416           26216                           STOVL    RRATE                                 
030852,000160: 37,3417           02200                                    RONE                                  
030853,000161: 37,3420           63256                           UNIT     PDVL                                  #  UNIT(R) TO PD 0-5
030854,000162: 37,3421           06512                                    UNITZ                                 
030855,000163: 37,3422           77624                           CALL                                           
030856,000164: 37,3423           47666                                    CDU*NBSM                              
030857,000165: 37,3424           41505                           VXM      PUSH                                  #  UNIT (Z)/4 TO PD 6-11
030858,000166: 37,3425           01732                                    REFSMMAT                              
030859,000167: 37,3426           72431                           VPROJ    VSL2                                  #  UNIT(P)=UNIT(UZ -(UZ)PROJ(UR))
030860,000168: 37,3427           00001                                    0D                                    
030861,000169: 37,3430           53445                           BVSU     UNIT                                  
030862,000170: 37,3431           00007                                    6D                                    
030863,000171: 37,3432           47315                           PDVL     VXV                                   #  UNIT(P) TO PD 12-17
030864,000172: 37,3433           00001                                    0D                                    #  UNIT(RL)
030865,000173: 37,3434           02206                                    VONE                                  

Page 701

030867,000175: 37,3435           50235                           VXV      DOT                                   #  (UR * VL)*UR . U(P)
030868,000176: 37,3436           00001                                    0D                                    
030869,000177: 37,3437           00015                                    12D                                   
030870,000178: 37,3440           77715                           PDVL                                           #  SIGN TO 12-13 , LOAD U(P)
030871,000179: 37,3441           75241                           DOT      SIGN                                  
030872,000180: 37,3442           00007                                    6D                                    
030873,000181: 37,3443           00015                                    12D                                   
030874,000182: 37,3444           65512                           SL2      ACOS                                  #  ARCCOS(UP.UZ(SIGN))
030875,000183: 37,3445           26220                           STOVL    RTHETA                                
030876,000184: 37,3446           00001                                    0D                                    
030877,000185: 37,3447           51041                           DOT      BPL                                   #  IF UR.UZ NEG,
030878,000186: 37,3450           00007                                    6D                                    #    RTHETA = 1 - RTHETA
030879,000187: 37,3451           77456                                    +5                                    
030880,000188: 37,3452           45345                           DLOAD    DSU                                   
030881,000189: 37,3453           06526                                    DPPOSMAX                              
030882,000190: 37,3454           02220                                    RTHETA                                
030883,000191: 37,3455           02220                           STORE    RTHETA                                
030884,000192: 37,3456           77776                           EXIT                                           
030885,000193: 
030886,000194: 37,3457           34747                           CA       BIT5                                  
030887,000195: 37,3460           71043                           MASK     EXTVBACT                              
030888,000196: 37,3461           00006                           EXTEND                                         #  IF ANSWERED,
030889,000197: 37,3462           15503                           BZF      ENDEXT                                #         TERMINATE
030890,000198: 
030891,000199: 37,3463           41043                           CS       EXTVBACT                              
030892,000200: 37,3464           74740                           MASK     BIT12                                 
030893,000201: 37,3465           27043                           ADS      EXTVBACT                              #  SET BIT 12
030894,000202: 37,3466           13316                           TCF      REV83                                 #  AND START AGAIN.
030895,000203: 
030896,000204: 37,3467           37722        GETRVN             CA       PRIO22                                #  INHIBIT SERVICER
030897,000205: 37,3470           05146                           TC       PRIOCHNG                              
030898,000206: 37,3471           06051                           TC       INTPRET                               
030899,000207: 37,3472           40375                           VLOAD    SETPD                                 
030900,000208: 37,3473           01220                                    RN                                    #  LM STATE VECTOR IN RN,VN
030901,000209: 37,3474           00001                                    0                                     
030902,000210: 37,3475           26200                           STOVL    RONE                                  
030903,000211: 37,3476           01226                                    VN                                    
030904,000212: 37,3477           26206                           STOVL    VONE                                  #  LOAD R(CSM),V(CSM) IN CASE MUNFLAG SET
030905,000213: 37,3500           01724                                    V(CSM)                                #  (TO INSURE TIME COMPATABILITY)
030906,000214: 37,3501           65315                           PDVL     PDDL                                  
030907,000215: 37,3502           01716                                    R(CSM)                                
030908,000216: 37,3503           01234                                    PIPTIME                               
030909,000217: 37,3504           77776                           EXIT                                           
030910,000218: 37,3505           35015                           CA       PRIO3                                 
030911,000219: 37,3506           05146                           TC       PRIOCHNG                              
030912,000220: 37,3507           06051                           TC       INTPRET                               
030913,000221: 37,3510           77214                           BOFF     VLOAD                                 
030914,000222: 37,3511           03347                                    MUNFLAG                               
030915,000223: 37,3512           77524                                    GETRVN2                               #  IF MUNFLAG RESET, DO CM DELTA PRECISION

Page 702

030917,000225: 37,3513           60505                           VXM      VSR4                                  #  CHANGE TO REFERENCE SYSTEM AND RESCALE
030918,000226: 37,3514           01732                                    REFSMMAT                              
030919,000227: 37,3515           77715                           PDVL                                           #  R TO PD 0-5
030920,000228: 37,3516           76505                           VXM      VSL1                                  
030921,000229: 37,3517           01732                                    REFSMMAT                              
030922,000230: 37,3520           40206                           PUSH     SETPD                                 #  V TO PD 5-11
030923,000231: 37,3521           00001                                    0                                     
030924,000232: 37,3522           77650                           GOTO                                           
030925,000233: 37,3523           77401                                    COMPDISP                              
030926,000234: 
030927,000235: 37,3524           77624        GETRVN2            CALL                                           
030928,000236: 37,3525           27410                                    INTSTALL                              
030929,000237: 37,3526           52014                           CLEAR    GOTO                                  
030930,000238: 37,3527           01673                                    INTYPFLG                              #  PREC EXTRAP FOR OTHER
030931,000239: 37,3530           77363                                    OTHINT                                
030932,000240: 37,3531           06051        R31SURF            TC       INTPRET                               
030933,000241: 37,3532           77634                           RTB                                            #  LM IS ON SURFACE, SO PRECISION
030934,000242: 37,3533           21555                                    LOADTIME                              #  INTEGRATION USES PLANETARY INERTIAL
030935,000243: 37,3534           34041                           STCALL   TDEC1                                 #  ORIENTATION SUBROUTINE
030936,000244: 37,3535           27056                                    LEMPREC                               
030937,000245: 37,3536           77650                           GOTO                                           #  DO CSM CONIC
030938,000246: 37,3537           77352                                    OTHCONIC                              
030939,000247: 37,3540           40102        MUNG?              CS       FLAGWRD6                              
030940,000248: 37,3541           74744                           MASK     MUNFLBIT                              
030941,000249: 37,3542           00006                           EXTEND                                         
030942,000250: 37,3543           13467                           BZF      GETRVN                                #  IF MUNFLAG SET, CSM BASE NOT NEEDED
030943,000251: 
030944,000252: 37,3544           06051        ONEBASE            TC       INTPRET                               #  GET CSM BASE VECTOR
030945,000253: 37,3545           52034                           RTB      GOTO                                  
030946,000254: 37,3546           21555                                    LOADTIME                              
030947,000255: 37,3547           77305                                    DOCMBASE                              

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