Source Code

These source-code files are part of a reconstructed copy of Comanche 44, the initial release (though not the final mission release) of the Apollo 10 Command Module (CM) Apollo Guidance Computer (AGC) software. Subsequent releases were Comanche 45 and Comanche 45/2 (the flown release on Apollo 10). The reconstruction is believed to be exactly accurate, but in the absence of an actual Apollo-era listing of Comanche 44, some explanation of the reconstruction process is needed to insure confidence in that accuracy.

The starting point was the source code of Comanche 51 (separately previously reconstructed from an Apollo-era listing of Comanche 55, flown on Apollo 11). Comanche 51 source code was then modified by undoing changes known to have been made between revisions 44 and 51. The now-reconstructed Comanche 44 source code was verified by assembling it and checking that the assembled code had the expected known-correct memory-bank checksums. Note that page numbers in the reconstructed code match those on the Comanche 55 printout, although the source code would likely have different page numbers in a contemporary Comanche 44 listing.

Annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change relative to Comanche 51. Here's a guide to the Apollo documentation referenced in those annotations:
In most cases, only the titles (rather than the full texts) of PCRs are known. In addition to the explanatory annotations, there is also a step-by-step commentary about the reconstruction process.

Comments expected to have been present in the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC Project's GitHub repository.

043277,000002:                                                                                                  ## Copyright:   Public domain.
043278,000003:                                                                                                  ## Filename:    TVCSTROKETEST.agc
043279,000004:                                                                                                  ## Purpose:     A section of Comanche revision 044.
043280,000005:                                                                                                  ##              It is part of the reconstructed source code for the
043281,000006:                                                                                                  ##              original release of the flight software for the Command
043282,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
043283,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
043284,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
043285,000010:                                                                                                  ##              exactly match those specified for Comanche 44 in NASA drawing
043286,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
043287,000012:                                                                                                  ##              reconstruction is correct.
043288,000013:                                                                                                  ## Assembler:   yaYUL
043289,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
043290,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
043291,000016:                                                                                                  ## Mod history: 2020-12-03 MAS  Created from Comanche 51.
043292,000017: 

Page 979

043294,000019:                                                                                                  #  NAME          STROKE TEST PACKAGE             (INCLUDING INITIALIZATION PACKAGE)
043295,000020:                                                                                                  #  LOG SECTION...TVCSTROKETEST                   SUBROUTINE...DAPCSM
043296,000021:                                                                                                  #  MODIFIED BY SCHLUNDT                          21 OCTOBER 1968
043297,000022: 
043298,000023:                                                                                                  #  FUNCTIONAL DESCRIPTION....
043299,000024:                                                                                                  #        STROKE TEST PACKAGE GENERATES A WAVEFORM DESIGNED TO EXCITE BENDING
043300,000025:                                                                                                  #        STRKTSTI (STROKE TEST INITIALIZATION) IS CALLED AS A JOB BY VB68.
043301,000026:                                                                                                  #                IT INITIALIZES ALL ERASABLES REQD FOR A STROKE TEST, AND
043302,000027:                                                                                                  #                THEN TESTS FOR CSM/LM (BIT 13 OF DAPDATR1). IF CSM/LM,
043303,000028:                                                                                                  #                IN EITHER HIGH OR LOW-BANDWIDTH MODE, THE TEST IS STARTED
043304,000029:                                                                                                  #                IMMEDIATELY.  IF NOT CSM/LM, PROGRAM EXITS WITH NO ACTION.
043305,000030:                                                                                                  #        HACK (STROKE TEST) GENERATES THE WAVEFORM BY DUMPING PULSE BURSTS
043306,000031:                                                                                                  #                OF PROPER SIGN AND IN PROPER SEQUENCE DIRECTLY INTO
043307,000032:                                                                                                  #                TVCPITCH, WORKING IN CONJUNCITON WITH BOTH PITCH AND YAW
043308,000033:                                                                                                  #                TVC DAPS, WITH INTERMEDIATE WAITLIST CALLS.  NOTE, HOWEVER
043309,000034:                                                                                                  #                THAT THE STROKE TEST IS PERFORMED ONLY IN THE PITCH AXIS.
043310,000035:                                                                                                  #                AN EXAMPLE WAVEFORM IS GIVEN BELOW, TO DEMONSTRATE STROKE-
043311,000036:                                                                                                  #                TEST PARAMETER SELECTION
043312,000037:                                                                                                  #        RESTARTS CAUSE TEST TO BE TERMINATED.  ANOTHER V68 REQD IF TEST
043313,000038:                                                                                                  #                IS TO BE RE-RUN.
043314,000039:                                                                                                  #        PULSE BURST SIZE IS PAD-LOADED (ESTROKER) SO THAT AMPLITUDE OF
043315,000040:                                                                                                  #                WAVEFORM CAN BE CHANGED.  THERE ARE TEN PULSE BURSTS IN
043316,000041:                                                                                                  #                THE HALF-AMPLITUDE OF THE FIRST FREQUENCY SET IN THE
043317,000042:                                                                                                  #                STANDARD WAVEFORM.  AMPLITUDE IS 10(ESTROKER)(1/42.15),
043318,000043:                                                                                                  #                NOMINALLY 50/42.15 = 1.185 DEG
043319,000044: 
043320,000045:                                                                                                  #  CALLING SEQUENCE....
043321,000046:                                                                                                  #        EXTENDED VERB 68 SETS UP STRKTSTI JOB
043322,000047:                                                                                                  #        PITCH AND YAW TVCDAPS, FINDING STROKER NON-ZERO, DO A ..TC HACK..
043323,000048:                                                                                                  #        AN INTERNALLY-GENERATED WAITLIST CALL ENTERS AT ..HACKWLST..
043324,000049: 
043325,000050:                                                                                                  #  NORMAL EXIT MODES....
043326,000051:                                                                                                  #        TC BUNKER (..Q.. IF ENTRY FROM DAP, ..TCTSKOVR.. IF FROM WAITLIST) LIST
043327,000052: 
043328,000053:                                                                                                  #  SUBROUTINES CALLED....
043329,000054:                                                                                                  #        WAITLIST
043330,000055: 
043331,000056:                                                                                                  #  ALARM OR ABORT EXIT MODES....
043332,000057:                                                                                                  #        NONE
043333,000058: 
043334,000059:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED....
043335,000060:                                                                                                  #        ESTROKER (PAD-LOAD)
043336,000061:                                                                                                  #        STROKER, CADDY, REVS, CARD, N
043337,000062: 
043338,000063:                                                                                                  #  OUTPUT....
043339,000064:                                                                                                  #        STRKTSTI...INITIALIZATION FOR STROKE TEST
043340,000065:                                                                                                  #        HACK, HACKWLST...PULSE BURSTS INTO TVCPITCH VIA ..ADS..
043341,000066:                                                                                                  #                          RESETS STROKER = +0 WHEN TEST COMPLETED
043342,000067: 
043343,000068:                                                                                                  #  DEBRIS....
043344,000069:                                                                                                  #        N = CADDY = +0, CARD = -0, REVS = -1
043345,000070:                                                                                                  #        BUNKER

Page 980

043347,000072: 
043348,000073:                                                                                                  #  EXAMPLE STROKE TEST WAVE FORM, DEMONSTRATING PARAMETER SELECTION
043349,000074: 
043350,000075:                                                                                                  #  NOTE....THIS IS NOT THE OFFICIAL WAVEFORM....
043351,000076: 
043352,000077:                                                                                                  #         **              **
043353,000078:                                                                                                  #         **              **
043354,000079:                                                                                                  #         **              **             EXAMPLE WAVEFORM (EACH * REPRESENTS
043355,000080:                                                                                                  #        *  *            *  *                 85.41 ARCSEC OF ACTUATOR CMND)
043356,000081:                                                                                                  #        *  *            *  *
043357,000082:                                                                                                  #        *  *            *  *
043358,000083:                                                                                                  #       *    *          *    *          **      **      **      **      **
043359,000084:                                                                                                  #       *    *          *    *          **      **      **      **      **
043360,000085:                                                                                                  #       *    *          *    *          **      **      **      **      **
043361,000086:                                                                                                  #      *      *        *      *        *  *    *  *    *  *    *  *    *  *    **  **  **  **  **
043362,000087:                                                                                                  #      *      *        *      *        *  *    *  *    *  *    *  *    *  *    **  **  **  **  **
043363,000088:                                                                                                  #      *      *        *      *        *  *    *  *    *  *    *  *    *  *    **  **  **  **  **
043364,000089:                                                                                                  #  -----------------------------------------------------------------------------------------------------
043365,000090:                                                                                                  #              *      *        *      *    *  *    *  *    *  *    *  *    *  *  **  **  **  **  **
043366,000091:                                                                                                  #              *      *        *      *    *  *    *  *    *  *    *  *    *  *  **  **  **  **  **
043367,000092:                                                                                                  #              *      *        *      *    *  *    *  *    *  *    *  *    *  *  **  **  **  **  **
043368,000093:                                                                                                  #               *    *          *    *      **      **      **      **      **
043369,000094:                                                                                                  #               *    *          *    *      **      **      **      **      **
043370,000095:                                                                                                  #               *    *          *    *      **      **      **      **      **
043371,000096:                                                                                                  #                *  *            *  *
043372,000097:                                                                                                  #                *  *            *  *
043373,000098:                                                                                                  #                *  *            *  *
043374,000099:                                                                                                  #                 **              **
043375,000100:                                                                                                  #                 **              **
043376,000101:                                                                                                  #                 **              **
043377,000102: 
043378,000103:                                                                                                  #  FOR THIS (UNOFFICIAL, EXAMPLE) WAVEFORM, THE REQUIRED PARAMETERS ARE AS FOLLOWS....
043379,000104: 
043380,000105:                                                                                                  #        FCARD    = +3           (NUMBER OF SETS)
043381,000106:                                                                                                  #        ESTROKER = +3           (PULSE BURST SIZE, SC.AT 85.41 ARCSEC/BIT)
043382,000107: 
043383,000108:                                                                                                  #        SET1..
043384,000109:                                                                                                  #                FREVS   = +3    (NUMBER REVERSALS MINUS 1)
043385,000110:                                                                                                  #                FCADDY  = +4    (NUMBER OF PULSE BURSTS IN 1/2 AMPLITUDE)
043386,000111:                                                                                                  #        SET2..
043387,000112:                                                                                                  #                FCARD1  = +9    (NUMBER REVERSALS MINUS 1)
043388,000113:                                                                                                  #                FCARD4  = +2    (NUMBER OF PULSE BURSTS IN 1/2 AMPLITUDE)
043389,000114:                                                                                                  #        SET3..
043390,000115:                                                                                                  #                FCARD2  = +9    (NUMBER REVERSALS MINUS 1)
043391,000116:                                                                                                  #                FCARD5  = +1    (NUMBER OF PULSE BURSTS IN 1/2 AMPLITUDE)
043392,000117:                                                                                                  #        SET4..
043393,000118:                                                                                                  #                FCARD3  = +0    (NUMBER REVERSALS MINUS 1)
043394,000119:                                                                                                  #                FCARD6  = +0    (NUMBER OF PULSE BURSTS IN 1/2 AMPLITUDE)
043395,000120: 

Page 981

043397,000122:                                                                                                  #  STROKE TEST INITIALIZATION PACKAGE (AS A JOB, FROM VERB 68)
043398,000123: 
043399,000124: 17,2552                                           BANK     17                                    
043400,000125: 20,2000                                           SETLOC   DAPS2                                 
043401,000126: 20,2000                                           BANK                                           
043402,000127: 
043403,000128: 20,3501                                           COUNT*   $$/STRK                               
043404,000129: 20,3501  E6,1655                                  EBANK=   CADDY                                 
043405,000130: 
043406,000131: 20,3501           03512        STRKTSTI           TCR      TSTINIT                               #  STROKE TEST INITIALIZATION PKG (CALLED
043407,000132:                                                                                                  #  AS A JOB BY VERB68)
043408,000133: 
043409,000134: 20,3502           00004        STRKCHK            INHINT                                         
043410,000135: 
043411,000136: 20,3503           31466                           CAE      DAPDATR1                              #  CHECK FOR CSM/LM CONFIGURATION
043412,000137: 20,3504           75002                           MASK     BIT14                                 
043413,000138: 20,3505           00006                           EXTEND                                         
043414,000139: 20,3506           13511                           BZF      +3                                    
043415,000140: 
043416,000141: 20,3507           31413                           CAE      ESTROKER                              #  BEGIN ON NEXT DAP PASS (PITCH OR YAW)
043417,000142: 20,3510           55574                           TS       STROKER                               #  (STROKING DONE IN PITCH ONLY, HOWEVER)
043418,000143: 
043419,000144: 20,3511           15217                           TCF      ENDOFJOB                              
043420,000145: 
043421,000146: 20,3512           43522        TSTINIT            CS       FCADDY                                #  NORMAL ENTRY FROM STRKTSTI
043422,000147: 20,3513           55655                           TS       CADDY                                 
043423,000148: 20,3514           55656                           TS       N                                     #        NOTE SGN CHNG FCADDY(+) TO CADDY(-)
043424,000149: 
043425,000150: 20,3515           33523                           CAF      FREVS                                 
043426,000151: 20,3516           55660                           TS       REVS                                  
043427,000152: 
043428,000153: 20,3517           43524                           CS       FCARD                                 #        NOTE SGN CHNG FCARD(+) TO CARD(-)
043429,000154: 20,3520           55661                           TS       CARD                                  
043430,000155: 
043431,000156: 20,3521           00002                           TC       Q                                     #  RETURN TO STRKTSTI+1 (OR CHKSTRK+2 OR +4)
043432,000157: 

Page 982

043434,000159:                                                                                                  #  THE OFFICIAL STROKE TEST WAVEFORM (3 JAN, 1967) CONSISTS OF FOUR STROKE SETS, AS FOLLOWS....
043435,000160: 
043436,000161:                                                                                                  #        SET 1...10 BURSTS IN 1/2 AMP,   4 REVERSALS
043437,000162:                                                                                                  #        SET 2... 6 BURSTS IN 1/2 AMP,   6 REVERSALS
043438,000163:                                                                                                  #        SET 3... 5 BURSTS IN 1/2 AMP,  10 REVERSALS
043439,000164:                                                                                                  #        SET 4... 4 BURSTS IN 1/2 AMP,  14 REVERSALS
043440,000165: 
043441,000166:                                                                                                  #  THE PULSE BURST SIZE (ESTROKER) IS PAD-LOADED (5 BITS AS OF 3 JAN, 1967)
043442,000167:                                                                                                  #  THE REMAINING WAVEFORM-GENERATING PARAMETERS ARE AS FOLLOWS....
043443,000168: 
043444,000169: 20,3522           00012        FCADDY             DEC      10         B-14                       #  NO. PULSE BURSTS IN 1/2 AMP, SET1..(+10)
043445,000170: 20,3523           00003        FREVS              DEC      3          B-14                       #  NO. REVERSALS MINUS 1, SET1........(  3)
043446,000171: 
043447,000172: 20,3524           00004        FCARD              DEC      4          B-14                       #  NO. STROKE SETS....................(+ 4)
043448,000173: 
043449,000174: 20,3525           00005        FCARD1             DEC      5          B-14                       #  NO. REVERSALS MINUS 1, SET2........(  5)
043450,000175: 
043451,000176: 20,3526           00011        FCARD2             DEC      9          B-14                       #                            3........(  9)
043452,000177: 20,3527           00015        FCARD3             DEC      13         B-14                       #                            4........( 13)
043453,000178: 
043454,000179: 20,3530           00006        FCARD4             DEC      6          B-14                       #  NO. PULSE BURSTS IN 1/2 AMP, SET2..(+ 6)
043455,000180: 20,3531           00005        FCARD5             DEC      5          B-14                       #                               SET3..(+ 5)
043456,000181: 20,3532           00004        FCARD6             DEC      4          B-14                       #                               SET4..(+ 4)
043457,000182: 
043458,000183: 20,3533     5016               20MS               =        BIT2                                  
043459,000184: 
043460,000185:                                                                                                  #  STROKE TEST PACKAGE PROPER....
043461,000186: 
043462,000187: 20,3533  E6,1657                                  EBANK=   BUNKER                                
043463,000188: 
043464,000189: 20,3533           00006        HACK               EXTEND                                         #  ENTRY (IN T5 RUPT) FROM TVCDAPS
043465,000190: 20,3534           23657                           QXCH     BUNKER                                #  SAVE Q FOR DAP RETURN
043466,000191: 
043467,000192: 20,3535           35016                           CAF      20MS                                  #  2DAPSX2(PASSES/DAP)X2(CS/PASS)=8CS=TVCDT
043468,000193: 20,3536           05245                           TC       WAITLIST                              
043469,000194: 20,3537  E6,1657                                  EBANK=   BUNKER                                
043470,000195: 20,3537           03542 40066                     2CADR    HACKWLST                              
043471,000196: 
043472,000197: 20,3541           13544                           TCF      +3                                    
043473,000198: 
043474,000199: 20,3542           34367        HACKWLST           CAF      TCTSKOVR                              #  ENTRY FROM WAITLIST
043475,000200: 20,3543           55657                           TS       BUNKER                                #  BUNKER IS TC TASKOVER
043476,000201: 
043477,000202: 20,3544           31574                           CA       STROKER                               #  STROKE
043478,000203: 20,3545           26054                           ADS      TVCPITCH                              
043479,000204: 
043480,000205: 20,3546           35005                           CAF      BIT11                                 #  RELEASE THE ERROR COUNTERS
043481,000206: 20,3547           00006                           EXTEND                                         
043482,000207: 20,3550           05014                           WOR      CHAN14                                
043483,000208: 20,3551           25655                           INCR     CADDY                                 #  COUNT DOWN THE NO. BURSTS, THIS SLOPE

Page 983

043485,000210: 20,3552           41655                           CS       CADDY                                 
043486,000211: 20,3553           00006                           EXTEND                                         
043487,000212: 20,3554           63556                           BZMF     +2                                    
043488,000213: 20,3555           01657                           TC       BUNKER                                #  EXIT, WHILE ON A SLOPE
043489,000214: 
043490,000215: 20,3556           11660                           CCS      REVS                                  
043491,000216: 20,3557           13577                           TCF      REVUP                                 #  POSITIVE REVS
043492,000217: 20,3560           13603                           TCF      REVUP      +4                         #  FINAL REVERSAL, THIS SET
043493,000218: 
043494,000219: 20,3561           25661                           INCR     CARD                                  #  NEGATIVE REVS SET LAST PASS, READY FOR
043495,000220: 20,3562           41661                           CS       CARD                                  #        THE NEXT SET.  CHECK IF NO MORE SETS
043496,000221: 20,3563           00006                           EXTEND                                         
043497,000222: 20,3564           13575                           BZF      STROKILL                              #  ALL SETS COMPLETED
043498,000223: 
043499,000224: 20,3565           51661                           INDEX    CARD                                  
043500,000225: 20,3566           33530                           CAF      FCARD      +4                         #  PICK UP NO. REVERSALS (-), NEXT SET
043501,000226: 20,3567           55660                           TS       REVS                                  #  REINITIALIZE
043502,000227: 20,3570           51661                           INDEX    CARD                                  
043503,000228: 20,3571           43533                           CS       FCARD      +7                         #  PICK UP NO. BURSTS IN 1/2AMP, NEXT SET
043504,000229: 20,3572           55656                           TS       N                                     #  REINITIALIZE
043505,000230: 20,3573           55655                           TS       CADDY                                 
043506,000231: 20,3574           01657                           TC       BUNKER                                #  EXIT, AT END OF SET
043507,000232: 
043508,000233: 20,3575           55574        STROKILL           TS       STROKER                               #  RESET (TO +0) TO END TEST
043509,000234: 20,3576           01657                           TC       BUNKER                                #  EXIT, STROKE TEST FINIS
043510,000235: 
043511,000236: 20,3577           55660        REVUP              TS       REVS                                  #  ALL REVERSALS EXCEPT LAST OF SET
043512,000237: 20,3600           31656                           CA       N                                     
043513,000238: 20,3601           60000                           DOUBLE                                         #  2 X 1/2AMP
043514,000239: 20,3602           13606                           TCF      +4                                    
043515,000240: 
043516,000241: 20,3603           45017                 +4        CS       ONE                                   #  FINAL REVERSAL, THIS SET
043517,000242: 20,3604           55660                           TS       REVS                                  #  PREPARE TO BRANCH TO NEW BURST
043518,000243: 20,3605           31656                           CA       N                                     #  JUST RETURN TO ZERO, FINAL SLOPE OF SET
043519,000244: 20,3606           55655                           TS       CADDY                                 #  CADUP
043520,000245: 
043521,000246: 20,3607           41574                           CS       STROKER                               #  CHANGE SIGN OF SLOPE
043522,000247: 20,3610           55574                           TS       STROKER                               
043523,000248: 20,3611           01657                           TC       BUNKER                                #  EXIT AT A REVERSAL (SLOPE CHANGE)
043524,000249: 

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