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.

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

Page 420

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

Page 421

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

Page 422

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

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