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.

060679,000002:                                                                                                  ## Copyright:   Public domain.
060680,000003:                                                                                                  ## Filename:    RTB_OP_CODES.agc
060681,000004:                                                                                                  ## Purpose:     A log section of Zerlina 56, the final revision of
060682,000005:                                                                                                  ##              Don Eyles's offline development program for the variable 
060683,000006:                                                                                                  ##              guidance period servicer. It also includes a new P66 with LPD 
060684,000007:                                                                                                  ##              (Landing Point Designator) capability, based on an idea of John 
060685,000008:                                                                                                  ##              Young's. Neither of these advanced features were actually flown,
060686,000009:                                                                                                  ##              but Zerlina was also the birthplace of other big improvements to
060687,000010:                                                                                                  ##              Luminary including the terrain model and new (Luminary 1E)
060688,000011:                                                                                                  ##              analog display programs. Zerlina was branched off of Luminary 145,
060689,000012:                                                                                                  ##              and revision 56 includes all changes up to and including Luminary
060690,000013:                                                                                                  ##              183. It is therefore quite close to the Apollo 14 program,
060691,000014:                                                                                                  ##              Luminary 178, where not modified with new features.
060692,000015:                                                                                                  ## Reference:   pp. 1385-1390
060693,000016:                                                                                                  ## Assembler:   yaYUL
060694,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
060695,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
060696,000019:                                                                                                  ## Mod history: 2017-07-28 MAS  Created from Luminary 210.
060697,000020:                                                                                                  ##              2017-08-19 MAS  Updated for Zerlina 56.
060698,000021: 

Page 1385

060700,000023: 22,3745                                           BANK     22                                    
060701,000024: 10,2000                                           SETLOC   RTBCODES                              
060702,000025: 10,2000                                           BANK                                           
060703,000026: 
060704,000027: 10,3555  E5,1664                                  EBANK=   XNB                                   
060705,000028: 10,3555                                           COUNT*   $$/RTB                                
060706,000029: 
060707,000030:                                                                                                  #           LOAD TIME2, TIME1 INTO MPAC:
060708,000031: 
060709,000032: 10,3555           00006        LOADTIME           EXTEND                                         
060710,000033: 10,3556           30025                           DCA      TIME2                                 
060711,000034: 10,3557           16067                           TCF      SLOAD2                                
060712,000035: 
060713,000036:                                                                                                  #           CONVERT THE SINGLE PRECISION 2'S COMPLEMENT NUMBER ARRIVING IN MPAC (SCALED IN HALF-REVOLUTIONS) TO A
060714,000037:                                                                                                  #  DP 1'S COMPLEMENT NUMBER SCALED IN REVOLUTIONS.
060715,000038: 
060716,000039: 10,3560           10154        CDULOGIC           CCS      MPAC                                  
060717,000040: 10,3561           34755                           CAF      ZERO                                  
060718,000041: 10,3562           13565                           TCF      +3                                    
060719,000042: 10,3563           13564                           NOOP                                           
060720,000043: 10,3564           44736                           CS       HALF                                  
060721,000044: 
060722,000045: 10,3565           54155                           TS       MPAC       +1                         
060723,000046: 10,3566           34755                           CAF      ZERO                                  
060724,000047: 10,3567           56154                           XCH      MPAC                                  
060725,000048: 10,3570           00006                           EXTEND                                         
060726,000049: 10,3571           74736                           MP       HALF                                  
060727,000050: 10,3572           20155                           DAS      MPAC                                  
060728,000051: 10,3573           16073                           TCF      DANZIG                                #  MODE IS ALREADY AT DOUBLE-PRECISION
060729,000052: 
060730,000053:                                                                                                  #           FORCE TP SIGN AGREEMENT IN MPAC:
060731,000054: 
060732,000055: 10,3574           07271        SGNAGREE           TC       TPAGREE                               
060733,000056: 10,3575           16073                           TCF      DANZIG                                
060734,000057: 
060735,000058:                                                                                                  #           CONVERT THE DP 1'S COMPLEMENT ANGLE SCALED IN REVOLUTIONS TO A SINGLE PRECISION 2'S COMPLEMENT ANGLE
060736,000059:                                                                                                  #  SCALED IN HALF-REVOLUTIONS.
060737,000060: 
060738,000061: 10,3576           03626        1STO2S             TC       1TO2SUB                               
060739,000062: 10,3577           34755                           CAF      ZERO                                  
060740,000063: 10,3600           54155                           TS       MPAC       +1                         
060741,000064: 10,3601           16072                           TCF      NEWMODE                               
060742,000065: 
060743,000066:                                                                                                  #           DO 1STO2S ON A VECTOR OF ANGLES:
060744,000067: 
060745,000068: 10,3602           03626        V1STO2S            TC       1TO2SUB                               #  ANSWER ARRIVES IN A AND MPAC.
060746,000069: 
060747,000070: 10,3603           52162                           DXCH     MPAC       +5                         
060748,000071: 10,3604           52155                           DXCH     MPAC                                  
060749,000072: 10,3605           03626                           TC       1TO2SUB                               

Page 1386

060751,000074: 10,3606           54156                           TS       MPAC       +2                         
060752,000075: 
060753,000076: 10,3607           52160                           DXCH     MPAC       +3                         
060754,000077: 10,3610           52155                           DXCH     MPAC                                  
060755,000078: 10,3611           03626                           TC       1TO2SUB                               
060756,000079: 10,3612           54155                           TS       MPAC       +1                         
060757,000080: 
060758,000081: 10,3613           30161                           CA       MPAC       +5                         
060759,000082: 10,3614           54154                           TS       MPAC                                  
060760,000083: 
060761,000084: 10,3615           34753        TPMODE             CAF      ONE                                   #  MODE IS TP.
060762,000085: 10,3616           16072                           TCF      NEWMODE                               
060763,000086: 
060764,000087:                                                                                                  #           V1STO2S FOR 2 COMPONENT VECTOR. USED BY RR.
060765,000088: 
060766,000089: 10,3617           03626        2V1STO2S           TC       1TO2SUB                               
060767,000090: 10,3620           52160                           DXCH     MPAC       +3                         
060768,000091: 10,3621           52155                           DXCH     MPAC                                  
060769,000092: 10,3622           03626                           TC       1TO2SUB                               
060770,000093: 10,3623           54001                           TS       L                                     
060771,000094: 10,3624           30157                           CA       MPAC       +3                         
060772,000095: 10,3625           16067                           TCF      SLOAD2                                
060773,000096: 
060774,000097:                                                                                                  #           SUBROUTINE TO DO DOUBLING AND 1'S TO 2'S CONVERSION:
060775,000098: 
060776,000099: 10,3626           52155        1TO2SUB            DXCH     MPAC                                  #  FINAL MPAC +1 UNSPECIFIED.
060777,000100: 10,3627           20001                           DDOUBL                                         
060778,000101: 10,3630           10000                           CCS      A                                     
060779,000102: 10,3631           64753                           AD       ONE                                   
060780,000103: 10,3632           13634                           TCF      +2                                    
060781,000104: 10,3633           40000                           COM                                            #  THIS WAS REVERSE OF MSU.
060782,000105: 
060783,000106: 10,3634           54154                           TS       MPAC                                  #  AND SKIP ON OVERFLOW.
060784,000107: 10,3635           00002                           TC       Q                                     
060785,000108: 
060786,000109: 10,3636           50000                           INDEX    A                                     #  OVERFLOW UNCORRECT AND IN MSU.
060787,000110: 10,3637           34734                           CAF      LIMITS                                
060788,000111: 10,3640           26154                           ADS      MPAC                                  
060789,000112: 10,3641           00002                           TC       Q                                     
060790,000113: 
060791,000114:                                                                                                  #           THE FOLLOWING ROUTINE INCREMENTS IN 2S COMPLEMENT THE REGISTER WHOSE ADDRESS IS IN BUF BY THE 1S COMPL.
060792,000115:                                                                                                  #  QUANTITY FOUND IN TEM2. THIS MAY BE USED TO INCREMENT DESIRED IMU AND OPTICS CDU ANGLES OR ANY OTHER 2S COMPL.
060793,000116:                                                                                                  #  (+0 UNEQUAL TO -0) QUANTITY. MAY BE CALLED BY BANKCALL/SWCALL.
060794,000117: 
060795,000118: 10,3642           54142        CDUINC             TS       TEM2                                  #  1S COMPL.QUANT. ARRIVES IN ACC. STORE IT
060796,000119: 10,3643           50130                           INDEX    BUF                                   
060797,000120: 10,3644           10000                           CCS      0                                     #  CHANGE 2S COMPL. ANGLE(IN BUF)INTO 1S
060798,000121: 10,3645           64753                           AD       ONE                                   
060799,000122: 10,3646           13652                           TCF      +4                                    
060800,000123: 10,3647           64753                           AD       ONE                                   

Page 1387

060802,000125: 10,3650           64753                           AD       ONE                                   #  OVERFLOW HERE IF 2S COMPL. IS 180 DEG.
060803,000126: 10,3651           40000                           COM                                            
060804,000127: 
060805,000128: 10,3652           60142                           AD       TEM2                                  #  SULT MOVES FROM 2ND TO 3D QUAD.(OR BACK)
060806,000129: 10,3653           10000                           CCS      A                                     #  BACK TO 2S COMPL.
060807,000130: 10,3654           64753                           AD       ONE                                   
060808,000131: 10,3655           13657                           TCF      +2                                    
060809,000132: 10,3656           40000                           COM                                            
060810,000133: 10,3657           54142                           TS       TEM2                                  #  STORE 14BIT QUANTITY WITH PRESENT SIGN
060811,000134: 10,3660           13664                           TCF      +4                                    
060812,000135: 10,3661           50000                           INDEX    A                                     #   SIGN.
060813,000136: 10,3662           34734                           CAF      LIMITS                                #  FIX IT,BY ADDING IN 37777 OR 40000
060814,000137: 10,3663           60142                           AD       TEM2                                  
060815,000138: 
060816,000139: 10,3664           50130                           INDEX    BUF                                   
060817,000140: 10,3665           54000                           TS       0                                     #  STORE NEW ANGLE IN 2S COMPLEMENT.
060818,000141: 10,3666           00002                           TC       Q                                     
060819,000142: 

Page 1388

060821,000144:                                                                                                  #           RTB TO TORQUE GYROS, EXCEPT FOR THE CALL TO IMUSTALL. ECADR OF COMMANDS ARRIVES IN X1.
060822,000145: 
060823,000146: 10,3667           50120        PULSEIMU           INDEX    FIXLOC                                #  ADDRESS OF GYRO COMMANDS SHOULD BE IN X1
060824,000147: 10,3670           30046                           CA       X1                                    
060825,000148: 10,3671           04616                           TC       BANKCALL                              
060826,000149: 10,3672           17270                           CADR     IMUPULSE                              
060827,000150: 10,3673           16073                           TCF      DANZIG                                
060828,000151: 

Page 1389

060830,000153:                                                                                                  #           THE SUBROUTINE  SIGNMPAC  SETS C(MPAC, MPAC +1) TO SIGN(MPAC).
060831,000154:                                                                                                  #  FOR THIS, ONLY THE CONTENTS OF MPAC ARE EXAMINED.    ALSO +0 YIELDS POSMAX AND -0 YIELDS NEGMAX.
060832,000155: 
060833,000156:                                                                                                  #  ENTRY MAY BE BY EITHER OF THE FOLLOWING:
060834,000157: 
060835,000158:                                                                                                  #  1.       LIMIT THE SIZE OF MPAC ON INTERPRETIVE OVERFLOW:
060836,000159:                                                                                                  #  ENTRY:          BOVB
060837,000160:                                                                                                  #                         SIGNMPAC
060838,000161: 
060839,000162:                                                                                                  #  2.       GENERATE IN MPAC THE SIGNUM FUNCTION OF MPAC:
060840,000163:                                                                                                  #  ENTRY:          RTB
060841,000164:                                                                                                  #                         SIGNMPAC
060842,000165: 
060843,000166:                                                                                                  #  IN EITHER CASE, RETURN IS TO  THE NEXT INTERPRETIVE INSTRUCTION IN THE CALLING SEQUENCE.
060844,000167: 
060845,000168: 10,3674           00006        SIGNMPAC           EXTEND                                         
060846,000169: 10,3675           34733                           DCA      DPOSMAX                               
060847,000170: 10,3676           52155                           DXCH     MPAC                                  
060848,000171: 10,3677           10000                           CCS      A                                     
060849,000172: 10,3700           34755        DPMODE             CAF      ZERO                                  #  SETS MPAC +2 TO ZERO IN THE PROCESS
060850,000173: 10,3701           16071                           TCF      SLOAD2     +2                         
060851,000174: 10,3702           13703                           TCF      +1                                    
060852,000175: 10,3703           00006                           EXTEND                                         
060853,000176: 10,3704           44733                           DCS      DPOSMAX                               
060854,000177: 10,3705           16067                           TCF      SLOAD2                                
060855,000178: 
060856,000179:                                                                                                  #      RTB OP CODE NORMUNIT IS LIKE INTERPRETIVE INSTRUCTION UNIT, EXCEPT THAT IT CAN BE DEPENDED ON NOT TO BLOW
060857,000180:                                                                                                  #  UP WHEN THE VECTOR BEING UNITIZED IS VERY SMALL -- IT WILL BLOW UP WHEN ALL COMPONENTS ARE ZERO.   IF NORMUNIT
060858,000181:                                                                                                  #  IS USED AND THE UPPER ORDER HALVES OF ALL COMPONENTS ARE ZERO, THE MAGNITUDE RETURNED IN 36D WILL BE TOO LARGE
060859,000182:                                                                                                  #  BY A FACTOR OF 2(13) AND THE SQUARED MAGNITUDE RETURNED AT 34D WILL BE TOO BIG BY A FACTOR OF 2(26).
060860,000183: 
060861,000184: 10,3706           34753        NORMUNX1           CAF      ONE                                   
060862,000185: 10,3707           13711                           TCF      NORMUNIT   +1                         
060863,000186: 10,3710           34755        NORMUNIT           CAF      ZERO                                  
060864,000187: 10,3711           60120                           AD       FIXLOC                                
060865,000188: 10,3712           54156                           TS       MPAC       +2                         
060866,000189: 10,3713           04616                           TC       BANKCALL                              #  GET SIGN AGREEMENT IN ALL COMPONENTS
060867,000190: 10,3714           01010                           CADR     VECAGREE                              
060868,000191: 10,3715           10154                           CCS      MPAC                                  
060869,000192: 10,3716           13752                           TCF      NOSHIFT                               
060870,000193: 10,3717           13721                           TCF      +2                                    
060871,000194: 10,3720           13752                           TCF      NOSHIFT                               
060872,000195: 10,3721           10157                           CCS      MPAC       +3                         
060873,000196: 10,3722           13752                           TCF      NOSHIFT                               
060874,000197: 10,3723           13725                           TCF      +2                                    
060875,000198: 10,3724           13752                           TCF      NOSHIFT                               
060876,000199: 10,3725           10161                           CCS      MPAC       +5                         
060877,000200: 10,3726           13752                           TCF      NOSHIFT                               
060878,000201: 10,3727           13731                           TCF      +2                                    
060879,000202: 10,3730           13752                           TCF      NOSHIFT                               

Page 1390

060881,000204: 10,3731           30155                           CA       MPAC       +1                         #  SHIFT ALL COMPONENTS LEFT 13
060882,000205: 10,3732           00006                           EXTEND                                         
060883,000206: 10,3733           74736                           MP       BIT14                                 
060884,000207: 10,3734           20155                           DAS      MPAC                                  #  DAS GAINS A LITTLE ACCURACY
060885,000208: 10,3735           30160                           CA       MPAC       +4                         
060886,000209: 10,3736           00006                           EXTEND                                         
060887,000210: 10,3737           74736                           MP       BIT14                                 
060888,000211: 10,3740           20160                           DAS      MPAC       +3                         
060889,000212: 10,3741           30162                           CA       MPAC       +6                         
060890,000213: 10,3742           00006                           EXTEND                                         
060891,000214: 10,3743           74736                           MP       BIT14                                 
060892,000215: 10,3744           20162                           DAS      MPAC       +5                         
060893,000216: 10,3745           34761                           CAF      THIRTEEN                              
060894,000217: 10,3746           50156                           INDEX    MPAC       +2                         
060895,000218: 10,3747           54045                           TS       37D                                   
060896,000219: 10,3750           04635        OFFTUNIT           TC       POSTJUMP                              
060897,000220: 10,3751           01024                           CADR     UNIT       +1                         #  SKIP THE "TC VECAGREE" DONE AT UNIT
060898,000221: 
060899,000222: 
060900,000223: 10,3752           34755        NOSHIFT            CAF      ZERO                                  
060901,000224: 10,3753           13746                           TCF      OFFTUNIT   -2                         
060902,000225: 
060903,000226: 
060904,000227:                                                                                                  #   RTB  VECSGNAG   ...FORCES SIGN AGREEMENT OF VECTOR IN MPAC.
060905,000228: 
060906,000229: 10,3754           04616        VECSGNAG           TC       BANKCALL                              
060907,000230: 10,3755           01010                           CADR     VECAGREE                              
060908,000231: 10,3756           06073                           TC       DANZIG                                

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