Source Code

This is the source-code for the Apollo 9 Command Module's Guidance Computer. These files were derived originally from the scan from MIT's Dibner Institute's now-discontinued website titled "History of Recent Science and Technology", which in turn was originally created by Gary Neff, though his high-quality scans were unfortunately reduced in legibility when presented online. The markings on the front of the printout imply that it was the original AGC developer Norm Brodeur's copy. A scan by Ron Burkey has superceded it, made from a more-legible copy from the collection of original AGC developer Fred Martin. The source code was transcribed from those images by Ron Burkey. 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:

	ASSEMBLE REVISION 249 OF AGC PROGRAM COLOSSUS BY NASA 2021111-041
	20'35 OCT. 28,1968
Note that the date is the date of the printout, not the date of the program revision.

018221,000002:                                                                                                  ## Copyright:   Public domain.
018222,000003:                                                                                                  ## Filename:    SYSTEM_TEST_STANDARD_LEAD_INS.agc
018223,000004:                                                                                                  ## Purpose:     Part of the source code for Colossus, build 249.
018224,000005:                                                                                                  ##              It is part of the source code for the Command Module's (CM)
018225,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 9.
018226,000007:                                                                                                  ## Assembler:   yaYUL
018227,000008:                                                                                                  ## Reference:   pp. 413-415.
018228,000009:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
018229,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo.
018230,000011:                                                                                                  ## Mod history: 08/07/04 RSB.   Adapted from similar Luminary 131 file.
018231,000012:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
018232,000013:                                                                                                  ##                              original harcopy, as opposed to the PDF page
018233,000014:                                                                                                  ##                              numbers in 1701.pdf.
018234,000015:                                                                                                  ##              2017-01-20 RSB  Cross-diff'd comment text (not whitespace)
018235,000016:                                                                                                  ##                              vs the already-proofed corresponding Colossus
018236,000017:                                                                                                  ##                              237 and Comanche 55 source-code files
018237,000018:                                                                                                  ##                              and corrected errors found.
018238,000019:                                                                                                  ##
018239,000020:                                                                                                  ## The contents of the "Colossus249" files, in general, are transcribed 
018240,000021:                                                                                                  ## from a scanned copy of the program listing.  Notations on this
018241,000022:                                                                                                  ## document read, in part:
018242,000023:                                                                                                  ##
018243,000024:                                                                                                  ##      Assemble revision 249 of AGC program Colossus by NASA
018244,000025:                                                                                                  ##      2021111-041.  October 28, 1968.  
018245,000026:                                                                                                  ##
018246,000027:                                                                                                  ##      This AGC program shall also be referred to as
018247,000028:                                                                                                  ##                              Colossus 1A
018248,000029:                                                                                                  ##
018249,000030:                                                                                                  ##      Prepared by
018250,000031:                                                                                                  ##                      Massachusetts Institute of Technology
018251,000032:                                                                                                  ##                      75 Cambridge Parkway
018252,000033:                                                                                                  ##                      Cambridge, Massachusetts
018253,000034:                                                                                                  ##      under NASA contract NAS 9-4065.
018254,000035:                                                                                                  ##
018255,000036:                                                                                                  ## Refer directly to the online document mentioned above for further information.
018256,000037:                                                                                                  ## Please report any errors (relative to the scanned pages) to info@sandroid.org.
018257,000038:                                                                                                  ##
018258,000039:                                                                                                  ## In some cases, where the source code for Luminary 131 overlaps that of 
018259,000040:                                                                                                  ## Colossus 249, this code is instead copied from the corresponding Luminary 131
018260,000041:                                                                                                  ## source file, and then is proofed to incorporate any changes.
018261,000042: 

Page 413

018263,000044: 22,3310  E5,1671                                  EBANK=   XSM                                   
018264,000045: 
018265,000046: 33,2000                                           BANK     33                                    
018266,000047: 04,2000                                           SETLOC   E/PROG                                
018267,000048: 04,2000                                           BANK                                           
018268,000049: 
018269,000050: 04,2557                                           COUNT*   $$/P07                                
018270,000051: 
018271,000052:                                                                                                  #  SPECIAL PROGRAMS TO EASE THE PANGS OF ERASABLE MEMORY PROGRAMS.
018272,000053: 
018273,000054:                                                                                                  #  E/BKCALL      FOR DOING BANKCALLS FROM AND RETURNING TO ERASABLE.
018274,000055: 
018275,000056:                                                                                                  #  THIS ROUTINE IS CALLABLE FROM ERASABLE OR FIXED.  LIKE BANKCALL, HOWEVER, SWITCHING BETWEEN S3 AND S4
018276,000057:                                                                                                  #  IS NOT POSSIBLE.
018277,000058: 
018278,000059:                                                                                                  #  THE CALLING SEQUENCE IS:
018279,000060: 
018280,000061:                                                                                                  #        TC      BANKCALL
018281,000062:                                                                                                  #        CADR    E/BKCALL
018282,000063:                                                                                                  #        CADR    ROUTINE         WHERE YOU WANT TO GO IN FIXED.
018283,000064:                                                                                                  #        RETURN HERE FROM DISPLAY TERMINATE, BAD STALL OR TC Q.
018284,000065:                                                                                                  #        RETURN HERE FROM DISPLAY PROCEED OR GOOD RETURN FROM STALL.
018285,000066:                                                                                                  #        RETURN HERE FROM DISPLAY ENTER OR RECYCLE.
018286,000067: 
018287,000068:                                                                                                  #  THIS ROUTINE REQUIRES TWO ERASABLES (EBUF2, +1) IN UNSWITCHED WHICH ARE UNSHARED BY INTERRUPTS AND
018288,000069:                                                                                                  #  OTHER EMEMORY PROGRAMS.
018289,000070: 
018290,000071:                                                                                                  #  A + L ARE PRESERVED THROUGH BANKCALL AND E/BKCALL.
018291,000072: 
018292,000073: 04,2557           52134        E/BKCALL           DXCH     BUF2                                  #  SAVE A,L AND GET DP RETURN.
018293,000074: 04,2560           52365                           DXCH     EBUF2                                 #  SAVE DP RETURN.
018294,000075: 04,2561           24364                           INCR     EBUF2                                 #  RETURN +1 BECAUSE DOUBLE CADR.
018295,000076: 04,2562           30006                           CA       BBANK                                 
018296,000077: 04,2563           74747                           MASK     LOW10                                 #  GET CURRENT EBANK.  (SBANK SOMEDAY)
018297,000078: 04,2564           26365                           ADS      EBUF2      +1                         #  FORM BBCON.  (WAS FBANK)
018298,000079: 04,2565           50364                           NDX      EBUF2                                 
018299,000080: 04,2566           27777                           CA       0          -1                         #  GET CADR OF ROUTINE.
018300,000081: 04,2567           04561                           TC       SWCALL                                #  GO TO ROUTINE, SETTING Q TO SWRETURN
018301,000082:                                                                                                  #  AND RESTORING A + L.
018302,000083: 04,2570           02574                           TC       +4                                    #  TX Q, V34, OR BAD STALL RETURN.
018303,000084: 04,2571           02573                           TC       +2                                    #  PROCEED OR GOOD STALL RETURN.
018304,000085: 04,2572           24364                           INCR     EBUF2                                 #  ENTER OR RECYCLE RETURN.
018305,000086: 04,2573           24364                           INCR     EBUF2                                 
018306,000087: 04,2574           52365        E/SWITCH           DXCH     EBUF2                                 
018307,000088: 04,2575           52006                           DTCB                                           
018308,000089: 

Page 414

018310,000091:                                                                                                  #  E/CALL        FOR CALLING A FIXED MEMORY INTERPRETIVE SUBROUTINE FROM ERASABLE AND RETURNING TO ERASABLE.
018311,000092: 
018312,000093:                                                                                                  #  THE CALLING SEQUENCE IS...
018313,000094: 
018314,000095:                                                                                                  #        RTB
018315,000096:                                                                                                  #                E/CALL
018316,000097:                                                                                                  #        CADR    ROUTINE                 THE INTERPRETIVE SUBROUTINE YOU WANT.
018317,000098:                                                                                                  #                                        RETURNS HERE IN INTERPRETIVE.
018318,000099: 
018319,000100: 04,2576           22164        E/CALL             LXCH     LOC                                   #  ADRES -1 OF CADR.
018320,000101: 04,2577           50001                           INDEX    L                                     
018321,000102: 04,2600           30001                           CA       L                                     #  CADR IN A.
018322,000103: 04,2601           24001                           INCR     L                                     
018323,000104: 04,2602           24001                           INCR     L                                     #  RETURN ADRES IN L.
018324,000105: 04,2603           52365                           DXCH     EBUF2                                 #  STORE CADR AND RETURN.
018325,000106: 04,2604           06006                           TC       INTPRET                               
018326,000107: 04,2605           77624                           CALL                                           
018327,000108: 04,2606           00364                                    EBUF2                                 #  INDIRECTLY EXECUTE ROUTINE.  IT MUST
018328,000109: 04,2607           77776                           EXIT                                           #  LEAVE VIA RVQ OR EQUIVALENT.
018329,000110: 04,2610           22365                           LXCH     EBUF2      +1                         #  PICK UP RETURN.
018330,000111: 04,2611           16010                           TCF      INTPRET    +2                         #  SET LOC AND RETURB TO CALLER
018331,000112: 

Page 415

018333,000114:                                                                                                  #  E/JOBWAK      FOR WAKING UP ERASABLE MEMORY JOBS.
018334,000115: 
018335,000116:                                                                                                  #  THIS ROUTINE MUST BE CALLED IN INTERRUPT OR WITH INTERRUPTS INHIBITED.
018336,000117: 
018337,000118:                                                                                                  #  THE CALLING SEQUENCE IS:
018338,000119: 
018339,000120:                                                                                                  #        INHINT
018340,000121:                                                                                                  #        .
018341,000122:                                                                                                  #        .
018342,000123:                                                                                                  #        CA      WAKEADR         ADDRESS OF SLEEPING JOB
018343,000124:                                                                                                  #        TC      IBNKCALL
018344,000125:                                                                                                  #        CADR    E/JOBWAK
018345,000126:                                                                                                  #        .                       RETURNS HERE
018346,000127:                                                                                                  #        .
018347,000128:                                                                                                  #        .
018348,000129:                                                                                                  #        RELINT                  IF YOU DID AN INHINT.
018349,000130: 
018350,000131: 33,2000                                           BANK     33                                    
018351,000132: 04,2000                                           SETLOC   E/PROG                                
018352,000133: 04,2000                                           BANK                                           
018353,000134: 
018354,000135: 04,2612                                           COUNT*   $$/P07                                
018355,000136: 
018356,000137: 04,2612           05074        E/JOBWAK           TC       JOBWAKE                               #  ARRIVE IWTH ADRES IN A.
018357,000138: 04,2613           44700                           CS       BIT11                                 
018358,000139: 04,2614           50064                           NDX      LOCCTR                                
018359,000140: 04,2615           26164                           ADS      LOC                                   #  KNOCK FIXED MEMORY BIT OUT OF ADRES.
018360,000141: 04,2616           00072                           TC       RUPTREG3                              #  RETURN
018361,000142: 
018362,000143:                                                                                                  #  THESE PROGRAMS ARE PROVIDED TO ALLOW OVERLAY OF BANKS 30 THRU 33 OF THE 205 VERSIONS OF SYSTEM TESTS AND
018363,000144:                                                                                                  #  PRELAUNCH ALIGN.  THE INTENT IS TO ALLOW THE STG AND HYBRID LABS TO RUN ALL THE TESTS WITH COLOSSUS.
018364,000145: 
018365,000146: 33,2000                                           BANK     33                                    
018366,000147: 33,2000                                           SETLOC   TESTLEAD                              
018367,000148: 33,2000                                           BANK                                           
018368,000149: 
018369,000150: 33,2000                                           COUNT    33/COMST                              
018370,000151: 
018371,000152: 33,2000  E5,1425                                  EBANK=   QPLACE                                
018372,000153: 
018373,000154: 33,2000           03425        COMPVER            TC       GCOMPVER                              #  MUST BE 33,2000.
018374,000155: 
018375,000156: 33,2001           03132        GTSCPSS1           TC       GTSCPSS                               #  MUST BE AT 33,2001
018376,000157: 
018377,000158: 33,2002           05243        REDO               TC       NEWMODEX                              #  DISPLAY MM 07.
018378,000159: 33,2003           00007                           MM       07         B-14                       #  FALL INTO IMUTEST
018379,000160: 

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