Source Code

These source-code files are part of a reconstructed copy of Comanche 72/3 (AKA Manche72 revision 3), the final, flown mission release of the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 13.

The starting point was the source code of Comanche 72 (itself previously reconstructed). Comanche 72 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 72 and 72/3. The resulting code assembles to have identical memory-bank checksums as those specified in NASA drawing 2021153G; this gives reasonably high confidence that the changes that have been made are correct. In places where ambiguity exists, this ambiguity is discussed in "## Reconstruction:" comments.

Since no contemporary listings of Comanche 72/3 are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

042062,000002:                                                                                                  ## Copyright:   Public domain.
042063,000003:                                                                                                  ## Filename:    TVCSTROKETEST.agc
042064,000004:                                                                                                  ## Purpose:     A section of Manche72 revision 3.
042065,000005:                                                                                                  ##              It is part of the reconstructed source code for the final, flown
042066,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
042067,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
042068,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
042069,000009:                                                                                                  ##              from a reconstructed copy of Comanche 072. It has been adapted
042070,000010:                                                                                                  ##              such that the resulting bugger words exactly match those
042071,000011:                                                                                                  ##              specified for Manche72 revision 3 in NASA drawing 2021153G,
042072,000012:                                                                                                  ##              which gives relatively high confidence that the reconstruction
042073,000013:                                                                                                  ##              is correct.
042074,000014:                                                                                                  ## Assembler:   yaYUL
042075,000015:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
042076,000016:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
042077,000017:                                                                                                  ## Mod history: 2024-05-19 MAS  Created from Comanche 072.
042078,000018: 
042079,000019:                                                                                                  #  NAME          STROKE TEST PACKAGE             (INCLUDING INITIALIZATION PACKAGE)
042080,000020:                                                                                                  #  LOG SECTION...TVCSTROKETEST                   SUBROUTINE...DAPCSM
042081,000021:                                                                                                  #  MODIFIED BY SCHLUNDT                          21 OCTOBER 1968
042082,000022: 
042083,000023:                                                                                                  #  FUNCTIONAL DESCRIPTION....
042084,000024:                                                                                                  #        STROKE TEST PACKAGE GENERATES A WAVEFORM DESIGNED TO EXCITE BENDING
042085,000025:                                                                                                  #        STRKTSTI (STROKE TEST INITIALIZATION) IS CALLED AS A JOB BY VB68.
042086,000026:                                                                                                  #                IT INITIALIZES ALL ERASABLES REQD FOR A STROKE TEST, AND
042087,000027:                                                                                                  #                THEN TESTS FOR CSM/LM (BIT 13 OF DAPDATR1). IF CSM/LM,
042088,000028:                                                                                                  #                IN EITHER HIGH OR LOW-BANDWIDTH MODE, THE TEST IS STARTED
042089,000029:                                                                                                  #                IMMEDIATELY.  IF NOT CSM/LM, PROGRAM EXITS WITH NO ACTION.
042090,000030:                                                                                                  #        HACK (STROKE TEST) GENERATES THE WAVEFORM BY DUMPING PULSE BURSTS
042091,000031:                                                                                                  #                OF PROPER SIGN AND IN PROPER SEQUENCE DIRECTLY INTO
042092,000032:                                                                                                  #                TVCPITCH, WORKING IN CONJUNCITON WITH BOTH PITCH AND YAW
042093,000033:                                                                                                  #                TVC DAPS, WITH INTERMEDIATE WAITLIST CALLS.  NOTE, HOWEVER
042094,000034:                                                                                                  #                THAT THE STROKE TEST IS PERFORMED ONLY IN THE PITCH AXIS.
042095,000035:                                                                                                  #                AN EXAMPLE WAVEFORM IS GIVEN BELOW, TO DEMONSTRATE STROKE-
042096,000036:                                                                                                  #                TEST PARAMETER SELECTION
042097,000037:                                                                                                  #        RESTARTS CAUSE TEST TO BE TERMINATED.  ANOTHER V68 REQD IF TEST
042098,000038:                                                                                                  #                IS TO BE RE-RUN.
042099,000039:                                                                                                  #        PULSE BURST SIZE IS PAD-LOADED (ESTROKER) SO THAT AMPLITUDE OF
042100,000040:                                                                                                  #                WAVEFORM CAN BE CHANGED.  THERE ARE TEN PULSE BURSTS IN
042101,000041:                                                                                                  #                THE HALF-AMPLITUDE OF THE FIRST FREQUENCY SET IN THE
042102,000042:                                                                                                  #                STANDARD WAVEFORM.  AMPLITUDE IS 10(ESTROKER)(1/42.15),
042103,000043:                                                                                                  #                NOMINALLY 50/42.15 = 1.185 DEG
042104,000044: 
042105,000045:                                                                                                  #  CALLING SEQUENCE....
042106,000046:                                                                                                  #        EXTENDED VERB 68 SETS UP STRKTSTI JOB
042107,000047:                                                                                                  #        PITCH AND YAW TVCDAPS, FINDING STROKER NON-ZERO, DO A ..TC HACK..
042108,000048:                                                                                                  #        AN INTERNALLY-GENERATED WAITLIST CALL ENTERS AT ..HACKWLST..
042109,000049: 
042110,000050:                                                                                                  #  NORMAL EXIT MODES....
042111,000051:                                                                                                  #        TC BUNKER (..Q.. IF ENTRY FROM DAP, ..TCTSKOVR.. IF FROM WAITLIST) LIST
042112,000052: 
042113,000053:                                                                                                  #  SUBROUTINES CALLED....
042114,000054:                                                                                                  #        WAITLIST
042115,000055: 
042116,000056:                                                                                                  #  ALARM OR ABORT EXIT MODES....
042117,000057:                                                                                                  #        NONE
042118,000058: 
042119,000059:                                                                                                  #  ERASABLE INITIALIZATION REQUIRED....
042120,000060:                                                                                                  #        ESTROKER (PAD-LOAD)
042121,000061:                                                                                                  #        STROKER, CADDY, REVS, CARD, N
042122,000062: 
042123,000063:                                                                                                  #  OUTPUT....
042124,000064:                                                                                                  #        STRKTSTI...INITIALIZATION FOR STROKE TEST
042125,000065:                                                                                                  #        HACK, HACKWLST...PULSE BURSTS INTO TVCPITCH VIA ..ADS..
042126,000066:                                                                                                  #                          RESETS STROKER = +0 WHEN TEST COMPLETED
042127,000067: 
042128,000068:                                                                                                  #  DEBRIS....
042129,000069:                                                                                                  #        N = CADDY = +0, CARD = -0, REVS = -1
042130,000070:                                                                                                  #        BUNKER
042131,000071: 
042132,000072:                                                                                                  #  EXAMPLE STROKE TEST WAVE FORM, DEMONSTRATING PARAMETER SELECTION
042133,000073: 
042134,000074:                                                                                                  #  NOTE....THIS IS NOT THE OFFICIAL WAVEFORM....
042135,000075: 
042136,000076:                                                                                                  #         **              **
042137,000077:                                                                                                  #         **              **
042138,000078:                                                                                                  #         **              **             EXAMPLE WAVEFORM (EACH * REPRESENTS
042139,000079:                                                                                                  #        *  *            *  *                 85.41 ARCSEC OF ACTUATOR CMND)
042140,000080:                                                                                                  #        *  *            *  *
042141,000081:                                                                                                  #        *  *            *  *
042142,000082:                                                                                                  #       *    *          *    *          **      **      **      **      **
042143,000083:                                                                                                  #       *    *          *    *          **      **      **      **      **
042144,000084:                                                                                                  #       *    *          *    *          **      **      **      **      **
042145,000085:                                                                                                  #      *      *        *      *        *  *    *  *    *  *    *  *    *  *    **  **  **  **  **
042146,000086:                                                                                                  #      *      *        *      *        *  *    *  *    *  *    *  *    *  *    **  **  **  **  **
042147,000087:                                                                                                  #      *      *        *      *        *  *    *  *    *  *    *  *    *  *    **  **  **  **  **
042148,000088:                                                                                                  #  -----------------------------------------------------------------------------------------------------
042149,000089:                                                                                                  #              *      *        *      *    *  *    *  *    *  *    *  *    *  *  **  **  **  **  **
042150,000090:                                                                                                  #              *      *        *      *    *  *    *  *    *  *    *  *    *  *  **  **  **  **  **
042151,000091:                                                                                                  #              *      *        *      *    *  *    *  *    *  *    *  *    *  *  **  **  **  **  **
042152,000092:                                                                                                  #               *    *          *    *      **      **      **      **      **
042153,000093:                                                                                                  #               *    *          *    *      **      **      **      **      **
042154,000094:                                                                                                  #               *    *          *    *      **      **      **      **      **
042155,000095:                                                                                                  #                *  *            *  *
042156,000096:                                                                                                  #                *  *            *  *
042157,000097:                                                                                                  #                *  *            *  *
042158,000098:                                                                                                  #                 **              **
042159,000099:                                                                                                  #                 **              **
042160,000100:                                                                                                  #                 **              **
042161,000101: 
042162,000102:                                                                                                  #  FOR THIS (UNOFFICIAL, EXAMPLE) WAVEFORM, THE REQUIRED PARAMETERS ARE AS FOLLOWS....
042163,000103: 
042164,000104:                                                                                                  #        FCARD    = +3           (NUMBER OF SETS)
042165,000105:                                                                                                  #        ESTROKER = +3           (PULSE BURST SIZE, SC.AT 85.41 ARCSEC/BIT)
042166,000106: 
042167,000107:                                                                                                  #        SET1..
042168,000108:                                                                                                  #                FREVS   = +3    (NUMBER REVERSALS MINUS 1)
042169,000109:                                                                                                  #                FCADDY  = +4    (NUMBER OF PULSE BURSTS IN 1/2 AMPLITUDE)
042170,000110:                                                                                                  #        SET2..
042171,000111:                                                                                                  #                FCARD1  = +9    (NUMBER REVERSALS MINUS 1)
042172,000112:                                                                                                  #                FCARD4  = +2    (NUMBER OF PULSE BURSTS IN 1/2 AMPLITUDE)
042173,000113:                                                                                                  #        SET3..
042174,000114:                                                                                                  #                FCARD2  = +9    (NUMBER REVERSALS MINUS 1)
042175,000115:                                                                                                  #                FCARD5  = +1    (NUMBER OF PULSE BURSTS IN 1/2 AMPLITUDE)
042176,000116:                                                                                                  #        SET4..
042177,000117:                                                                                                  #                FCARD3  = +0    (NUMBER REVERSALS MINUS 1)
042178,000118:                                                                                                  #                FCARD6  = +0    (NUMBER OF PULSE BURSTS IN 1/2 AMPLITUDE)
042179,000119: 
042180,000120:                                                                                                  #  STROKE TEST INITIALIZATION PACKAGE (AS A JOB, FROM VERB 68)
042181,000121: 
042182,000122: 17,2610                                           BANK     17                                    
042183,000123: 20,2000                                           SETLOC   DAPS2                                 
042184,000124: 20,2000                                           BANK                                           
042185,000125: 
042186,000126: 20,3537                                           COUNT*   $$/STRK                               
042187,000127: 20,3537  E6,1657                                  EBANK=   CADDY                                 
042188,000128: 
042189,000129: 20,3537           03550        STRKTSTI           TCR      TSTINIT                               #  STROKE TEST INITIALIZATION PKG (CALLED
042190,000130:                                                                                                  #  AS A JOB BY VERB68)
042191,000131: 
042192,000132: 20,3540           00004        STRKCHK            INHINT                                         
042193,000133: 
042194,000134: 20,3541           31466                           CAE      DAPDATR1                              #  CHECK FOR CSM/LM CONFIGURATION
042195,000135: 20,3542           75016                           MASK     BIT14                                 
042196,000136: 20,3543           00006                           EXTEND                                         
042197,000137: 20,3544           13547                           BZF      +3                                    
042198,000138: 
042199,000139: 20,3545           31413                           CAE      ESTROKER                              #  BEGIN ON NEXT DAP PASS (PITCH OR YAW)
042200,000140: 20,3546           55574                           TS       STROKER                               #  (STROKING DONE IN PITCH ONLY, HOWEVER)
042201,000141: 
042202,000142: 20,3547           15233                           TCF      ENDOFJOB                              
042203,000143: 
042204,000144: 20,3550           43560        TSTINIT            CS       FCADDY                                #  NORMAL ENTRY FROM STRKTSTI
042205,000145: 20,3551           55657                           TS       CADDY                                 
042206,000146: 20,3552           55660                           TS       N                                     #        NOTE SGN CHNG FCADDY(+) TO CADDY(-)
042207,000147: 
042208,000148: 20,3553           33561                           CAF      FREVS                                 
042209,000149: 20,3554           55662                           TS       REVS                                  
042210,000150: 
042211,000151: 20,3555           43562                           CS       FCARD                                 #        NOTE SGN CHNG FCARD(+) TO CARD(-)
042212,000152: 20,3556           55663                           TS       CARD                                  
042213,000153: 
042214,000154: 20,3557           00002                           TC       Q                                     #  RETURN TO STRKTSTI+1 (OR CHKSTRK+2 OR +4)
042215,000155: 
042216,000156:                                                                                                  #  THE OFFICIAL STROKE TEST WAVEFORM (3 JAN, 1967) CONSISTS OF FOUR STROKE SETS, AS FOLLOWS....
042217,000157: 
042218,000158:                                                                                                  #        SET 1...10 BURSTS IN 1/2 AMP,   4 REVERSALS
042219,000159:                                                                                                  #        SET 2... 6 BURSTS IN 1/2 AMP,   6 REVERSALS
042220,000160:                                                                                                  #        SET 3... 5 BURSTS IN 1/2 AMP,  10 REVERSALS
042221,000161:                                                                                                  #        SET 4... 4 BURSTS IN 1/2 AMP,  14 REVERSALS
042222,000162: 
042223,000163:                                                                                                  #  THE PULSE BURST SIZE (ESTROKER) IS PAD-LOADED (5 BITS AS OF 3 JAN, 1967)
042224,000164:                                                                                                  #  THE REMAINING WAVEFORM-GENERATING PARAMETERS ARE AS FOLLOWS....
042225,000165: 
042226,000166: 20,3560           00012        FCADDY             DEC      10         B-14                       #  NO. PULSE BURSTS IN 1/2 AMP, SET1..(+10)
042227,000167: 20,3561           00003        FREVS              DEC      3          B-14                       #  NO. REVERSALS MINUS 1, SET1........(  3)
042228,000168: 
042229,000169: 20,3562           00004        FCARD              DEC      4          B-14                       #  NO. STROKE SETS....................(+ 4)
042230,000170: 
042231,000171: 20,3563           00005        FCARD1             DEC      5          B-14                       #  NO. REVERSALS MINUS 1, SET2........(  5)
042232,000172: 
042233,000173: 20,3564           00011        FCARD2             DEC      9          B-14                       #                            3........(  9)
042234,000174: 20,3565           00015        FCARD3             DEC      13         B-14                       #                            4........( 13)
042235,000175: 
042236,000176: 20,3566           00006        FCARD4             DEC      6          B-14                       #  NO. PULSE BURSTS IN 1/2 AMP, SET2..(+ 6)
042237,000177: 20,3567           00005        FCARD5             DEC      5          B-14                       #                               SET3..(+ 5)
042238,000178: 20,3570           00004        FCARD6             DEC      4          B-14                       #                               SET4..(+ 4)
042239,000179: 
042240,000180: 20,3571     5032               20MS               =        BIT2                                  
042241,000181: 
042242,000182:                                                                                                  #  STROKE TEST PACKAGE PROPER....
042243,000183: 
042244,000184: 20,3571  E6,1661                                  EBANK=   BUNKER                                
042245,000185: 
042246,000186: 20,3571           00006        HACK               EXTEND                                         #  ENTRY (IN T5 RUPT) FROM TVCDAPS
042247,000187: 20,3572           23661                           QXCH     BUNKER                                #  SAVE Q FOR DAP RETURN
042248,000188: 
042249,000189: 20,3573           35032                           CAF      20MS                                  #  2DAPSX2(PASSES/DAP)X2(CS/PASS)=8CS=TVCDT
042250,000190: 20,3574           05261                           TC       WAITLIST                              
042251,000191: 20,3575  E6,1661                                  EBANK=   BUNKER                                
042252,000192: 20,3575           03600 40066                     2CADR    HACKWLST                              
042253,000193: 
042254,000194: 20,3577           13602                           TCF      +3                                    
042255,000195: 
042256,000196: 20,3600           34367        HACKWLST           CAF      TCTSKOVR                              #  ENTRY FROM WAITLIST
042257,000197: 20,3601           55661                           TS       BUNKER                                #  BUNKER IS TC TASKOVER
042258,000198: 
042259,000199: 20,3602           31574                           CA       STROKER                               #  STROKE
042260,000200: 20,3603           26054                           ADS      TVCPITCH                              
042261,000201: 
042262,000202: 20,3604           35021                           CAF      BIT11                                 #  RELEASE THE ERROR COUNTERS
042263,000203: 20,3605           00006                           EXTEND                                         
042264,000204: 20,3606           05014                           WOR      CHAN14                                
042265,000205: 20,3607           25657                           INCR     CADDY                                 #  COUNT DOWN THE NO. BURSTS, THIS SLOPE
042266,000206: 20,3610           41657                           CS       CADDY                                 
042267,000207: 20,3611           00006                           EXTEND                                         
042268,000208: 20,3612           63614                           BZMF     +2                                    
042269,000209: 20,3613           01661                           TC       BUNKER                                #  EXIT, WHILE ON A SLOPE
042270,000210: 
042271,000211: 20,3614           11662                           CCS      REVS                                  
042272,000212: 20,3615           13635                           TCF      REVUP                                 #  POSITIVE REVS
042273,000213: 20,3616           13641                           TCF      REVUP      +4                         #  FINAL REVERSAL, THIS SET
042274,000214: 
042275,000215: 20,3617           25663                           INCR     CARD                                  #  NEGATIVE REVS SET LAST PASS, READY FOR
042276,000216: 20,3620           41663                           CS       CARD                                  #        THE NEXT SET.  CHECK IF NO MORE SETS
042277,000217: 20,3621           00006                           EXTEND                                         
042278,000218: 20,3622           13633                           BZF      STROKILL                              #  ALL SETS COMPLETED
042279,000219: 
042280,000220: 20,3623           51663                           INDEX    CARD                                  
042281,000221: 20,3624           33566                           CAF      FCARD      +4                         #  PICK UP NO. REVERSALS (-), NEXT SET
042282,000222: 20,3625           55662                           TS       REVS                                  #  REINITIALIZE
042283,000223: 20,3626           51663                           INDEX    CARD                                  
042284,000224: 20,3627           43571                           CS       FCARD      +7                         #  PICK UP NO. BURSTS IN 1/2AMP, NEXT SET
042285,000225: 20,3630           55660                           TS       N                                     #  REINITIALIZE
042286,000226: 20,3631           55657                           TS       CADDY                                 
042287,000227: 20,3632           01661                           TC       BUNKER                                #  EXIT, AT END OF SET
042288,000228: 
042289,000229: 20,3633           55574        STROKILL           TS       STROKER                               #  RESET (TO +0) TO END TEST
042290,000230: 20,3634           01661                           TC       BUNKER                                #  EXIT, STROKE TEST FINIS
042291,000231: 
042292,000232: 20,3635           55662        REVUP              TS       REVS                                  #  ALL REVERSALS EXCEPT LAST OF SET
042293,000233: 20,3636           31660                           CA       N                                     
042294,000234: 20,3637           60000                           DOUBLE                                         #  2 X 1/2AMP
042295,000235: 20,3640           13644                           TCF      +4                                    
042296,000236: 
042297,000237: 20,3641           45033                 +4        CS       ONE                                   #  FINAL REVERSAL, THIS SET
042298,000238: 20,3642           55662                           TS       REVS                                  #  PREPARE TO BRANCH TO NEW BURST
042299,000239: 20,3643           31660                           CA       N                                     #  JUST RETURN TO ZERO, FINAL SLOPE OF SET
042300,000240: 20,3644           55657                           TS       CADDY                                 #  CADUP
042301,000241: 
042302,000242: 20,3645           41574                           CS       STROKER                               #  CHANGE SIGN OF SLOPE
042303,000243: 20,3646           55574                           TS       STROKER                               
042304,000244: 20,3647           01661                           TC       BUNKER                                #  EXIT AT A REVERSAL (SLOPE CHANGE)
042305,000245: 

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