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 Peter McDermott. 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:

	YUL SYSTEM FOR AGC: NEW PROGRAM SHEPATIN BY EYLES
	DEC 13, 1966

	THIS PROGRAM WAS ASSEMBLED AS A VERSION OF REVISION 37 
        OF PROGRAM SUNBURST BY LEM GROUP
Note that the date is the date of the printout, not the date of the program revision.

014600,000002:                                                                                                  ## Copyright:   Public domain.
014601,000003:                                                                                                  ## Filename:    RTB_OP_CODES.agc
014602,000004:                                                                                                  ## Purpose:     A section of Sunburst revision 37, or Shepatin revision 0.
014603,000005:                                                                                                  ##              It is part of an early development version of the software
014604,000006:                                                                                                  ##              for Apollo Guidance Computer (AGC) on the unmanned Lunar
014605,000007:                                                                                                  ##              Module (LM) flight Apollo 5. Sunburst 37 was the program
014606,000008:                                                                                                  ##              upon which Don Eyles's offline development program Shepatin
014607,000009:                                                                                                  ##              was based; the listing herein transcribed was actually for
014608,000010:                                                                                                  ##              the equivalent revision 0 of Shepatin.
014609,000011:                                                                                                  ##              This file is intended to be a faithful transcription, except
014610,000012:                                                                                                  ##              that the code format has been changed to conform to the
014611,000013:                                                                                                  ##              requirements of the yaYUL assembler rather than the
014612,000014:                                                                                                  ##              original YUL assembler.
014613,000015:                                                                                                  ## Reference:   pp. 342-347
014614,000016:                                                                                                  ## Assembler:   yaYUL
014615,000017:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
014616,000018:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
014617,000019:                                                                                                  ## Mod history: 2017-05-24 MAS  Created from Sunburst 120.
014618,000020:                                                                                                  ##              2017-06-06 HG   Transcribed
014619,000021:                                                                                                  ##              2017-06-22 RSB  Proofed comment text with
014620,000022:                                                                                                  ##                              octopus/ProoferComments.
014621,000023: 

Page 342

014623,000025: 15,3521                                           BANK     15                                    
014624,000026:                                                                                                  #           LOAD TIME2, TIME1 INTO MPAC:
014625,000027: 
014626,000028: 15,3521           00006        LOADTIME           EXTEND                                         
014627,000029: 15,3522           30025                           DCA      TIME2                                 
014628,000030: 15,3523           16533                           TCF      SLOAD2                                
014629,000031: 
014630,000032:                                                                                                  #           CONVERT THE SINGLE PRECISION 2'S COMPLEMENT NUMBER ARRIVING IN MPAC (SCALED IN HALF-REVOLUTIONS) TO A
014631,000033:                                                                                                  #  DP 1'S COMPLEMENT NUMBER SCALED IN REVOLUTIONS.
014632,000034: 
014633,000035: 15,3524           10144        CDULOGIC           CCS      MPAC                                  
014634,000036: 15,3525           37761                           CAF      ZERO                                  
014635,000037: 15,3526           13531                           TCF      +3                                    
014636,000038: 15,3527           13530                           NOOP                                           
014637,000039: 15,3530           47740                           CS       HALF                                  
014638,000040: 
014639,000041: 15,3531           54145                           TS       MPAC       +1                         
014640,000042: 15,3532           37761                           CAF      ZERO                                  
014641,000043: 15,3533           56144                           XCH      MPAC                                  
014642,000044: 15,3534           00006                           EXTEND                                         
014643,000045: 15,3535           77740                           MP       HALF                                  
014644,000046: 15,3536           20145                           DAS      MPAC                                  
014645,000047: 15,3537           16535                           TCF      SLOAD2     +2                         #  C(A) = +0.
014646,000048: 
014647,000049:                                                                                                  #           READ IMU CDUS INTO MPAC AS A VECTOR. ESPECIALLY USEFUL IN CONNECTION WITH SMNB, ETC.
014648,000050: 
014649,000051: 15,3540           00004        READCDUS           INHINT                                         
014650,000052: 15,3541           30033                           CA       CDUY                                  #  IN ORDER Y Z X
014651,000053: 15,3542           54144                           TS       MPAC                                  
014652,000054: 15,3543           30034                           CA       CDUZ                                  
014653,000055: 15,3544           54147                           TS       MPAC       +3                         
014654,000056: 15,3545           30032                           CA       CDUX                                  
014655,000057: 15,3546           13555                           TCF      READPIPS   +6                         #  COMMON CODING.
014656,000058: 
014657,000059:                                                                                                  #           READ THE PIPS INTO MPAC WITHOUT CHANGING THEM:
014658,000060: 
014659,000061: 15,3547           00004        READPIPS           INHINT                                         
014660,000062: 
014661,000063: 15,3550           30037                           CA       PIPAX                                 
014662,000064: 15,3551           54144                           TS       MPAC                                  
014663,000065: 15,3552           30040                           CA       PIPAY                                 
014664,000066: 15,3553           54147                           TS       MPAC       +3                         
014665,000067: 15,3554           30041                           CA       PIPAZ                                 
014666,000068: 15,3555           00003                           RELINT                                         
014667,000069: 15,3556           54151                           TS       MPAC       +5                         
014668,000070: 
014669,000071: 15,3557           37761                           CAF      ZERO                                  
014670,000072: 15,3560           54145                           TS       MPAC       +1                         
014671,000073: 15,3561           54150                           TS       MPAC       +4                         
014672,000074: 15,3562           54152                           TS       MPAC       +6                         
014673,000075: 

Page 343

014675,000077: 15,3563           47755        VECMODE            CS       ONE                                   
014676,000078: 15,3564           16114                           TCF      NEWMODE                               
014677,000079: 
014678,000080:                                                                                                  #           FORCE TP SIGN AGREEMENT IN MPAC:
014679,000081: 
014680,000082: 15,3565           07320        SGNAGREE           TC       TPAGREE                               
014681,000083: 15,3566           16115                           TCF      DANZIG                                
014682,000084: 
014683,000085:                                                                                                  #           CONVERT THE DP 1'S COMPLEMENT ANGLE SCALED IN REVOLUTIONS TO A SINGLE PRECISION 2'S COMPLEMENT ANGLE
014684,000086:                                                                                                  #  SCALED IN HALF-REVOLUTIONS.
014685,000087: 
014686,000088: 15,3567           03617        1STO2S             TC       1TO2SUB                               
014687,000089: 15,3570           37761                           CAF      ZERO                                  
014688,000090: 15,3571           54145                           TS       MPAC       +1                         
014689,000091: 15,3572           16114                           TCF      NEWMODE                               
014690,000092: 
014691,000093:                                                                                                  #           DO 1STO2S ON A VECTOR OF ANGLES:
014692,000094: 
014693,000095: 15,3573           03617        V1STO2S            TC       1TO2SUB                               #  ANSWER ARRIVES IN A AND MPAC.
014694,000096: 
014695,000097: 15,3574           52152                           DXCH     MPAC       +5                         
014696,000098: 15,3575           52145                           DXCH     MPAC                                  
014697,000099: 15,3576           03617                           TC       1TO2SUB                               
014698,000100: 15,3577           54146                           TS       MPAC       +2                         
014699,000101: 
014700,000102: 15,3600           52150                           DXCH     MPAC       +3                         
014701,000103: 15,3601           52145                           DXCH     MPAC                                  
014702,000104: 15,3602           03617                           TC       1TO2SUB                               
014703,000105: 15,3603           54145                           TS       MPAC       +1                         
014704,000106: 
014705,000107: 15,3604           30151                           CA       MPAC       +5                         
014706,000108: 15,3605           54144                           TS       MPAC                                  
014707,000109: 
014708,000110: 15,3606           37755        TPMODE             CAF      ONE                                   #  MODE IS TP.
014709,000111: 15,3607           16114                           TCF      NEWMODE                               
014710,000112: 
014711,000113:                                                                                                  #           V1STO2S FOR 2 COMPONENT VECTOR, USED BY RR.
014712,000114: 
014713,000115: 15,3610           03617        2V1STO2S           TC       1TO2SUB                               
014714,000116: 15,3611           52150                           DXCH     MPAC       +3                         
014715,000117: 15,3612           52145                           DXCH     MPAC                                  
014716,000118: 15,3613           03617                           TC       1TO2SUB                               
014717,000119: 15,3614           54001                           TS       L                                     
014718,000120: 
014719,000121: 15,3615           30147                           CA       MPAC       +3                         
014720,000122: 15,3616           16533                           TCF      SLOAD2                                
014721,000123: 
014722,000124:                                                                                                  #           SUBROUTINE TO DO DOUBLING AND 1'S TO 2'S COMVERSION:
014723,000125: 
014724,000126: 15,3617           52145        1TO2SUB            DXCH     MPAC                                  #  FINAL MPAC +1 UNSPECIFIED.
014725,000127: 15,3620           20001                           DDOUBL                                         
014726,000128: 

Page 344

014728,000130: 15,3621           10000                           CCS      A                                     
014729,000131: 15,3622           67755                           AD       ONE                                   
014730,000132: 
014731,000133: 15,3623           13625                           TCF      +2                                    
014732,000134: 15,3624           40000                           COM                                            #  THIS WAS REVERSE OF MSU.
014733,000135: 
014734,000136: 15,3625           54144                           TS       MPAC                                  #  AND SKIP ON OVERFLOW.
014735,000137: 15,3626           00002                           TC       Q                                     
014736,000138: 
014737,000139: 15,3627           50000                           INDEX    A                                     #  OVERFLOW UNCORRECT AND IN MSU.
014738,000140: 15,3630           37736                           CAF      LIMITS                                
014739,000141: 15,3631           26144                           ADS      MPAC                                  
014740,000142: 15,3632           00002                           TC       Q                                     
014741,000143: 

Page 345

014743,000145:                                                                                                  #           SUBROUTINE TO INCREMENT CDUS
014744,000146: 15,3633           33646        INCRCDUS           CAF      LOCTHETA                              
014745,000147: 15,3634           54120                           TS       BUF                                   #  PLACE ADRES(THETA) IN BUF.
014746,000148: 15,3635           30144                           CAE      MPAC                                  #  INCREMENT IN 1S COMPL.
014747,000149: 15,3636           03647                           TC       CDUINC                                
014748,000150: 
014749,000151: 15,3637           24120                           INCR     BUF                                   
014750,000152: 15,3640           30147                           CAE      MPAC       +3                         
014751,000153: 
014752,000154: 15,3641           03647                           TC       CDUINC                                
014753,000155: 
014754,000156: 15,3642           24120                           INCR     BUF                                   
014755,000157: 15,3643           30151                           CAE      MPAC       +5                         
014756,000158: 15,3644           03647                           TC       CDUINC                                
014757,000159: 
014758,000160: 15,3645           13563                           TCF      VECMODE                               
014759,000161: 
014760,000162: 15,3646           00400        LOCTHETA           ADRES    THETAD                                
014761,000163: 
014762,000164:                                                                                                  #           THE FOLLOWING ROUTINE INCREMENTS IN 2S COMPLEMENT THE REGISTER WHOSE ADDRESS IS IN BUF BY THE 1S COMPL.
014763,000165:                                                                                                  #  QUANTITY FOUND IN TEM2. THIS MAY BE USED TO INCREMENT DESIRED IMU AND OPTICS CDU ANGLES OR ANY OTHER 2S COMPL.
014764,000166:                                                                                                  #  (+0 UNEQUAL TO -0) QUANTITY. MAY BE CALLED BY BANKCALL/SWCALL.
014765,000167: 
014766,000168: 15,3647           54132        CDUINC             TS       TEM2                                  #  1S COMPL.QUANT. ARRIVES IN ACC. STORE IT
014767,000169: 15,3650           50120                           INDEX    BUF                                   
014768,000170: 15,3651           10000                           CCS      0                                     #  CHANGE 2S COMPL. ANGLE(IN BUF)INTO 1S
014769,000171: 15,3652           67755                           AD       ONE                                   
014770,000172: 15,3653           13657                           TCF      +4                                    
014771,000173: 15,3654           67755                           AD       ONE                                   
014772,000174: 15,3655           67755                           AD       ONE                                   #  OVERFLOW HERE IF 2S COMPL. IS 180 DEG.
014773,000175: 15,3656           40000                           COM                                            
014774,000176: 
014775,000177: 15,3657           60132                           AD       TEM2                                  #  ADD IN INCREMENT. WILL OVERFLOW IF RE-
014776,000178:                                                                                                  #  SULT MOVES FROM 2ND TO 3D QUAD.(OR BACK)
014777,000179: 15,3660           10000                           CCS      A                                     #  BACK TO 2S COMPL.
014778,000180: 15,3661           67755                           AD       ONE                                   
014779,000181: 15,3662           13664                           TCF      +2                                    
014780,000182: 15,3663           40000                           COM                                            
014781,000183: 15,3664           54132                           TS       TEM2                                  #  STORE 14BIT QUANTITY WITH PRESENT SIGN
014782,000184: 15,3665           13671                           TCF      +4                                    
014783,000185: 15,3666           50000                           INDEX    A                                     #  OVERFLOW MEANS CORRECT 14BIT VALUE,WRONG
014784,000186:                                                                                                  #   SIGN.
014785,000187: 15,3667           37736                           CAF      LIMITS                                #  FIX IT,BY ADDING IN 37777 OR 40000
014786,000188: 15,3670           60132                           AD       TEM2                                  
014787,000189: 
014788,000190: 15,3671           50120                           INDEX    BUF                                   
014789,000191: 15,3672           54000                           TS       0                                     #  STORE NEW ANGLE IN 2S COMPLEMENT.
014790,000192: 15,3673           00002                           TC       Q                                     
014791,000193: 

Page 346

014793,000195:                                                                                                  #           RTB TO TORQUE GYROS, EXCEPT FOR THE CALL TO IMUSTALL. ECADR OF COMMANDS ARRIVES IN X1.
014794,000196: 
014795,000197: 15,3674           50110        PULSEIMU           INDEX    FIXLOC                                #  ADDRESS OF GYRO COMMANDS SHOULD BE IN X1
014796,000198: 15,3675           30046                           CA       X1                                    
014797,000199: 15,3676           05224                           TC       BANKCALL                              
014798,000200: 15,3677           26361                           CADR     IMUPULSE                              
014799,000201: 15,3700           16115                           TCF      DANZIG                                
014800,000202: 

Page 347

014802,000204:                                                                                                  #           THE FOLLOWING ROUTINE IS USED ONLY IN BENCH TESTING THE RR.
014803,000205: 
014804,000206: 15,3701           05717        RRSIM              TC       FIXDELAY                              
014805,000207: 15,3702           00062                           DEC      50         B-14                       
014806,000208: 
014807,000209: 15,3703           37754        RRSIM2             CAF      BIT2                                  #  SEE IF RR ECTR ENABLED.
014808,000210: 15,3704           00006                           EXTEND                                         
014809,000211: 15,3705           02012                           RAND     12                                    
014810,000212: 15,3706           00006                           EXTEND                                         
014811,000213: 15,3707           13701                           BZF      RRSIM                                 
014812,000214: 
014813,000215: 15,3710           30132                           CA       TEM2                                  #  SAVE EXEC TEMPS SINCE IN RUPT.
014814,000216: 15,3711           54070                           TS       RUPTREG1                              
014815,000217: 15,3712           33752                           CAF      LOPTY                                 
014816,000218: 15,3713           56120                           XCH      BUF                                   
014817,000219: 15,3714           54071                           TS       RUPTREG2                              
014818,000220: 15,3715           30361                           CA       LASTYCMD                              #  ECTR.
014819,000221: 15,3716           60000                           DOUBLE                                         
014820,000222: 15,3717           00006                           EXTEND                                         
014821,000223: 
014822,000224: 15,3720           73753                           MP       RRSIMG                                
014823,000225: 15,3721           03647                           TC       CDUINC                                
014824,000226: 15,3722           24120                           INCR     BUF                                   
014825,000227: 15,3723           30035                           CA       OPTY                                  #  SHAFT CMD IS DIVIDED BY THE ABS VALUE OF
014826,000228: 15,3724           00006                           EXTEND                                         #  THE COS OF THE TRUNNION ANGLE.
014827,000229: 15,3725           20007                           MSU      7                                     #  TO 1S COMPLEMENT.
014828,000230: 15,3726           05372                           TC       SPCOS                                 #                                  *
014829,000231: 15,3727           00006                           EXTEND                                         #  SPCOS NOW GIVES COS SCALED AT 1 *
014830,000232: 15,3730           77740                           MP       BIT14                                 #      (A DAP GROUP FIX)           *
014831,000233: 15,3731           10000                           CCS      A                                     
014832,000234: 15,3732           13735                           TCF      +3                                    
014833,000235: 15,3733           13735                           TCF      +2                                    
014834,000236: 15,3734           13735                           TCF      +1                                    
014835,000237: 15,3735           67755                           AD       ONE                                   
014836,000238: 15,3736           54061                           TS       ITEMP1                                
014837,000239: 
014838,000240: 15,3737           30362                           CA       LASTXCMD                              #  SHAFT RATE DEPENDS ON TRUNNION.
014839,000241: 15,3740           00006                           EXTEND                                         
014840,000242: 15,3741           73753                           MP       RRSIMG                                
014841,000243: 15,3742           00006                           EXTEND                                         
014842,000244: 15,3743           10061                           DV       ITEMP1                                
014843,000245: 15,3744           03647                           TC       CDUINC                                
014844,000246: 15,3745           30070                           CA       RUPTREG1                              
014845,000247: 
014846,000248: 15,3746           54132                           TS       TEM2                                  
014847,000249: 15,3747           30071                           CA       RUPTREG2                              
014848,000250: 15,3750           54120                           TS       BUF                                   
014849,000251: 15,3751           13701                           TCF      RRSIM                                 
014850,000252: 
014851,000253: 15,3752           00035        LOPTY              ADRES    OPTY                                  
014852,000254: 15,3753           22755        RRSIMG             DEC      .59259                                

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