Source Code

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

The starting point was the source code of Comanche 44 (itself previously accurately reconstructed). Comanche 44 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 44 and 45. The now-reconstructed Comanche 45 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 tend to match those in the Comanche 55, the most-similar revision of Comanche for which we have access to an actual non-reconstructed hardcopy; the source code would likely have different page numbers in a contemporary Comanche 45 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 44. Here's a guide to the Apollo documentation referenced in those annotations:
There is also a detailed 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.

042801,000002:                                                                                                  ## Copyright:   Public domain.
042802,000003:                                                                                                  ## Filename:    TVCSTROKETEST.agc
042803,000004:                                                                                                  ## Purpose:     A section of Comanche revision 045.
042804,000005:                                                                                                  ##              It is part of the reconstructed source code for the
042805,000006:                                                                                                  ##              second release of the flight software for the Command
042806,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
042807,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
042808,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
042809,000010:                                                                                                  ##              exactly match those specified for Comanche 45 in NASA drawing
042810,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
042811,000012:                                                                                                  ##              reconstruction is correct.
042812,000013:                                                                                                  ## Assembler:   yaYUL
042813,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
042814,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
042815,000016:                                                                                                  ## Mod history: 2020-12-06 MAS  Created from Comanche 44.
042816,000017: 

Page 979

042818,000019:                                                                                                  #  NAME          STROKE TEST PACKAGE             (INCLUDING INITIALIZATION PACKAGE)
042819,000020:                                                                                                  #  LOG SECTION...TVCSTROKETEST                   SUBROUTINE...DAPCSM
042820,000021:                                                                                                  #  MODIFIED BY SCHLUNDT                          21 OCTOBER 1968
042821,000022: 
042822,000023:                                                                                                  #  FUNCTIONAL DESCRIPTION....
042823,000024:                                                                                                  #        STROKE TEST PACKAGE GENERATES A WAVEFORM DESIGNED TO EXCITE BENDING
042824,000025:                                                                                                  #        STRKTSTI (STROKE TEST INITIALIZATION) IS CALLED AS A JOB BY VB68.
042825,000026:                                                                                                  #                IT INITIALIZES ALL ERASABLES REQD FOR A STROKE TEST, AND
042826,000027:                                                                                                  #                THEN TESTS FOR CSM/LM (BIT 13 OF DAPDATR1). IF CSM/LM,
042827,000028:                                                                                                  #                IN EITHER HIGH OR LOW-BANDWIDTH MODE, THE TEST IS STARTED
042828,000029:                                                                                                  #                IMMEDIATELY.  IF NOT CSM/LM, PROGRAM EXITS WITH NO ACTION.
042829,000030:                                                                                                  #        HACK (STROKE TEST) GENERATES THE WAVEFORM BY DUMPING PULSE BURSTS
042830,000031:                                                                                                  #                OF PROPER SIGN AND IN PROPER SEQUENCE DIRECTLY INTO
042831,000032:                                                                                                  #                TVCPITCH, WORKING IN CONJUNCITON WITH BOTH PITCH AND YAW
042832,000033:                                                                                                  #                TVC DAPS, WITH INTERMEDIATE WAITLIST CALLS.  NOTE, HOWEVER
042833,000034:                                                                                                  #                THAT THE STROKE TEST IS PERFORMED ONLY IN THE PITCH AXIS.
042834,000035:                                                                                                  #                AN EXAMPLE WAVEFORM IS GIVEN BELOW, TO DEMONSTRATE STROKE-
042835,000036:                                                                                                  #                TEST PARAMETER SELECTION
042836,000037:                                                                                                  #        RESTARTS CAUSE TEST TO BE TERMINATED.  ANOTHER V68 REQD IF TEST
042837,000038:                                                                                                  #                IS TO BE RE-RUN.
042838,000039:                                                                                                  #        PULSE BURST SIZE IS PAD-LOADED (ESTROKER) SO THAT AMPLITUDE OF
042839,000040:                                                                                                  #                WAVEFORM CAN BE CHANGED.  THERE ARE TEN PULSE BURSTS IN
042840,000041:                                                                                                  #                THE HALF-AMPLITUDE OF THE FIRST FREQUENCY SET IN THE
042841,000042:                                                                                                  #                STANDARD WAVEFORM.  AMPLITUDE IS 10(ESTROKER)(1/42.15),
042842,000043:                                                                                                  #                NOMINALLY 50/42.15 = 1.185 DEG
042843,000044: 
042844,000045:                                                                                                  #  CALLING SEQUENCE....
042845,000046:                                                                                                  #        EXTENDED VERB 68 SETS UP STRKTSTI JOB
042846,000047:                                                                                                  #        PITCH AND YAW TVCDAPS, FINDING STROKER NON-ZERO, DO A ..TC HACK..
042847,000048:                                                                                                  #        AN INTERNALLY-GENERATED WAITLIST CALL ENTERS AT ..HACKWLST..
042848,000049: 
042849,000050:                                                                                                  #  NORMAL EXIT MODES....
042850,000051:                                                                                                  #        TC BUNKER (..Q.. IF ENTRY FROM DAP, ..TCTSKOVR.. IF FROM WAITLIST) LIST
042851,000052: 
042852,000053:                                                                                                  #  SUBROUTINES CALLED....
042853,000054:                                                                                                  #        WAITLIST
042854,000055: 
042855,000056:                                                                                                  #  ALARM OR ABORT EXIT MODES....
042856,000057:                                                                                                  #        NONE
042857,000058: 
042858,000059:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED....
042859,000060:                                                                                                  #        ESTROKER (PAD-LOAD)
042860,000061:                                                                                                  #        STROKER, CADDY, REVS, CARD, N
042861,000062: 
042862,000063:                                                                                                  #  OUTPUT....
042863,000064:                                                                                                  #        STRKTSTI...INITIALIZATION FOR STROKE TEST
042864,000065:                                                                                                  #        HACK, HACKWLST...PULSE BURSTS INTO TVCPITCH VIA ..ADS..
042865,000066:                                                                                                  #                          RESETS STROKER = +0 WHEN TEST COMPLETED
042866,000067: 
042867,000068:                                                                                                  #  DEBRIS....
042868,000069:                                                                                                  #        N = CADDY = +0, CARD = -0, REVS = -1
042869,000070:                                                                                                  #        BUNKER

Page 980

042871,000072: 
042872,000073:                                                                                                  #  EXAMPLE STROKE TEST WAVE FORM, DEMONSTRATING PARAMETER SELECTION
042873,000074: 
042874,000075:                                                                                                  #  NOTE....THIS IS NOT THE OFFICIAL WAVEFORM....
042875,000076: 
042876,000077:                                                                                                  #         **              **
042877,000078:                                                                                                  #         **              **
042878,000079:                                                                                                  #         **              **             EXAMPLE WAVEFORM (EACH * REPRESENTS
042879,000080:                                                                                                  #        *  *            *  *                 85.41 ARCSEC OF ACTUATOR CMND)
042880,000081:                                                                                                  #        *  *            *  *
042881,000082:                                                                                                  #        *  *            *  *
042882,000083:                                                                                                  #       *    *          *    *          **      **      **      **      **
042883,000084:                                                                                                  #       *    *          *    *          **      **      **      **      **
042884,000085:                                                                                                  #       *    *          *    *          **      **      **      **      **
042885,000086:                                                                                                  #      *      *        *      *        *  *    *  *    *  *    *  *    *  *    **  **  **  **  **
042886,000087:                                                                                                  #      *      *        *      *        *  *    *  *    *  *    *  *    *  *    **  **  **  **  **
042887,000088:                                                                                                  #      *      *        *      *        *  *    *  *    *  *    *  *    *  *    **  **  **  **  **
042888,000089:                                                                                                  #  -----------------------------------------------------------------------------------------------------
042889,000090:                                                                                                  #              *      *        *      *    *  *    *  *    *  *    *  *    *  *  **  **  **  **  **
042890,000091:                                                                                                  #              *      *        *      *    *  *    *  *    *  *    *  *    *  *  **  **  **  **  **
042891,000092:                                                                                                  #              *      *        *      *    *  *    *  *    *  *    *  *    *  *  **  **  **  **  **
042892,000093:                                                                                                  #               *    *          *    *      **      **      **      **      **
042893,000094:                                                                                                  #               *    *          *    *      **      **      **      **      **
042894,000095:                                                                                                  #               *    *          *    *      **      **      **      **      **
042895,000096:                                                                                                  #                *  *            *  *
042896,000097:                                                                                                  #                *  *            *  *
042897,000098:                                                                                                  #                *  *            *  *
042898,000099:                                                                                                  #                 **              **
042899,000100:                                                                                                  #                 **              **
042900,000101:                                                                                                  #                 **              **
042901,000102: 
042902,000103:                                                                                                  #  FOR THIS (UNOFFICIAL, EXAMPLE) WAVEFORM, THE REQUIRED PARAMETERS ARE AS FOLLOWS....
042903,000104: 
042904,000105:                                                                                                  #        FCARD    = +3           (NUMBER OF SETS)
042905,000106:                                                                                                  #        ESTROKER = +3           (PULSE BURST SIZE, SC.AT 85.41 ARCSEC/BIT)
042906,000107: 
042907,000108:                                                                                                  #        SET1..
042908,000109:                                                                                                  #                FREVS   = +3    (NUMBER REVERSALS MINUS 1)
042909,000110:                                                                                                  #                FCADDY  = +4    (NUMBER OF PULSE BURSTS IN 1/2 AMPLITUDE)
042910,000111:                                                                                                  #        SET2..
042911,000112:                                                                                                  #                FCARD1  = +9    (NUMBER REVERSALS MINUS 1)
042912,000113:                                                                                                  #                FCARD4  = +2    (NUMBER OF PULSE BURSTS IN 1/2 AMPLITUDE)
042913,000114:                                                                                                  #        SET3..
042914,000115:                                                                                                  #                FCARD2  = +9    (NUMBER REVERSALS MINUS 1)
042915,000116:                                                                                                  #                FCARD5  = +1    (NUMBER OF PULSE BURSTS IN 1/2 AMPLITUDE)
042916,000117:                                                                                                  #        SET4..
042917,000118:                                                                                                  #                FCARD3  = +0    (NUMBER REVERSALS MINUS 1)
042918,000119:                                                                                                  #                FCARD6  = +0    (NUMBER OF PULSE BURSTS IN 1/2 AMPLITUDE)
042919,000120: 

Page 981

042921,000122:                                                                                                  #  STROKE TEST INITIALIZATION PACKAGE (AS A JOB, FROM VERB 68)
042922,000123: 
042923,000124: 17,2552                                           BANK     17                                    
042924,000125: 20,2000                                           SETLOC   DAPS2                                 
042925,000126: 20,2000                                           BANK                                           
042926,000127: 
042927,000128: 20,3501                                           COUNT*   $$/STRK                               
042928,000129: 20,3501  E6,1655                                  EBANK=   CADDY                                 
042929,000130: 
042930,000131: 20,3501           03512        STRKTSTI           TCR      TSTINIT                               #  STROKE TEST INITIALIZATION PKG (CALLED
042931,000132:                                                                                                  #  AS A JOB BY VERB68)
042932,000133: 
042933,000134: 20,3502           00004        STRKCHK            INHINT                                         
042934,000135: 
042935,000136: 20,3503           31466                           CAE      DAPDATR1                              #  CHECK FOR CSM/LM CONFIGURATION
042936,000137: 20,3504           75002                           MASK     BIT14                                 
042937,000138: 20,3505           00006                           EXTEND                                         
042938,000139: 20,3506           13511                           BZF      +3                                    
042939,000140: 
042940,000141: 20,3507           31413                           CAE      ESTROKER                              #  BEGIN ON NEXT DAP PASS (PITCH OR YAW)
042941,000142: 20,3510           55574                           TS       STROKER                               #  (STROKING DONE IN PITCH ONLY, HOWEVER)
042942,000143: 
042943,000144: 20,3511           15217                           TCF      ENDOFJOB                              
042944,000145: 
042945,000146: 20,3512           43522        TSTINIT            CS       FCADDY                                #  NORMAL ENTRY FROM STRKTSTI
042946,000147: 20,3513           55655                           TS       CADDY                                 
042947,000148: 20,3514           55656                           TS       N                                     #        NOTE SGN CHNG FCADDY(+) TO CADDY(-)
042948,000149: 
042949,000150: 20,3515           33523                           CAF      FREVS                                 
042950,000151: 20,3516           55660                           TS       REVS                                  
042951,000152: 
042952,000153: 20,3517           43524                           CS       FCARD                                 #        NOTE SGN CHNG FCARD(+) TO CARD(-)
042953,000154: 20,3520           55661                           TS       CARD                                  
042954,000155: 
042955,000156: 20,3521           00002                           TC       Q                                     #  RETURN TO STRKTSTI+1 (OR CHKSTRK+2 OR +4)
042956,000157: 

Page 982

042958,000159:                                                                                                  #  THE OFFICIAL STROKE TEST WAVEFORM (3 JAN, 1967) CONSISTS OF FOUR STROKE SETS, AS FOLLOWS....
042959,000160: 
042960,000161:                                                                                                  #        SET 1...10 BURSTS IN 1/2 AMP,   4 REVERSALS
042961,000162:                                                                                                  #        SET 2... 6 BURSTS IN 1/2 AMP,   6 REVERSALS
042962,000163:                                                                                                  #        SET 3... 5 BURSTS IN 1/2 AMP,  10 REVERSALS
042963,000164:                                                                                                  #        SET 4... 4 BURSTS IN 1/2 AMP,  14 REVERSALS
042964,000165: 
042965,000166:                                                                                                  #  THE PULSE BURST SIZE (ESTROKER) IS PAD-LOADED (5 BITS AS OF 3 JAN, 1967)
042966,000167:                                                                                                  #  THE REMAINING WAVEFORM-GENERATING PARAMETERS ARE AS FOLLOWS....
042967,000168: 
042968,000169: 20,3522           00012        FCADDY             DEC      10         B-14                       #  NO. PULSE BURSTS IN 1/2 AMP, SET1..(+10)
042969,000170: 20,3523           00003        FREVS              DEC      3          B-14                       #  NO. REVERSALS MINUS 1, SET1........(  3)
042970,000171: 
042971,000172: 20,3524           00004        FCARD              DEC      4          B-14                       #  NO. STROKE SETS....................(+ 4)
042972,000173: 
042973,000174: 20,3525           00005        FCARD1             DEC      5          B-14                       #  NO. REVERSALS MINUS 1, SET2........(  5)
042974,000175: 
042975,000176: 20,3526           00011        FCARD2             DEC      9          B-14                       #                            3........(  9)
042976,000177: 20,3527           00015        FCARD3             DEC      13         B-14                       #                            4........( 13)
042977,000178: 
042978,000179: 20,3530           00006        FCARD4             DEC      6          B-14                       #  NO. PULSE BURSTS IN 1/2 AMP, SET2..(+ 6)
042979,000180: 20,3531           00005        FCARD5             DEC      5          B-14                       #                               SET3..(+ 5)
042980,000181: 20,3532           00004        FCARD6             DEC      4          B-14                       #                               SET4..(+ 4)
042981,000182: 
042982,000183: 20,3533     5016               20MS               =        BIT2                                  
042983,000184: 
042984,000185:                                                                                                  #  STROKE TEST PACKAGE PROPER....
042985,000186: 
042986,000187: 20,3533  E6,1657                                  EBANK=   BUNKER                                
042987,000188: 
042988,000189: 20,3533           00006        HACK               EXTEND                                         #  ENTRY (IN T5 RUPT) FROM TVCDAPS
042989,000190: 20,3534           23657                           QXCH     BUNKER                                #  SAVE Q FOR DAP RETURN
042990,000191: 
042991,000192: 20,3535           35016                           CAF      20MS                                  #  2DAPSX2(PASSES/DAP)X2(CS/PASS)=8CS=TVCDT
042992,000193: 20,3536           05245                           TC       WAITLIST                              
042993,000194: 20,3537  E6,1657                                  EBANK=   BUNKER                                
042994,000195: 20,3537           03542 40066                     2CADR    HACKWLST                              
042995,000196: 
042996,000197: 20,3541           13544                           TCF      +3                                    
042997,000198: 
042998,000199: 20,3542           34367        HACKWLST           CAF      TCTSKOVR                              #  ENTRY FROM WAITLIST
042999,000200: 20,3543           55657                           TS       BUNKER                                #  BUNKER IS TC TASKOVER
043000,000201: 
043001,000202: 20,3544           31574                           CA       STROKER                               #  STROKE
043002,000203: 20,3545           26054                           ADS      TVCPITCH                              
043003,000204: 
043004,000205: 20,3546           35005                           CAF      BIT11                                 #  RELEASE THE ERROR COUNTERS
043005,000206: 20,3547           00006                           EXTEND                                         
043006,000207: 20,3550           05014                           WOR      CHAN14                                
043007,000208: 20,3551           25655                           INCR     CADDY                                 #  COUNT DOWN THE NO. BURSTS, THIS SLOPE

Page 983

043009,000210: 20,3552           41655                           CS       CADDY                                 
043010,000211: 20,3553           00006                           EXTEND                                         
043011,000212: 20,3554           63556                           BZMF     +2                                    
043012,000213: 20,3555           01657                           TC       BUNKER                                #  EXIT, WHILE ON A SLOPE
043013,000214: 
043014,000215: 20,3556           11660                           CCS      REVS                                  
043015,000216: 20,3557           13577                           TCF      REVUP                                 #  POSITIVE REVS
043016,000217: 20,3560           13603                           TCF      REVUP      +4                         #  FINAL REVERSAL, THIS SET
043017,000218: 
043018,000219: 20,3561           25661                           INCR     CARD                                  #  NEGATIVE REVS SET LAST PASS, READY FOR
043019,000220: 20,3562           41661                           CS       CARD                                  #        THE NEXT SET.  CHECK IF NO MORE SETS
043020,000221: 20,3563           00006                           EXTEND                                         
043021,000222: 20,3564           13575                           BZF      STROKILL                              #  ALL SETS COMPLETED
043022,000223: 
043023,000224: 20,3565           51661                           INDEX    CARD                                  
043024,000225: 20,3566           33530                           CAF      FCARD      +4                         #  PICK UP NO. REVERSALS (-), NEXT SET
043025,000226: 20,3567           55660                           TS       REVS                                  #  REINITIALIZE
043026,000227: 20,3570           51661                           INDEX    CARD                                  
043027,000228: 20,3571           43533                           CS       FCARD      +7                         #  PICK UP NO. BURSTS IN 1/2AMP, NEXT SET
043028,000229: 20,3572           55656                           TS       N                                     #  REINITIALIZE
043029,000230: 20,3573           55655                           TS       CADDY                                 
043030,000231: 20,3574           01657                           TC       BUNKER                                #  EXIT, AT END OF SET
043031,000232: 
043032,000233: 20,3575           55574        STROKILL           TS       STROKER                               #  RESET (TO +0) TO END TEST
043033,000234: 20,3576           01657                           TC       BUNKER                                #  EXIT, STROKE TEST FINIS
043034,000235: 
043035,000236: 20,3577           55660        REVUP              TS       REVS                                  #  ALL REVERSALS EXCEPT LAST OF SET
043036,000237: 20,3600           31656                           CA       N                                     
043037,000238: 20,3601           60000                           DOUBLE                                         #  2 X 1/2AMP
043038,000239: 20,3602           13606                           TCF      +4                                    
043039,000240: 
043040,000241: 20,3603           45017                 +4        CS       ONE                                   #  FINAL REVERSAL, THIS SET
043041,000242: 20,3604           55660                           TS       REVS                                  #  PREPARE TO BRANCH TO NEW BURST
043042,000243: 20,3605           31656                           CA       N                                     #  JUST RETURN TO ZERO, FINAL SLOPE OF SET
043043,000244: 20,3606           55655                           TS       CADDY                                 #  CADUP
043044,000245: 
043045,000246: 20,3607           41574                           CS       STROKER                               #  CHANGE SIGN OF SLOPE
043046,000247: 20,3610           55574                           TS       STROKER                               
043047,000248: 20,3611           01657                           TC       BUNKER                                #  EXIT AT A REVERSAL (SLOPE CHANGE)
043048,000249: 

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