Source Code

These source-code files were obtained by digitally photographing an Artemis 72 (Apollo 15-17 Command Module) program listing from a private collection and then modifying pre-existing Comanche 55 (Apollo 11) source files to incorporate changes. Photography was by Ron Burkey, and transcription was performed by a team of volunteers. Note that the page images presented online are of reduced quality, and that additional images may be available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP: ASSEMBLE REVISION 072 OF AGC PROGRAM ARTEMIS 
	BY NASA 2021114-011 11:40 FEB. 26, 1971
Note that the date is the date of the printout, not the date of the program revision.

064526,000002:                                                                                                  ## Copyright:   Public domain.
064527,000003:                                                                                                  ## Filename:    RTB_OP_CODES.agc
064528,000004:                                                                                                  ## Purpose:     Part of the source code for Artemis (i.e., Colossus 3),
064529,000005:                                                                                                  ##              build 072.  This is for the Command Module's (CM)
064530,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for
064531,000007:                                                                                                  ##              Apollo 15-17.
064532,000008:                                                                                                  ## Assembler:   yaYUL
064533,000009:                                                                                                  ## Contact:     Jim Lawton <jim DOT lawton AT gmail DOT com>
064534,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
064535,000011:                                                                                                  ## Page Scans:  www.ibiblio.org/apollo/ScansForConversion/Artemis072/
064536,000012:                                                                                                  ## Mod history: 2009-08-17 JL   Adapted from corresponding Comanche 055 file.
064537,000013:                                                                                                  ##              2009-09-29 JL   Fixed file name in header section.
064538,000014:                                                                                                  ##              2010-02-20 RSB  Un-##'d this header.
064539,000015:                                                                                                  ##              2017-02-08 RSB  Proofed comment text by diff'ing vs Comanche 55
064540,000016:                                                                                                  ##                              and/or octopus/ProoferComments as most-appropriate.
064541,000017: 

Page 1501

064543,000019: 
064544,000020: 24,2000                                           SETLOC   RTBCODE1                              
064545,000021: 24,2000                                           BANK                                           
064546,000022: 
064547,000023: 24,3751  E5,1713                                  EBANK=   XNB                                   
064548,000024: 24,3751                                           COUNT*   $$/RTB                                
064549,000025: 
064550,000026:                                                                                                  #  LOAD TIME2, TIME1 INTO MPAC:
064551,000027: 
064552,000028: 24,3751           00006        LOADTIME           EXTEND                                         
064553,000029: 24,3752           30025                           DCA      TIME2                                 
064554,000030: 24,3753           16024                           TCF      SLOAD2                                
064555,000031: 
064556,000032:                                                                                                  #  CONVERT THE SINGLE PRECISION 2'S COMPLEMENT NUMBER ARRIVING IN MPAC (SCALED IN HALF-REVOLUTIONS) TO A
064557,000033:                                                                                                  #  DP 1'S COMPLEMENT NUMBER SCALED IN REVOLUTIONS.
064558,000034: 
064559,000035: 24,3754           10154        CDULOGIC           CCS      MPAC                                  
064560,000036: 24,3755           34772                           CAF      ZERO                                  
064561,000037: 24,3756           13761                           TCF      +3                                    
064562,000038: 24,3757           13760                           NOOP                                           
064563,000039: 24,3760           44753                           CS       HALF                                  
064564,000040: 
064565,000041: 24,3761           54155                           TS       MPAC       +1                         
064566,000042: 24,3762           34772                           CAF      ZERO                                  
064567,000043: 24,3763           56154                           XCH      MPAC                                  
064568,000044: 24,3764           00006                           EXTEND                                         
064569,000045: 24,3765           74753                           MP       HALF                                  
064570,000046: 24,3766           20155                           DAS      MPAC                                  
064571,000047: 24,3767           16030                           TCF      DANZIG                                #  MODE IS ALREADY AT DOUBLE-PRECISION
064572,000048: 
064573,000049: 22,2000                                           SETLOC   RTBCODES                              
064574,000050: 22,2000                                           BANK                                           
064575,000051: 
064576,000052: 22,3621                                           COUNT*   $$/RTB                                
064577,000053: 
064578,000054:                                                                                                  #  READ THE PIPS INTO MPAC WITHOUT CHANGING THEM:
064579,000055: 
064580,000056: 22,3621           00004        READPIPS           INHINT                                         
064581,000057: 22,3622           30037                           CA       PIPAX                                 
064582,000058: 22,3623           54154                           TS       MPAC                                  
064583,000059: 22,3624           30040                           CA       PIPAY                                 
064584,000060: 22,3625           54157                           TS       MPAC       +3                         
064585,000061: 22,3626           30041                           CA       PIPAZ                                 
064586,000062: 22,3627           00003                           RELINT                                         
064587,000063: 22,3630           54161                           TS       MPAC       +5                         
064588,000064: 
064589,000065: 22,3631           34772                           CAF      ZERO                                  
064590,000066: 22,3632           54155                           TS       MPAC       +1                         
064591,000067: 22,3633           54160                           TS       MPAC       +4                         
064592,000068: 22,3634           54162                           TS       MPAC       +6                         
064593,000069: 22,3635           16470        VECMODE            TCF      VMODE                                 
064594,000070: 

Page 1502

064596,000072: 
064597,000073:                                                                                                  #  FORCE TP SIGN AGREEMENT IN MPAC:
064598,000074: 
064599,000075: 22,3636           07226        SGNAGREE           TC       TPAGREE                               
064600,000076: 22,3637           16030                           TCF      DANZIG                                
064601,000077: 
064602,000078:                                                                                                  #  CONVERT THE DP 1'S COMPLEMENT ANGLE SCALED IN REVOLUTIONS TO A SINGLE PRECISION 2'S COMPLEMENT ANGLE
064603,000079:                                                                                                  #  SCALED IN HALF-REVOLUTIONS.
064604,000080: 
064605,000081: 22,3640           03661        1STO2S             TC       1TO2SUB                               
064606,000082: 22,3641           34772                           CAF      ZERO                                  
064607,000083: 22,3642           54155                           TS       MPAC       +1                         
064608,000084: 22,3643           16027                           TCF      NEWMODE                               
064609,000085: 
064610,000086:                                                                                                  #  DO 1STO2S ON A VECTOR OF ANGLES:
064611,000087: 
064612,000088: 22,3644           03661        V1STO2S            TC       1TO2SUB                               #  ANSWER ARRIVES IN A AND MPAC.
064613,000089: 
064614,000090: 22,3645           52162                           DXCH     MPAC       +5                         
064615,000091: 22,3646           52155                           DXCH     MPAC                                  
064616,000092: 22,3647           03661                           TC       1TO2SUB                               
064617,000093: 22,3650           54156                           TS       MPAC       +2                         
064618,000094: 
064619,000095: 22,3651           52160                           DXCH     MPAC       +3                         
064620,000096: 22,3652           52155                           DXCH     MPAC                                  
064621,000097: 22,3653           03661                           TC       1TO2SUB                               
064622,000098: 22,3654           54155                           TS       MPAC       +1                         
064623,000099: 
064624,000100: 22,3655           30161                           CA       MPAC       +5                         
064625,000101: 22,3656           54154                           TS       MPAC                                  
064626,000102: 
064627,000103: 22,3657           34770        TPMODE             CAF      ONE                                   #  MODE IS TP.
064628,000104: 22,3660           16027                           TCF      NEWMODE                               
064629,000105: 
064630,000106:                                                                                                  #  SUBROUTINE TO DO DOUBLING AND 1'S TO 2'S CONVERSION:
064631,000107: 
064632,000108: 22,3661           52155        1TO2SUB            DXCH     MPAC                                  #  FINAL MPAC +1 UNSPECIFIED.
064633,000109: 22,3662           20001                           DDOUBL                                         
064634,000110: 22,3663           10000                           CCS      A                                     
064635,000111: 22,3664           64770                           AD       ONE                                   
064636,000112: 22,3665           13667                           TCF      +2                                    
064637,000113: 22,3666           40000                           COM                                            #  THIS WAS REVERSE OF MSU.
064638,000114: 
064639,000115: 22,3667           54154                           TS       MPAC                                  #  AND SKIP ON OVERFLOW.
064640,000116: 22,3670           00002                           TC       Q                                     
064641,000117: 
064642,000118: 22,3671           50000                           INDEX    A                                     #  OVERFLOW UNCORRECT AND IN MSU.
064643,000119: 22,3672           34751                           CAF      LIMITS                                
064644,000120: 22,3673           26154                           ADS      MPAC                                  
064645,000121: 22,3674           00002                           TC       Q                                     
064646,000122: 

Page 1503

064648,000124: 
064649,000125:                                                                                                  #  THE FOLLOWING ROUTINE INCREMENTS IN 2S COMPLEMENT THE REGISTER WHOSE ADDRESS IS IN BUF BY THE 1S COMPL.
064650,000126:                                                                                                  #  QUANTITY FOUND IN TEM2. THIS MAY BE USED TO INCREMENT DESIRED IMU AND OPTICS CDU ANGLES OR ANY OTHER 2S COMPL.
064651,000127:                                                                                                  #  (+0 UNEQUAL TO -0) QUANTITY. MAY BE CALLED BY BANKCALL/SWCALL.
064652,000128: 
064653,000129: 22,3675           54142        CDUINC             TS       TEM2                                  #  1S COMPL.QUANT. ARRIVES IN ACC. STORE IT
064654,000130: 22,3676           50130                           INDEX    BUF                                   
064655,000131: 22,3677           10000                           CCS      0                                     #  CHANGE 2S COMPL. ANGLE(IN BUF)INTO 1S
064656,000132: 22,3700           64770                           AD       ONE                                   
064657,000133: 22,3701           13705                           TCF      +4                                    
064658,000134: 22,3702           64770                           AD       ONE                                   
064659,000135: 22,3703           64770                           AD       ONE                                   #  OVERFLOW HERE IF 2S COMPL. IS 180 DEG.
064660,000136: 22,3704           40000                           COM                                            
064661,000137: 
064662,000138: 22,3705           60142                           AD       TEM2                                  #  SULT MOVES FROM 2ND TO 3D QUAD. (OR BACK)
064663,000139: 22,3706           10000                           CCS      A                                     #  BACK TO 2S COMPL.
064664,000140: 22,3707           64770                           AD       ONE                                   
064665,000141: 22,3710           13712                           TCF      +2                                    
064666,000142: 22,3711           40000                           COM                                            
064667,000143: 22,3712           54142                           TS       TEM2                                  #  STORE 14BIT QUANTITY WITH PRESENT SIGN
064668,000144: 22,3713           13717                           TCF      +4                                    
064669,000145: 22,3714           50000                           INDEX    A                                     #  SIGN.
064670,000146: 22,3715           34751                           CAF      LIMITS                                #  FIX IT, BY ADDING IN 37777 OR 40000
064671,000147: 22,3716           60142                           AD       TEM2                                  
064672,000148: 
064673,000149: 22,3717           50130                           INDEX    BUF                                   
064674,000150: 22,3720           54000                           TS       0                                     #  STORE NEW ANGLE IN 2S COMPLEMENT.
064675,000151: 22,3721           00002                           TC       Q                                     
064676,000152: 

Page 1504

064678,000154: 
064679,000155:                                                                                                  #  RTB TO TORQUE GYROS, EXCEPT FOR THE CALL TO IMUSTALL. ECADR OF COMMANDS ARRIVES IN X1.
064680,000156: 
064681,000157: 22,3722           50120        PULSEIMU           INDEX    FIXLOC                                #  ADDRESS OF GYRO COMMANDS SHOULD BE IN X1
064682,000158: 22,3723           30046                           CA       X1                                    
064683,000159: 22,3724           04636                           TC       BANKCALL                              
064684,000160: 22,3725           17244                           CADR     IMUPULSE                              
064685,000161: 22,3726           16030                           TCF      DANZIG                                
064686,000162: 

Page 1505

064688,000164: 
064689,000165:                                                                                                  #  EACH ROUTINE TAKES A 3X3 MATRIX STORED IN DOUBLE PRECISION IN A FIXED AREA OF ERASABLE MEMORY AND REPLACES IT
064690,000166:                                                                                                  #  WITH THE TRANSPOSE MATRIX. TRANSP1 USES LOCATIONS XNB+0,+1 THROUGH XNB+16D, 17D AND TRANSP2 USES LOCATIONS
064691,000167:                                                                                                  #  XNB1+0,+1 THROUGH XNB1+16D, 17D. EACH MATRIX IS STORED BY ROWS.
064692,000168: 
064693,000169: 22,3727           02713        XNBEB              ECADR    XNB                                   
064694,000170: 22,3730           02554        XNB1EB             ECADR    XNB1                                  
064695,000171: 
064696,000172: 22,3731  E5,1713                                  EBANK=   XNB                                   
064697,000173: 
064698,000174: 22,3731           33727        TRANSP1            CAF      XNBEB                                 
064699,000175: 22,3732           54003                           TS       EBANK                                 
064700,000176: 22,3733           53716                           DXCH     XNB        +2                         
064701,000177: 22,3734           53722                           DXCH     XNB        +6                         
064702,000178: 22,3735           53716                           DXCH     XNB        +2                         
064703,000179: 
064704,000180: 22,3736           53720                           DXCH     XNB        +4                         
064705,000181: 22,3737           53730                           DXCH     XNB        +12D                       
064706,000182: 22,3740           53720                           DXCH     XNB        +4                         
064707,000183: 
064708,000184: 22,3741           53726                           DXCH     XNB        +10D                       
064709,000185: 22,3742           53732                           DXCH     XNB        +14D                       
064710,000186: 22,3743           53726                           DXCH     XNB        +10D                       
064711,000187: 22,3744           16030                           TCF      DANZIG                                
064712,000188: 
064713,000189: 22,3745  E5,1554                                  EBANK=   XNB1                                  
064714,000190: 
064715,000191: 22,3745           33730        TRANSP2            CAF      XNB1EB                                
064716,000192: 22,3746           54003                           TS       EBANK                                 
064717,000193: 22,3747           53557                           DXCH     XNB1       +2                         
064718,000194: 22,3750           53563                           DXCH     XNB1       +6                         
064719,000195: 22,3751           53557                           DXCH     XNB1       +2                         
064720,000196: 
064721,000197: 22,3752           53561                           DXCH     XNB1       +4                         
064722,000198: 22,3753           53571                           DXCH     XNB1       +12D                       
064723,000199: 22,3754           53561                           DXCH     XNB1       +4                         
064724,000200: 
064725,000201: 22,3755           53567                           DXCH     XNB1       +10D                       
064726,000202: 22,3756           53573                           DXCH     XNB1       +14D                       
064727,000203: 22,3757           53567                           DXCH     XNB1       +10D                       
064728,000204: 22,3760           16030                           TCF      DANZIG                                
064729,000205: 

Page 1506

064731,000207: 
064732,000208:                                                                                                  #  THE SUBROUTINE  SIGNMPAC  SETS C(MPAC, MPAC +1) TO SIGN(MPAC).
064733,000209:                                                                                                  #  FOR THIS, ONLY THE CONTENTS OF MPAC ARE EXAMINED. ALSO +0 YIELDS POSMAX AND -0 YIELDS NEGMAX.
064734,000210: 
064735,000211:                                                                                                  #  ENTRY MAY BE BY EITHER OF THE FOLLOWING:
064736,000212: 
064737,000213:                                                                                                  #        1.      LIMIT THE SIZE OF MPAC ON INTERPRETIVE OVERFLOW:
064738,000214:                                                                                                  #        ENTRY:          BOVB
064739,000215:                                                                                                  #                                SIGNMPAC
064740,000216:                                                                                                  #        2.      GENERATE IN MPAC THE SIGNUM FUNCTION OF MPAC:
064741,000217:                                                                                                  #        ENTRY:          RTB
064742,000218:                                                                                                  #                                SIGNMPAC
064743,000219: 
064744,000220:                                                                                                  #  IN EITHER CASE, RETURN IS TO THE NEXT INTERPRETIVE INSTRUCTION IN THE CALLING SEQUENCE.
064745,000221: 
064746,000222: 22,3761           00006        SIGNMPAC           EXTEND                                         
064747,000223: 22,3762           34750                           DCA      DPOSMAX                               
064748,000224: 22,3763           52155                           DXCH     MPAC                                  
064749,000225: 22,3764           10000                           CCS      A                                     
064750,000226: 22,3765           34772        DPMODE             CAF      ZERO                                  #  SETS MPAC +2 TO ZERO IN THE PROCESS
064751,000227: 22,3766           16026                           TCF      SLOAD2     +2                         
064752,000228: 22,3767           13770                           TCF      +1                                    
064753,000229: 22,3770           00006                           EXTEND                                         
064754,000230: 22,3771           44750                           DCS      DPOSMAX                               
064755,000231: 22,3772           16024                           TCF      SLOAD2                                
064756,000232: 
064757,000233: 

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