Source Code

This is the source-code for the Apollo 9 Command Module's Guidance Computer. These files were derived originally from the scan from MIT's Dibner Institute's now-discontinued website titled "History of Recent Science and Technology", which in turn was originally created by Gary Neff, though his high-quality scans were unfortunately reduced in legibility when presented online. The markings on the front of the printout imply that it was the original AGC developer Norm Brodeur's copy. A scan by Ron Burkey has superceded it, made from a more-legible copy from the collection of original AGC developer Fred Martin. The source code was transcribed from those images by Ron Burkey. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	ASSEMBLE REVISION 249 OF AGC PROGRAM COLOSSUS BY NASA 2021111-041
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

042084,000002:                                                                                                  ## Copyright:   Public domain.
042085,000003:                                                                                                  ## Filename:    TVCSTROKETEST.agc
042086,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus, build 249.
042087,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
042088,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 9.
042089,000007:                                                                                                  ## Assembler:   yaYUL
042090,000008:                                                                                                  ## Reference:   Starts on p. 943.
042091,000009:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
042092,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
042093,000011:                                                                                                  ## Mod history: 08/23/04 RSB.   Began transcribing.
042094,000012:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
042095,000013:                                                                                                  ##              2010-10-24 JL   Indentation fixes.
042096,000014:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
042097,000015:                                                                                                  ##                              original harcopy, as opposed to the PDF page
042098,000016:                                                                                                  ##                              numbers in 1701.pdf.
042099,000017:                                                                                                  ##              2017-01-20 RSB  Cross-diff'd comment text (not whitespace)
042100,000018:                                                                                                  ##                              vs the already-proofed corresponding Colossus
042101,000019:                                                                                                  ##                              237 and Comanche 55 source-code files
042102,000020:                                                                                                  ##                              and corrected errors found.
042103,000021:                                                                                                  ##
042104,000022:                                                                                                  ## The contents of the "Colossus249" files, in general, are transcribed 
042105,000023:                                                                                                  ## from a scanned copy of the program listing.  Notations on this
042106,000024:                                                                                                  ## document read, in part:
042107,000025:                                                                                                  ##
042108,000026:                                                                                                  ##      Assemble revision 249 of AGC program Colossus by NASA
042109,000027:                                                                                                  ##      2021111-041.  October 28, 1968.  
042110,000028:                                                                                                  ##
042111,000029:                                                                                                  ##      This AGC program shall also be referred to as
042112,000030:                                                                                                  ##                              Colossus 1A
042113,000031:                                                                                                  ##
042114,000032:                                                                                                  ##      Prepared by
042115,000033:                                                                                                  ##                      Massachusetts Institute of Technology
042116,000034:                                                                                                  ##                      75 Cambridge Parkway
042117,000035:                                                                                                  ##                      Cambridge, Massachusetts
042118,000036:                                                                                                  ##      under NASA contract NAS 9-4065.
042119,000037:                                                                                                  ##
042120,000038:                                                                                                  ## Refer directly to the online document mentioned above for further information.
042121,000039:                                                                                                  ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
042122,000040:                                                                                                  ##
042123,000041:                                                                                                  ## In some cases, where the source code for Luminary 131 overlaps that of 
042124,000042:                                                                                                  ## Colossus 249, this code is instead copied from the corresponding Luminary 131
042125,000043:                                                                                                  ## source file, and then is proofed to incorporate any changes.
042126,000044: 

Page 943

042128,000046:                                                                                                  #  NAME          STROKE TEST PACKAGE             (INCLUDING INITIALIZATION PACKAGE)
042129,000047:                                                                                                  #  ORIGINAL CODING BY OLSSON                     LOG SECTION....STROKE TEST PACKAGE
042130,000048:                                                                                                  #  MOD BY ENGEL                                  DATE....21 MARCH, 1967
042131,000049: 
042132,000050:                                                                                                  #  FUNCTIONAL DESCRIPTION....
042133,000051:                                                                                                  #        STROKE TEST PACKAGE GENERATES A WAVEFORM DESIGNED TO EXCITE BENDING
042134,000052:                                                                                                  #        STRKTSTI (STROKE TEST INITIALIZATION) IS CALLED AS A JOB BY VB68.
042135,000053:                                                                                                  #                IT INITIALIZES ALL ERASABLES REQD FOR A STROKE TEST, AND
042136,000054:                                                                                                  #                THEN TESTS FOR AN 80MS DAP.  IF 80MS IT SETS STROKER = ESTROKER
042137,000055:                                                                                                  #                FOR AN IMMEDIATE STROKE TEST, OTHERWISE IT MERELY ENABLES
042138,000056:                                                                                                  #                A STROKE TEST BY SETTING STROKER TO -0.  THE STROKE TEST
042139,000057:                                                                                                  #                THEN AWAITS SWITCHOVER TO THE 80MS DAP WHEREUPON IT IS
042140,000058:                                                                                                  #                ENABLED AFTER AN ADDITIONAL 4 SECOND DELAY TO AVOID
042141,000059:                                                                                                  #                THE SWITCHOVER TRANSIENTS (SEE STRKCALL, STRKUP IN
042142,000060:                                                                                                  #                TVCEXECUTIVE)
042143,000061:                                                                                                  #        HACK (STROKE TEST) GENERATES THE WAVEFORM BY DUMPING PULSE BURSTS
042144,000062:                                                                                                  #                OF PROPER SIGN AND IN PROPER SEQUENCE DIRECTLY INTO
042145,000063:                                                                                                  #                TVCPITCH, WORKING IN CONJUNCITON WITH BOTH PITCH AND YAW
042146,000064:                                                                                                  #                TVC DAPS, WITH INTERMEDIATE WAITLIST CALLS.  NOTE, HOWEVER
042147,000065:                                                                                                  #                THAT THE STROKE TEST IS PERFORMED ONLY IN THE PITCH AXIS.
042148,000066:                                                                                                  #                AN EXAMPLE WAVEFORM IS GIVEN BELOW, TO DEMONSTRATE STROKE-
042149,000067:                                                                                                  #                TEST PARAMETER SELECTION
042150,000068:                                                                                                  #        RESTARTS CAUSE TEST TO BE TERMINATED.  ANOTHER V68 REQD IF TEST
042151,000069:                                                                                                  #                IS TO BE RE-RUN.
042152,000070:                                                                                                  #        PULSE BURST SIZE IS PAD-LOADED (ESTROKER) SO THAT AMPLITUDE OF
042153,000071:                                                                                                  #                WAVEFORM CAN BE CHANGED.  THERE ARE TEN PULSE BURSTS IN
042154,000072:                                                                                                  #                THE HALF-AMPLITUDE OF THE FIRST FREQUENCY SET IN THE
042155,000073:                                                                                                  #                STANDARD WAVEFORM.  AMPLITUDE IS 10(ESTROKER)(1/42.15),
042156,000074:                                                                                                  #                NOMINALLY 50/42.15 = 1.185 DEG
042157,000075: 
042158,000076:                                                                                                  #  CALLING SEQUENCE....
042159,000077:                                                                                                  #        EXTENDED VERB 68 SETS UP STRKTSTI JOB
042160,000078:                                                                                                  #        PITCH AND YAW TVCDAPS, FINDING STROKER NON-ZERO, DO A ..TC HACK..
042161,000079:                                                                                                  #        AN INTERNALLY-GENERATED WAITLIST CALL ENTERS AT ..HACKWLST..
042162,000080: 
042163,000081:                                                                                                  #  NORMAL EXIT MODES....
042164,000082:                                                                                                  #        TC BUNKER (..Q.. IF ENTRY FROM DAP, ..TCTSKOVR.. IF FROM WAITLIST) LIST
042165,000083: 
042166,000084:                                                                                                  #  SUBROUTINES CALLED....
042167,000085:                                                                                                  #        WAITLIST
042168,000086: 
042169,000087:                                                                                                  #  ALARM OR ABORT EXIT MODES....
042170,000088:                                                                                                  #        NONE
042171,000089: 
042172,000090:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED....
042173,000091:                                                                                                  #        ESTROKER (PAD-LOAD)
042174,000092:                                                                                                  #        STROKER, CADDY, REVS, CARD, N
042175,000093: 
042176,000094:                                                                                                  #  OUTPUT....
042177,000095:                                                                                                  #        STRKTSTI...INITIALIZATION FOR STROKE TEST
042178,000096:                                                                                                  #        HACK, HACKWLST...PULSE BURSTS INTO TVCPITCH VIA..ADS..
042179,000097:                                                                                                  #                          RESETS STROKER = +0 WHEN TEST COMPLETED
042180,000098: 
042181,000099:                                                                                                  #  DEBRIS....
042182,000100:                                                                                                  #        N = CADDY = +0, CARD = -0, REVS = -1
042183,000101:                                                                                                  #        BUNKER

Page 944

042185,000103: 
042186,000104:                                                                                                  #  EXAMPLE STROKE TEST WAVE FORM, DEMONSTRATING PARAMETER SELECTION
042187,000105:                                                                                                  #  NOTE....THIS IS NOT THE OFFICIAL WAVEFORM....
042188,000106: 
042189,000107:                                                                                                  #         **              **
042190,000108:                                                                                                  #         **              **
042191,000109:                                                                                                  #         **              **             EXAMPLE WAVEFORM (EACH * REPRESENTS
042192,000110:                                                                                                  #        *  *            *  *              85.41 ARCSEC OF ACTUATOR CMND)
042193,000111:                                                                                                  #        *  *            *  *
042194,000112:                                                                                                  #        *  *            *  *
042195,000113:                                                                                                  #       *    *          *    *          **      **      **      **      **
042196,000114:                                                                                                  #       *    *          *    *          **      **      **      **      **
042197,000115:                                                                                                  #       *    *          *    *          **      **      **      **      **
042198,000116:                                                                                                  #      *      *        *      *        *  *    *  *    *  *    *  *    *  *    **  **  **  **  **
042199,000117:                                                                                                  #      *      *        *      *        *  *    *  *    *  *    *  *    *  *    **  **  **  **  **
042200,000118:                                                                                                  #      *      *        *      *        *  *    *  *    *  *    *  *    *  *    **  **  **  **  **
042201,000119:                                                                                                  #  -----------------------------------------------------------------------------------------------------
042202,000120:                                                                                                  #              *      *        *      *    *  *    *  *    *  *    *  *    *  *  **  **  **  **  **
042203,000121:                                                                                                  #              *      *        *      *    *  *    *  *    *  *    *  *    *  *  **  **  **  **  **
042204,000122:                                                                                                  #              *      *        *      *    *  *    *  *    *  *    *  *    *  *  **  **  **  **  **
042205,000123:                                                                                                  #               *    *          *    *      **      **      **      **      **
042206,000124:                                                                                                  #               *    *          *    *      **      **      **      **      **
042207,000125:                                                                                                  #               *    *          *    *      **      **      **      **      **
042208,000126:                                                                                                  #                *  *            *  *
042209,000127:                                                                                                  #                *  *            *  *
042210,000128:                                                                                                  #                *  *            *  *
042211,000129:                                                                                                  #                 **              **
042212,000130:                                                                                                  #                 **              **
042213,000131:                                                                                                  #                 **              **
042214,000132: 
042215,000133:                                                                                                  #  FOR THIS (UNOFFICIAL, EXAMPLE) WAVEFORM, THE REQUIRED PARAMETERS ARE AS FOLLOWS....
042216,000134: 
042217,000135:                                                                                                  #        FCARD    = +3           (NUMBER OF SETS)
042218,000136:                                                                                                  #        ESTROKER = +3           (PULSE BURST SIZE, SC.AT 85.41 ARCSEC/BIT)
042219,000137: 
042220,000138:                                                                                                  #        SET1..
042221,000139:                                                                                                  #                FREVS   = +3    (NUMBER REVERSALS MINUS 1)
042222,000140:                                                                                                  #                FCADDY  = +4    (NUMBER OF PULSE BURSTS IN 1/2 AMPLITUDE)
042223,000141:                                                                                                  #        SET2..
042224,000142:                                                                                                  #                FCARD1  = +9    (NUMBER REVERSALS MINUS 1)
042225,000143:                                                                                                  #                FCARD4  = +2    (NUMBER OF PULSE BURSTS IN 1/2 AMPLITUDE)
042226,000144:                                                                                                  #        SET3..
042227,000145:                                                                                                  #                FCARD2  = +9    (NUMBER REVERSALS MINUS 1)
042228,000146:                                                                                                  #                FCARD5  = +1    (NUMBER OF PULSE BURSTS IN 1/2 AMPLITUDE)
042229,000147:                                                                                                  #        SET4..
042230,000148:                                                                                                  #                FCARD3  = +0    (NUMBER REVERSALS MINUS 1)
042231,000149:                                                                                                  #                FCARD6  = +0    (NUMBER OF PULSE BURSTS IN 1/2 AMPLITUDE)
042232,000150: 

Page 945

042234,000152:                                                                                                  #  STROKE TEST INITIALIZATION PACKAGE (AS A JOB, FROM VERB 68)
042235,000153: 
042236,000154: 17,2213                                           BANK     17                                    
042237,000155: 20,2000                                           SETLOC   DAPS2                                 
042238,000156: 20,2000                                           BANK                                           
042239,000157: 
042240,000158: 20,3446                                           COUNT*   $$/STRK                               
042241,000159: 20,3446  E6,1665                                  EBANK=   CADDY                                 
042242,000160: 
042243,000161: 20,3446           03465        STRKTSTI           TCR      TSTINIT                               #  STROKE TEST INITIALIZATION PKG (CALLED
042244,000162:                                                                                                  #  AS A JOB BY VERB68)
042245,000163: 
042246,000164: 20,3447           00004        TVCDTCHK           INHINT                                         #  STROKE TEST PERMITTED ONLY WITH 80MS DAP
042247,000165: 20,3450           31635                           CAE      T5TVCDT                               #        CHECK CURRENT TIMING
042248,000166: 20,3451           54001                           TS       L                                     
042249,000167: 20,3452           37677                           CAF      OCT37774                              #        LOOK FOR 80MS (T5)
042250,000168: 20,3453           00006                           EXTEND                                         
042251,000169: 20,3454           06001                           RXOR     LCHAN                                 #  +0 IF 80MS
042252,000170: 20,3455           10000                           CCS      A                                     
042253,000171: 20,3456           13462                           TCF      +4                                    #        NOT 80MS
042254,000172: 
042255,000173: 20,3457           31412                           CAE      ESTROKER                              #        80MS.  OK, SET STROKER FOR TEST
042256,000174: 20,3460           55614                           TS       STROKER                               
042257,000175: 20,3461           13464                           TCF      +3                                    
042258,000176: 
042259,000177: 20,3462           44714                           CS       ZERO                                  #        ENABLE, BUT DO NOT ACTIVATE STROKE
042260,000178: 20,3463           55614                           TS       STROKER                               #                TEST, AWAITING SWITCHOVER
042261,000179:                                                                                                  #                TO MOD0R (MOD80)
042262,000180: 20,3464           15112                           TCF      ENDOFJOB                              
042263,000181: 20,3465           43475        TSTINIT            CS       FCADDY                                #  NORMAL ENTRY FROM STRKTSTI
042264,000182: 20,3466           55665                           TS       CADDY                                 
042265,000183: 20,3467           55666                           TS       N                                     #        NOTE SGN CHNG FCADDY(+) TO CADDY(-)
042266,000184: 
042267,000185: 20,3470           33476                           CAF      FREVS                                 
042268,000186: 20,3471           55670                           TS       REVS                                  
042269,000187: 
042270,000188: 20,3472           43477                           CS       FCARD                                 #        NOTE SGN CHNG FCARD(+) TO CARD(-)
042271,000189: 20,3473           55671                           TS       CARD                                  
042272,000190: 
042273,000191: 20,3474           00002                           TC       Q                                     #  RETURN TO STRKTSTI+1 (OR CHKSTRK+2 OR +4)
042274,000192: 

Page 946

042276,000194:                                                                                                  #  THE OFFICIAL STROKE TEST WAVEFORM (3 JAN, 1967) CONSISTS OF FOUR STROKE SETS, AS FOLLOWS....
042277,000195: 
042278,000196:                                                                                                  #        SET 1...10 BURSTS IN 1/2 AMP,   4 REVERSALS
042279,000197:                                                                                                  #        SET 2... 6 BURSTS IN 1/2 AMP,   6 REVERSALS
042280,000198:                                                                                                  #        SET 3... 5 BURSTS IN 1/2 AMP,  10 REVERSALS
042281,000199:                                                                                                  #        SET 4... 4 BURSTS IN 1/2 AMP,  14 REVERSALS
042282,000200: 
042283,000201:                                                                                                  #  THE PULSE BURST SIZE (ESTROKER) IS PAD-LOADED (5 BITS AS OF 3 JAN, 1967)
042284,000202:                                                                                                  #  THE REMAINING WAVEFORM-GENERATING PARAMETERS ARE AS FOLLOWS....
042285,000203: 
042286,000204: 20,3475           00012        FCADDY             DEC      10         B-14                       #  NO. PULSE BURSTS IN 1/2 AMP, SET1..(+10)
042287,000205: 20,3476           00003        FREVS              DEC      3          B-14                       #  NO. REVERSALS MINUS 1, SET1........(  3)
042288,000206: 20,3477           00004        FCARD              DEC      4          B-14                       #  NO. STROKE SETS....................(+ 4)
042289,000207: 20,3500           00005        FCARD1             DEC      5          B-14                       #  NO. REVERSALS MINUS 1, SET2........(  5)
042290,000208: 20,3501           00011        FCARD2             DEC      9          B-14                       #                            3........(  9)
042291,000209: 20,3502           00015        FCARD3             DEC      13         B-14                       #                            4........( 13)
042292,000210: 20,3503           00006        FCARD4             DEC      6          B-14                       #  NO. PULSE BURSTS IN 1/2 AMP, SET2..(+ 6)
042293,000211: 20,3504           00005        FCARD5             DEC      5          B-14                       #                               SET3..(+ 5)
042294,000212: 20,3505           00004        FCARD6             DEC      4          B-14                       #                               SET4..(+ 4)
042295,000213: 
042296,000214: 20,3506     4711               20MS               =        BIT2                                  
042297,000215: 
042298,000216:                                                                                                  #  STROKE TEST PACKAGE PROPER....
042299,000217: 
042300,000218: 20,3506  E6,1667                                  EBANK=   BUNKER                                
042301,000219: 
042302,000220: 20,3506           00006        HACK               EXTEND                                         #  ENTRY (IN T5 RUPT) FROM TVCDAPS
042303,000221: 20,3507           23667                           QXCH     BUNKER                                #  SAVE Q FOR DAP RETURN
042304,000222: 
042305,000223: 20,3510           34711                           CAF      20MS                                  #  2DAPSX2(PASSES/DAP)X2(CS/PASS)=8CS=TVCDT
042306,000224: 20,3511           05140                           TC       WAITLIST                              
042307,000225: 20,3512  E6,1667                                  EBANK=   BUNKER                                
042308,000226: 20,3512           03515 40066                     2CADR    HACKWLST                              
042309,000227: 
042310,000228: 20,3514           13517                           TCF      +3                                    
042311,000229: 
042312,000230: 20,3515           34367        HACKWLST           CAF      TCTSKOVR                              #  ENTRY FROM WAITLIST
042313,000231: 20,3516           55667                           TS       BUNKER                                #  BUNKER IS TC TASKOVER
042314,000232: 
042315,000233: 20,3517           31614                           CA       STROKER                               #  STROKE
042316,000234: 20,3520           26054                           ADS      TVCPITCH                              
042317,000235: 
042318,000236: 20,3521           34700                           CAF      BIT11                                 #  RELEASE THE ERROR COUNTERS
042319,000237: 20,3522           00006                           EXTEND                                         
042320,000238: 20,3523           05014                           WOR      CHAN14                                
042321,000239: 20,3524           25665                           INCR     CADDY                                 #  COUNT DOWN THE NO. BURSTS, THIS SLOPE

Page 947

042323,000241: 20,3525           41665                           CS       CADDY                                 
042324,000242: 20,3526           00006                           EXTEND                                         
042325,000243: 20,3527           63531                           BZMF     +2                                    
042326,000244: 20,3530           01667                           TC       BUNKER                                #  EXIT, WHILE ON A SLOPE
042327,000245: 20,3531           11670                           CCS      REVS                                  
042328,000246: 20,3532           13552                           TCF      REVUP                                 #  POSITIVE REVS
042329,000247: 20,3533           13556                           TCF      REVUP      +4                         #  FINAL REVERSAL, THIS SET
042330,000248: 
042331,000249: 20,3534           25671                           INCR     CARD                                  #  NEGATIVE REVS SET LAST PASS, READY FOR
042332,000250: 20,3535           41671                           CS       CARD                                  #        THE NEXT SET.  CHECK IF NO MORE SETS
042333,000251: 20,3536           00006                           EXTEND                                         
042334,000252: 20,3537           13550                           BZF      STROKILL                              #  ALL SETS COMPLETED
042335,000253: 
042336,000254: 20,3540           51671                           INDEX    CARD                                  
042337,000255: 20,3541           33503                           CAF      FCARD      +4                         #  PICK UP NO. REVERSALS (-), NEXT SET
042338,000256: 20,3542           55670                           TS       REVS                                  #  REINITIALIZE
042339,000257: 20,3543           51671                           INDEX    CARD                                  
042340,000258: 20,3544           43506                           CS       FCARD      +7                         #  PICK UP NO. BURSTS IN 1/2AMP, NEXT SET
042341,000259: 20,3545           55666                           TS       N                                     #  REINITIALIZE
042342,000260: 20,3546           55665                           TS       CADDY                                 
042343,000261: 20,3547           01667                           TC       BUNKER                                #  EXIT, AT END OF SET
042344,000262: 20,3550           55614        STROKILL           TS       STROKER                               #  RESET (TO +0) TO END TEST
042345,000263: 20,3551           01667                           TC       BUNKER                                #  EXIT, STROKE TEST FINIS
042346,000264: 20,3552           55670        REVUP              TS       REVS                                  #  ALL REVERSALS EXCEPT LAST OF SET
042347,000265: 20,3553           31666                           CA       N                                     
042348,000266: 20,3554           60000                           DOUBLE                                         #  2 X 1/2AMP
042349,000267: 20,3555           13561                           TCF      +4                                    
042350,000268: 
042351,000269: 20,3556           44712                 +4        CS       ONE                                   #  FINAL REVERSAL, THIS SET
042352,000270: 20,3557           55670                           TS       REVS                                  #  PREPARE TO BRANCH TO NEW BURST
042353,000271: 20,3560           31666                           CA       N                                     #  JUST RETURN TO ZERO, FINAL SLOPE OF SET
042354,000272: 20,3561           55665                           TS       CADDY                                 #  CADUP
042355,000273: 
042356,000274: 20,3562           41614                           CS       STROKER                               #  CHANGE SIGN OF SLOPE
042357,000275: 20,3563           55614                           TS       STROKER                               
042358,000276: 20,3564           01667                           TC       BUNKER                                #  EXIT AT A REVERSAL (SLOPE CHANGE)

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