Source Code

These source-code files were from the printout at the MIT Museum, with many thanks to Deborah Douglas, the Museum's Curator of Science and Technology, for releasing it to us. The printout was digitally photographed by Paul Fjeld. A team of volunteers transcribed the source code manually from these images or, where appropriate, modified already-transcribed but similar source Colossus 249 (Apollo 9) source code to agree with the images from the printout. Note that the page images presented online are of reduced quality, and that higher-quality images are available. Report any conversion errors or legibility problems in page images to info@sandroid.org. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 055 OF AGC PROGRAM COMANCHE BY NASA 2021113-051
	10:28 APR.  1,1969
Note that the date is the date of the printout, not the date of the program revision.

018442,000002:                                                                                                  ## Copyright:   Public domain.
018443,000003:                                                                                                  ## Filename:    SYSTEM_TEST_STANDARD_LEAD_INS.agc
018444,000004:                                                                                                  ## Purpose:     Part of the source code for Comanche, build 055.
018445,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
018446,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), Apollo 11.
018447,000007:                                                                                                  ## Assembler:   yaYUL
018448,000008:                                                                                                  ## Reference:   pp. 420-422
018449,000009:                                                                                                  ## Contact:     Onno Hommes <ohommes@cmu.edu>.
018450,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo.
018451,000011:                                                                                                  ## Mod history: 05/07/09 OH     Transcription Batch 1 Assignment 
018452,000012:                                                                                                  ##              2016-12-10 RSB  Proofed comments with octopus/ProoferComments
018453,000013:                                                                                                  ##                              and fixed the errors found.
018454,000014:                                                                                                  ##              2017-01-18 RSB  Fixed comment-text errors noted while diff'ing
018455,000015:                                                                                                  ##                              vs Colossus 249.
018456,000016:                                                                                                  ##
018457,000017:                                                                                                  ## The contents of the "Comanche055" files, in general, are transcribed 
018458,000018:                                                                                                  ## from scanned documents. 
018459,000019:                                                                                                  ##
018460,000020:                                                                                                  ##      Assemble revision 055 of AGC program Comanche by NASA
018461,000021:                                                                                                  ##      2021113-051.  April 1, 1969.  
018462,000022:                                                                                                  ##
018463,000023:                                                                                                  ##      This AGC program shall also be referred to as Colossus 2A
018464,000024:                                                                                                  ##
018465,000025:                                                                                                  ##      Prepared by
018466,000026:                                                                                                  ##                      Massachusetts Institute of Technology
018467,000027:                                                                                                  ##                      75 Cambridge Parkway
018468,000028:                                                                                                  ##                      Cambridge, Massachusetts
018469,000029:                                                                                                  ##
018470,000030:                                                                                                  ##      under NASA contract NAS 9-4065.
018471,000031:                                                                                                  ##
018472,000032:                                                                                                  ## Refer directly to the online document mentioned above for further information.
018473,000033:                                                                                                  ## Please report any errors to info@sandroid.org.
018474,000034: 
018475,000035: 

Page 420

018477,000037: 22,3151  E5,1671                                  EBANK=   XSM                                   
018478,000038: 
018479,000039: 33,2000                                           BANK     33                                    
018480,000040: 13,2000                                           SETLOC   E/PROG1                               
018481,000041: 13,2000                                           BANK                                           
018482,000042: 
018483,000043: 13,2036                                           COUNT*   $$/P07                                
018484,000044: 
018485,000045:                                                                                                  #  SPECIAL PROGRAMS TO EASE THE PANGS OF ERASABLE MEMORY PROGRAMS.
018486,000046: 
018487,000047:                                                                                                  #  E/BKCALL      FOR DOING BANKCALLS FROM AND RETURNING TO ERASABLE.
018488,000048: 
018489,000049:                                                                                                  #  THIS ROUTINE IS CALLABLE FROM ERASABLE OR FIXED.  LIKE BANKCALL, HOWEVER, SWITCHING BETWEEN S3 AND S4
018490,000050:                                                                                                  #  IS NOT POSSIBLE.
018491,000051: 
018492,000052:                                                                                                  #  THE CALLING SEQUENCE IS:
018493,000053: 
018494,000054:                                                                                                  #        TC      BANKCALL
018495,000055:                                                                                                  #        CADR    E/BKCALL
018496,000056:                                                                                                  #        CADR    ROUTINE         WHERE YOU WANT TO GO IN FIXED.
018497,000057:                                                                                                  #        RETURN HERE FROM DISPLAY TERMINATE, BAD STALL OR TC Q.
018498,000058:                                                                                                  #        RETURN HERE FROM DISPLAY PROCEED OR GOOD RETURN FROM STALL.
018499,000059:                                                                                                  #        RETURN HERE FROM DISPLAY ENTER OR RECYCLE.
018500,000060: 
018501,000061:                                                                                                  #  THIS ROUTINE REQUIRES TWO ERASABLES (EBUF2, +1) IN UNSWITCHED WHICH ARE UNSHARED BY INTERRUPTS AND
018502,000062:                                                                                                  #  OTHER EMEMORY PROGRAMS.
018503,000063: 
018504,000064:                                                                                                  #  A + L ARE PRESERVED THROUGH BANKCALL AND E/BKCALL.
018505,000065: 
018506,000066: 13,2036           52134        E/BKCALL           DXCH     BUF2                                  #  SAVE A,L AND GET DP RETURN.
018507,000067: 13,2037           52365                           DXCH     EBUF2                                 #  SAVE DP RETURN.
018508,000068: 13,2040           24364                           INCR     EBUF2                                 #  RETURN +1 BECAUSE DOUBLE CADR.
018509,000069: 13,2041           30006                           CA       BBANK                                 
018510,000070: 13,2042           75054                           MASK     LOW10                                 #  GET CURRENT EBANK.  (SBANK SOMEDAY)
018511,000071: 13,2043           26365                           ADS      EBUF2      +1                         #  FORM BBCON.  (WAS FBANK)
018512,000072: 13,2044           50364                           NDX      EBUF2                                 
018513,000073: 13,2045           27777                           CA       0          -1                         #  GET CADR OF ROUTINE.
018514,000074: 13,2046           04666                           TC       SWCALL                                #  GO TO ROUTINE, SETTING Q TO SWRETURN
018515,000075:                                                                                                  #  AND RESTORING A + L.
018516,000076: 13,2047           02053                           TC       +4                                    #  TX Q, V34, OR BAD STALL RETURN.
018517,000077: 13,2050           02052                           TC       +2                                    #  PROCEED OR GOOD STALL RETURN.
018518,000078: 13,2051           24364                           INCR     EBUF2                                 #  ENTER OR RECYCLE RETURN.
018519,000079: 13,2052           24364                           INCR     EBUF2                                 
018520,000080: 13,2053           52365        E/SWITCH           DXCH     EBUF2                                 
018521,000081: 13,2054           52006                           DTCB                                           
018522,000082: 

Page 421

018524,000084:                                                                                                  #  E/CALL        FOR CALLING A FIXED MEMORY INTERPRETIVE SUBROUTINE FROM ERASABLE AND RETURNING TO ERASABLE.
018525,000085: 
018526,000086:                                                                                                  #  THE CALLING SEQUENCE IS...
018527,000087: 
018528,000088:                                                                                                  #        RTB
018529,000089:                                                                                                  #                E/CALL
018530,000090:                                                                                                  #        CADR    ROUTINE                 THE INTERPRETIVE SUBROUTINE YOU WANT.
018531,000091:                                                                                                  #                                        RETURNS HERE IN INTERPRETIVE.
018532,000092: 
018533,000093: 13,2055           22164        E/CALL             LXCH     LOC                                   #  ADRES -1 OF CADR.
018534,000094: 13,2056           50001                           INDEX    L                                     
018535,000095: 13,2057           30001                           CA       L                                     #  CADR IN A.
018536,000096: 13,2060           24001                           INCR     L                                     
018537,000097: 13,2061           24001                           INCR     L                                     #  RETURN ADRES IN L.
018538,000098: 13,2062           52365                           DXCH     EBUF2                                 #  STORE CADR AND RETURN.
018539,000099: 13,2063           06006                           TC       INTPRET                               
018540,000100: 13,2064           77624                           CALL                                           
018541,000101: 13,2065           00364                                    EBUF2                                 #  INDIRECTLY EXECUTE ROUTINE.  IT MUST
018542,000102: 13,2066           77776                           EXIT                                           #  LEAVE VIA RVQ OR EQUIVALENT.
018543,000103: 13,2067           22365                           LXCH     EBUF2      +1                         #  PICK UP RETURN.
018544,000104: 13,2070           16010                           TCF      INTPRET    +2                         #  SET LOC AND RETURB TO CALLER
018545,000105: 

Page 422

018547,000107:                                                                                                  #  E/JOBWAK      FOR WAKING UP ERASABLE MEMORY JOBS.
018548,000108: 
018549,000109:                                                                                                  #  THIS ROUTINE MUST BE CALLED IN INTERRUPT OR WITH INTERRUPTS INHIBITED.
018550,000110: 
018551,000111:                                                                                                  #  THE CALLING SEQUENCE IS:
018552,000112: 
018553,000113:                                                                                                  #        INHINT
018554,000114:                                                                                                  #          .
018555,000115:                                                                                                  #          .
018556,000116:                                                                                                  #        CA      WAKEADR         ADDRESS OF SLEEPING JOB
018557,000117:                                                                                                  #        TC      IBNKCALL
018558,000118:                                                                                                  #        CADR    E/JOBWAK
018559,000119:                                                                                                  #          .                     RETURNS HERE
018560,000120:                                                                                                  #          .
018561,000121:                                                                                                  #          .
018562,000122:                                                                                                  #        RELINT                  IF YOU DID AN INHINT.
018563,000123: 
018564,000124: 33,2000                                           BANK     33                                    
018565,000125: 04,2000                                           SETLOC   E/PROG                                
018566,000126: 04,2000                                           BANK                                           
018567,000127: 
018568,000128: 04,2606                                           COUNT*   $$/P07                                
018569,000129: 
018570,000130: 04,2606           05201        E/JOBWAK           TC       JOBWAKE                               #  ARRIVE IWTH ADRES IN A.
018571,000131: 04,2607           45005                           CS       BIT11                                 
018572,000132: 04,2610           50064                           NDX      LOCCTR                                
018573,000133: 04,2611           26164                           ADS      LOC                                   #  KNOCK FIXED MEMORY BIT OUT OF ADRES.
018574,000134: 04,2612           00072                           TC       RUPTREG3                              #  RETURN
018575,000135: 
018576,000136: 
018577,000137:                                                                                                  #  THESE PROGRAMS ARE PROVIDED TO ALLOW OVERLAY OF BANKS 30 THRU 33 OF THE 205 VERSIONS OF SYSTEM TESTS AND
018578,000138:                                                                                                  #  PRELAUNCH ALIGN.  THE INTENT IS TO ALLOW THE STG AND HYBRID LABS TO RUN ALL THE TESTS WITH COLOSSUS.
018579,000139: 
018580,000140: 
018581,000141: 33,2000                                           BANK     33                                    
018582,000142: 33,2000                                           SETLOC   TESTLEAD                              
018583,000143: 33,2000                                           BANK                                           
018584,000144: 
018585,000145: 33,2000                                           COUNT    33/COMST                              
018586,000146: 
018587,000147: 33,2000  E5,1425                                  EBANK=   QPLACE                                
018588,000148: 
018589,000149: 33,2000           03436        COMPVER            TC       GCOMPVER                              #  MUST BE 33,2000.
018590,000150: 
018591,000151: 33,2001           03131        GTSCPSS1           TC       GTSCPSS                               #  MUST BE AT 33,2001
018592,000152: 
018593,000153: 33,2002           05354        REDO               TC       NEWMODEX                              #  DISPLAY MM 07.
018594,000154: 33,2003           00007                           MM       07         B-14                       #  FALL INTO IMUTEST
018595,000155: 

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