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.

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

Page 1501

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

Page 1502

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

Page 1503

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

Page 1504

064663,000154: 
064664,000155:                                                                                                  #  RTB TO TORQUE GYROS, EXCEPT FOR THE CALL TO IMUSTALL. ECADR OF COMMANDS ARRIVES IN X1.
064665,000156: 
064666,000157: 22,3722           50120        PULSEIMU           INDEX    FIXLOC                                #  ADDRESS OF GYRO COMMANDS SHOULD BE IN X1
064667,000158: 22,3723           30046                           CA       X1                                    
064668,000159: 22,3724           04636                           TC       BANKCALL                              
064669,000160: 22,3725           17244                           CADR     IMUPULSE                              
064670,000161: 22,3726           16030                           TCF      DANZIG                                
064671,000162: 

Page 1505

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

Page 1506

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

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