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.

018013,000002:                                                                                                  ## Copyright:   Public domain.
018014,000003:                                                                                                  ## Filename:    SYSTEM_TEST_STANDARD_LEAD_INS.agc
018015,000004:                                                                                                  ## Purpose:     A section of Comanche revision 045.
018016,000005:                                                                                                  ##              It is part of the reconstructed source code for the
018017,000006:                                                                                                  ##              second release of the flight software for the Command
018018,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
018019,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
018020,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
018021,000010:                                                                                                  ##              exactly match those specified for Comanche 45 in NASA drawing
018022,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
018023,000012:                                                                                                  ##              reconstruction is correct.
018024,000013:                                                                                                  ## Assembler:   yaYUL
018025,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
018026,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
018027,000016:                                                                                                  ## Mod history: 2020-12-06 MAS  Created from Comanche 44.
018028,000017: 

Page 420

018030,000019: 22,3151  E5,1671                                  EBANK=   XSM                                   
018031,000020: 
018032,000021: 33,2000                                           BANK     33                                    
018033,000022: 13,2000                                           SETLOC   E/PROG1                               
018034,000023: 13,2000                                           BANK                                           
018035,000024: 
018036,000025: 13,2036                                           COUNT*   $$/P07                                
018037,000026: 
018038,000027:                                                                                                  #  SPECIAL PROGRAMS TO EASE THE PANGS OF ERASABLE MEMORY PROGRAMS.
018039,000028: 
018040,000029:                                                                                                  #  E/BKCALL      FOR DOING BANKCALLS FROM AND RETURNING TO ERASABLE.
018041,000030: 
018042,000031:                                                                                                  #  THIS ROUTINE IS CALLABLE FROM ERASABLE OR FIXED.  LIKE BANKCALL, HOWEVER, SWITCHING BETWEEN S3 AND S4
018043,000032:                                                                                                  #  IS NOT POSSIBLE.
018044,000033: 
018045,000034:                                                                                                  #  THE CALLING SEQUENCE IS:
018046,000035: 
018047,000036:                                                                                                  #        TC      BANKCALL
018048,000037:                                                                                                  #        CADR    E/BKCALL
018049,000038:                                                                                                  #        CADR    ROUTINE         WHERE YOU WANT TO GO IN FIXED.
018050,000039:                                                                                                  #        RETURN HERE FROM DISPLAY TERMINATE, BAD STALL OR TC Q.
018051,000040:                                                                                                  #        RETURN HERE FROM DISPLAY PROCEED OR GOOD RETURN FROM STALL.
018052,000041:                                                                                                  #        RETURN HERE FROM DISPLAY ENTER OR RECYCLE.
018053,000042: 
018054,000043:                                                                                                  #  THIS ROUTINE REQUIRES TWO ERASABLES (EBUF2, +1) IN UNSWITCHED WHICH ARE UNSHARED BY INTERRUPTS AND
018055,000044:                                                                                                  #  OTHER EMEMORY PROGRAMS.
018056,000045: 
018057,000046:                                                                                                  #  A + L ARE PRESERVED THROUGH BANKCALL AND E/BKCALL.
018058,000047: 
018059,000048: 13,2036           52134        E/BKCALL           DXCH     BUF2                                  #  SAVE A,L AND GET DP RETURN.
018060,000049: 13,2037           52365                           DXCH     EBUF2                                 #  SAVE DP RETURN.
018061,000050: 13,2040           24364                           INCR     EBUF2                                 #  RETURN +1 BECAUSE DOUBLE CADR.
018062,000051: 13,2041           30006                           CA       BBANK                                 
018063,000052: 13,2042           75054                           MASK     LOW10                                 #  GET CURRENT EBANK.  (SBANK SOMEDAY)
018064,000053: 13,2043           26365                           ADS      EBUF2      +1                         #  FORM BBCON.  (WAS FBANK)
018065,000054: 13,2044           50364                           NDX      EBUF2                                 
018066,000055: 13,2045           27777                           CA       0          -1                         #  GET CADR OF ROUTINE.
018067,000056: 13,2046           04666                           TC       SWCALL                                #  GO TO ROUTINE, SETTING Q TO SWRETURN
018068,000057:                                                                                                  #  AND RESTORING A + L.
018069,000058: 13,2047           02053                           TC       +4                                    #  TX Q, V34, OR BAD STALL RETURN.
018070,000059: 13,2050           02052                           TC       +2                                    #  PROCEED OR GOOD STALL RETURN.
018071,000060: 13,2051           24364                           INCR     EBUF2                                 #  ENTER OR RECYCLE RETURN.
018072,000061: 13,2052           24364                           INCR     EBUF2                                 
018073,000062: 13,2053           52365        E/SWITCH           DXCH     EBUF2                                 
018074,000063: 13,2054           52006                           DTCB                                           
018075,000064: 

Page 421

018077,000066:                                                                                                  #  E/CALL        FOR CALLING A FIXED MEMORY INTERPRETIVE SUBROUTINE FROM ERASABLE AND RETURNING TO ERASABLE.
018078,000067: 
018079,000068:                                                                                                  #  THE CALLING SEQUENCE IS...
018080,000069: 
018081,000070:                                                                                                  #        RTB
018082,000071:                                                                                                  #                E/CALL
018083,000072:                                                                                                  #        CADR    ROUTINE                 THE INTERPRETIVE SUBROUTINE YOU WANT.
018084,000073:                                                                                                  #                                        RETURNS HERE IN INTERPRETIVE.
018085,000074: 
018086,000075: 13,2055           22164        E/CALL             LXCH     LOC                                   #  ADRES -1 OF CADR.
018087,000076: 13,2056           50001                           INDEX    L                                     
018088,000077: 13,2057           30001                           CA       L                                     #  CADR IN A.
018089,000078: 13,2060           24001                           INCR     L                                     
018090,000079: 13,2061           24001                           INCR     L                                     #  RETURN ADRES IN L.
018091,000080: 13,2062           52365                           DXCH     EBUF2                                 #  STORE CADR AND RETURN.
018092,000081: 13,2063           06006                           TC       INTPRET                               
018093,000082: 13,2064           77624                           CALL                                           
018094,000083: 13,2065           00364                                    EBUF2                                 #  INDIRECTLY EXECUTE ROUTINE.  IT MUST
018095,000084: 13,2066           77776                           EXIT                                           #  LEAVE VIA RVQ OR EQUIVALENT.
018096,000085: 13,2067           22365                           LXCH     EBUF2      +1                         #  PICK UP RETURN.
018097,000086: 13,2070           16010                           TCF      INTPRET    +2                         #  SET LOC AND RETURB TO CALLER
018098,000087: 

Page 422

018100,000089:                                                                                                  #  E/JOBWAK      FOR WAKING UP ERASABLE MEMORY JOBS.
018101,000090: 
018102,000091:                                                                                                  #  THIS ROUTINE MUST BE CALLED IN INTERRUPT OR WITH INTERRUPTS INHIBITED.
018103,000092: 
018104,000093:                                                                                                  #  THE CALLING SEQUENCE IS:
018105,000094: 
018106,000095:                                                                                                  #        INHINT
018107,000096:                                                                                                  #          .
018108,000097:                                                                                                  #          .
018109,000098:                                                                                                  #        CA      WAKEADR         ADDRESS OF SLEEPING JOB
018110,000099:                                                                                                  #        TC      IBNKCALL
018111,000100:                                                                                                  #        CADR    E/JOBWAK
018112,000101:                                                                                                  #          .                     RETURNS HERE
018113,000102:                                                                                                  #          .
018114,000103:                                                                                                  #          .
018115,000104:                                                                                                  #        RELINT                  IF YOU DID AN INHINT.
018116,000105: 
018117,000106: 33,2000                                           BANK     33                                    
018118,000107: 04,2000                                           SETLOC   E/PROG                                
018119,000108: 04,2000                                           BANK                                           
018120,000109: 
018121,000110: 04,2606                                           COUNT*   $$/P07                                
018122,000111: 
018123,000112: 04,2606           05201        E/JOBWAK           TC       JOBWAKE                               #  ARRIVE IWTH ADRES IN A.
018124,000113: 04,2607           45005                           CS       BIT11                                 
018125,000114: 04,2610           50064                           NDX      LOCCTR                                
018126,000115: 04,2611           26164                           ADS      LOC                                   #  KNOCK FIXED MEMORY BIT OUT OF ADRES.
018127,000116: 04,2612           00072                           TC       RUPTREG3                              #  RETURN
018128,000117: 
018129,000118: 
018130,000119:                                                                                                  #  THESE PROGRAMS ARE PROVIDED TO ALLOW OVERLAY OF BANKS 30 THRU 33 OF THE 205 VERSIONS OF SYSTEM TESTS AND
018131,000120:                                                                                                  #  PRELAUNCH ALIGN.  THE INTENT IS TO ALLOW THE STG AND HYBRID LABS TO RUN ALL THE TESTS WITH COLOSSUS.
018132,000121: 
018133,000122: 
018134,000123: 33,2000                                           BANK     33                                    
018135,000124: 33,2000                                           SETLOC   TESTLEAD                              
018136,000125: 33,2000                                           BANK                                           
018137,000126: 
018138,000127: 33,2000                                           COUNT    33/COMST                              
018139,000128: 
018140,000129: 33,2000  E5,1425                                  EBANK=   QPLACE                                
018141,000130: 
018142,000131: 33,2000           03436        COMPVER            TC       GCOMPVER                              #  MUST BE 33,2000.
018143,000132: 
018144,000133: 33,2001           03131        GTSCPSS1           TC       GTSCPSS                               #  MUST BE AT 33,2001
018145,000134: 
018146,000135: 33,2002           05354        REDO               TC       NEWMODEX                              #  DISPLAY MM 07.
018147,000136: 33,2003           00007                           MM       07         B-14                       #  FALL INTO IMUTEST
018148,000137: 

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