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.

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

Page 342

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

Page 343

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

Page 344

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

Page 345

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

Page 346

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

Page 347

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

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