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.

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

Page 1385

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

Page 1386

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

Page 1387

060787,000125: 10,3650           64753                           AD       ONE                                   #  OVERFLOW HERE IF 2S COMPL. IS 180 DEG.
060788,000126: 10,3651           40000                           COM                                            
060789,000127: 
060790,000128: 10,3652           60142                           AD       TEM2                                  #  SULT MOVES FROM 2ND TO 3D QUAD.(OR BACK)
060791,000129: 10,3653           10000                           CCS      A                                     #  BACK TO 2S COMPL.
060792,000130: 10,3654           64753                           AD       ONE                                   
060793,000131: 10,3655           13657                           TCF      +2                                    
060794,000132: 10,3656           40000                           COM                                            
060795,000133: 10,3657           54142                           TS       TEM2                                  #  STORE 14BIT QUANTITY WITH PRESENT SIGN
060796,000134: 10,3660           13664                           TCF      +4                                    
060797,000135: 10,3661           50000                           INDEX    A                                     #   SIGN.
060798,000136: 10,3662           34734                           CAF      LIMITS                                #  FIX IT,BY ADDING IN 37777 OR 40000
060799,000137: 10,3663           60142                           AD       TEM2                                  
060800,000138: 
060801,000139: 10,3664           50130                           INDEX    BUF                                   
060802,000140: 10,3665           54000                           TS       0                                     #  STORE NEW ANGLE IN 2S COMPLEMENT.
060803,000141: 10,3666           00002                           TC       Q                                     
060804,000142: 

Page 1388

060806,000144:                                                                                                  #           RTB TO TORQUE GYROS, EXCEPT FOR THE CALL TO IMUSTALL. ECADR OF COMMANDS ARRIVES IN X1.
060807,000145: 
060808,000146: 10,3667           50120        PULSEIMU           INDEX    FIXLOC                                #  ADDRESS OF GYRO COMMANDS SHOULD BE IN X1
060809,000147: 10,3670           30046                           CA       X1                                    
060810,000148: 10,3671           04616                           TC       BANKCALL                              
060811,000149: 10,3672           17270                           CADR     IMUPULSE                              
060812,000150: 10,3673           16073                           TCF      DANZIG                                
060813,000151: 

Page 1389

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

Page 1390

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

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