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.

018184,000002:                                                                                                  ## Copyright:   Public domain.
018185,000003:                                                                                                  ## Filename:    SYSTEM_TEST_STANDARD_LEAD_INS.agc
018186,000004:                                                                                                  ## Purpose:     A section of Comanche revision 044.
018187,000005:                                                                                                  ##              It is part of the reconstructed source code for the
018188,000006:                                                                                                  ##              original release of the flight software for the Command
018189,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
018190,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
018191,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
018192,000010:                                                                                                  ##              exactly match those specified for Comanche 44 in NASA drawing
018193,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
018194,000012:                                                                                                  ##              reconstruction is correct.
018195,000013:                                                                                                  ## Assembler:   yaYUL
018196,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
018197,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
018198,000016:                                                                                                  ## Mod history: 2020-12-03 MAS  Created from Comanche 51.
018199,000017: 

Page 420

018201,000019: 22,3151  E5,1671                                  EBANK=   XSM                                   
018202,000020: 
018203,000021: 33,2000                                           BANK     33                                    
018204,000022: 13,2000                                           SETLOC   E/PROG1                               
018205,000023: 13,2000                                           BANK                                           
018206,000024: 
018207,000025: 13,2036                                           COUNT*   $$/P07                                
018208,000026: 
018209,000027:                                                                                                  #  SPECIAL PROGRAMS TO EASE THE PANGS OF ERASABLE MEMORY PROGRAMS.
018210,000028: 
018211,000029:                                                                                                  #  E/BKCALL      FOR DOING BANKCALLS FROM AND RETURNING TO ERASABLE.
018212,000030: 
018213,000031:                                                                                                  #  THIS ROUTINE IS CALLABLE FROM ERASABLE OR FIXED.  LIKE BANKCALL, HOWEVER, SWITCHING BETWEEN S3 AND S4
018214,000032:                                                                                                  #  IS NOT POSSIBLE.
018215,000033: 
018216,000034:                                                                                                  #  THE CALLING SEQUENCE IS:
018217,000035: 
018218,000036:                                                                                                  #        TC      BANKCALL
018219,000037:                                                                                                  #        CADR    E/BKCALL
018220,000038:                                                                                                  #        CADR    ROUTINE         WHERE YOU WANT TO GO IN FIXED.
018221,000039:                                                                                                  #        RETURN HERE FROM DISPLAY TERMINATE, BAD STALL OR TC Q.
018222,000040:                                                                                                  #        RETURN HERE FROM DISPLAY PROCEED OR GOOD RETURN FROM STALL.
018223,000041:                                                                                                  #        RETURN HERE FROM DISPLAY ENTER OR RECYCLE.
018224,000042: 
018225,000043:                                                                                                  #  THIS ROUTINE REQUIRES TWO ERASABLES (EBUF2, +1) IN UNSWITCHED WHICH ARE UNSHARED BY INTERRUPTS AND
018226,000044:                                                                                                  #  OTHER EMEMORY PROGRAMS.
018227,000045: 
018228,000046:                                                                                                  #  A + L ARE PRESERVED THROUGH BANKCALL AND E/BKCALL.
018229,000047: 
018230,000048: 13,2036           52134        E/BKCALL           DXCH     BUF2                                  #  SAVE A,L AND GET DP RETURN.
018231,000049: 13,2037           52365                           DXCH     EBUF2                                 #  SAVE DP RETURN.
018232,000050: 13,2040           24364                           INCR     EBUF2                                 #  RETURN +1 BECAUSE DOUBLE CADR.
018233,000051: 13,2041           30006                           CA       BBANK                                 
018234,000052: 13,2042           75054                           MASK     LOW10                                 #  GET CURRENT EBANK.  (SBANK SOMEDAY)
018235,000053: 13,2043           26365                           ADS      EBUF2      +1                         #  FORM BBCON.  (WAS FBANK)
018236,000054: 13,2044           50364                           NDX      EBUF2                                 
018237,000055: 13,2045           27777                           CA       0          -1                         #  GET CADR OF ROUTINE.
018238,000056: 13,2046           04666                           TC       SWCALL                                #  GO TO ROUTINE, SETTING Q TO SWRETURN
018239,000057:                                                                                                  #  AND RESTORING A + L.
018240,000058: 13,2047           02053                           TC       +4                                    #  TX Q, V34, OR BAD STALL RETURN.
018241,000059: 13,2050           02052                           TC       +2                                    #  PROCEED OR GOOD STALL RETURN.
018242,000060: 13,2051           24364                           INCR     EBUF2                                 #  ENTER OR RECYCLE RETURN.
018243,000061: 13,2052           24364                           INCR     EBUF2                                 
018244,000062: 13,2053           52365        E/SWITCH           DXCH     EBUF2                                 
018245,000063: 13,2054           52006                           DTCB                                           
018246,000064: 

Page 421

018248,000066:                                                                                                  #  E/CALL        FOR CALLING A FIXED MEMORY INTERPRETIVE SUBROUTINE FROM ERASABLE AND RETURNING TO ERASABLE.
018249,000067: 
018250,000068:                                                                                                  #  THE CALLING SEQUENCE IS...
018251,000069: 
018252,000070:                                                                                                  #        RTB
018253,000071:                                                                                                  #                E/CALL
018254,000072:                                                                                                  #        CADR    ROUTINE                 THE INTERPRETIVE SUBROUTINE YOU WANT.
018255,000073:                                                                                                  #                                        RETURNS HERE IN INTERPRETIVE.
018256,000074: 
018257,000075: 13,2055           22164        E/CALL             LXCH     LOC                                   #  ADRES -1 OF CADR.
018258,000076: 13,2056           50001                           INDEX    L                                     
018259,000077: 13,2057           30001                           CA       L                                     #  CADR IN A.
018260,000078: 13,2060           24001                           INCR     L                                     
018261,000079: 13,2061           24001                           INCR     L                                     #  RETURN ADRES IN L.
018262,000080: 13,2062           52365                           DXCH     EBUF2                                 #  STORE CADR AND RETURN.
018263,000081: 13,2063           06006                           TC       INTPRET                               
018264,000082: 13,2064           77624                           CALL                                           
018265,000083: 13,2065           00364                                    EBUF2                                 #  INDIRECTLY EXECUTE ROUTINE.  IT MUST
018266,000084: 13,2066           77776                           EXIT                                           #  LEAVE VIA RVQ OR EQUIVALENT.
018267,000085: 13,2067           22365                           LXCH     EBUF2      +1                         #  PICK UP RETURN.
018268,000086: 13,2070           16010                           TCF      INTPRET    +2                         #  SET LOC AND RETURB TO CALLER
018269,000087: 

Page 422

018271,000089:                                                                                                  #  E/JOBWAK      FOR WAKING UP ERASABLE MEMORY JOBS.
018272,000090: 
018273,000091:                                                                                                  #  THIS ROUTINE MUST BE CALLED IN INTERRUPT OR WITH INTERRUPTS INHIBITED.
018274,000092: 
018275,000093:                                                                                                  #  THE CALLING SEQUENCE IS:
018276,000094: 
018277,000095:                                                                                                  #        INHINT
018278,000096:                                                                                                  #          .
018279,000097:                                                                                                  #          .
018280,000098:                                                                                                  #        CA      WAKEADR         ADDRESS OF SLEEPING JOB
018281,000099:                                                                                                  #        TC      IBNKCALL
018282,000100:                                                                                                  #        CADR    E/JOBWAK
018283,000101:                                                                                                  #          .                     RETURNS HERE
018284,000102:                                                                                                  #          .
018285,000103:                                                                                                  #          .
018286,000104:                                                                                                  #        RELINT                  IF YOU DID AN INHINT.
018287,000105: 
018288,000106: 33,2000                                           BANK     33                                    
018289,000107: 04,2000                                           SETLOC   E/PROG                                
018290,000108: 04,2000                                           BANK                                           
018291,000109: 
018292,000110: 04,2606                                           COUNT*   $$/P07                                
018293,000111: 
018294,000112: 04,2606           05201        E/JOBWAK           TC       JOBWAKE                               #  ARRIVE IWTH ADRES IN A.
018295,000113: 04,2607           45005                           CS       BIT11                                 
018296,000114: 04,2610           50064                           NDX      LOCCTR                                
018297,000115: 04,2611           26164                           ADS      LOC                                   #  KNOCK FIXED MEMORY BIT OUT OF ADRES.
018298,000116: 04,2612           00072                           TC       RUPTREG3                              #  RETURN
018299,000117: 
018300,000118: 
018301,000119:                                                                                                  #  THESE PROGRAMS ARE PROVIDED TO ALLOW OVERLAY OF BANKS 30 THRU 33 OF THE 205 VERSIONS OF SYSTEM TESTS AND
018302,000120:                                                                                                  #  PRELAUNCH ALIGN.  THE INTENT IS TO ALLOW THE STG AND HYBRID LABS TO RUN ALL THE TESTS WITH COLOSSUS.
018303,000121: 
018304,000122: 
018305,000123: 33,2000                                           BANK     33                                    
018306,000124: 33,2000                                           SETLOC   TESTLEAD                              
018307,000125: 33,2000                                           BANK                                           
018308,000126: 
018309,000127: 33,2000                                           COUNT    33/COMST                              
018310,000128: 
018311,000129: 33,2000  E5,1425                                  EBANK=   QPLACE                                
018312,000130: 
018313,000131: 33,2000           03436        COMPVER            TC       GCOMPVER                              #  MUST BE 33,2000.
018314,000132: 
018315,000133: 33,2001           03131        GTSCPSS1           TC       GTSCPSS                               #  MUST BE AT 33,2001
018316,000134: 
018317,000135: 33,2002           05354        REDO               TC       NEWMODEX                              #  DISPLAY MM 07.
018318,000136: 33,2003           00007                           MM       07         B-14                       #  FALL INTO IMUTEST
018319,000137: 

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