Source Code

These source-code files are part of a reconstructed copy of Comanche 67, the Apollo Guidance Computer (AGC) Command Module (CM) software for Apollo 12.

They have been adapted from sources files for Comanche 55, and updated via disassembly of binary dumps of original core rope memory modules, part numbers 2003972-1081, 2003972-1091, 2003972-1111, 2003972-1121, 2003972-1131, and 2003972-1141.

Since only binary dumps (rather than listings) of Comanche 67 are available as source material, all comments and labels are approximate. They have been taken from other AGC programs where possible, or, in some places, written from scratch to match what we believe would have been in the original listing.

017614,000002:                                                                                                  ## Copyright:   Public domain.
017615,000003:                                                                                                  ## Filename:    SYSTEM_TEST_STANDARD_LEAD_INS.agc
017616,000004:                                                                                                  ## Purpose:     A section of Comanche revision 067.
017617,000005:                                                                                                  ##              It is part of the reconstructed source code for the flight
017618,000006:                                                                                                  ##              software for the Command Module's (CM) Apollo Guidance Computer
017619,000007:                                                                                                  ##              (AGC) for Apollo 12. No original listings of this program are
017620,000008:                                                                                                  ##              available; instead, this file was created via dissassembly of
017621,000009:                                                                                                  ##              dumps of Comanche 067 core rope modules and comparison with
017622,000010:                                                                                                  ##              other AGC programs.
017623,000011:                                                                                                  ## Assembler:   yaYUL
017624,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
017625,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
017626,000014:                                                                                                  ## Mod history: 2023-08-16 MAS  Created from Comanche 055.
017627,000015: 
017628,000016: 22,3151  E5,1671                                  EBANK=   XSM                                   
017629,000017: 
017630,000018: 33,2000                                           BANK     33                                    
017631,000019: 13,2000                                           SETLOC   E/PROG1                               
017632,000020: 13,2000                                           BANK                                           
017633,000021: 
017634,000022: 13,2036                                           COUNT*   $$/P07                                
017635,000023: 
017636,000024:                                                                                                  #  SPECIAL PROGRAMS TO EASE THE PANGS OF ERASABLE MEMORY PROGRAMS.
017637,000025: 
017638,000026:                                                                                                  #  E/BKCALL      FOR DOING BANKCALLS FROM AND RETURNING TO ERASABLE.
017639,000027: 
017640,000028:                                                                                                  #  THIS ROUTINE IS CALLABLE FROM ERASABLE OR FIXED.  LIKE BANKCALL, HOWEVER, SWITCHING BETWEEN S3 AND S4
017641,000029:                                                                                                  #  IS NOT POSSIBLE.
017642,000030: 
017643,000031:                                                                                                  #  THE CALLING SEQUENCE IS:
017644,000032: 
017645,000033:                                                                                                  #        TC      BANKCALL
017646,000034:                                                                                                  #        CADR    E/BKCALL
017647,000035:                                                                                                  #        CADR    ROUTINE         WHERE YOU WANT TO GO IN FIXED.
017648,000036:                                                                                                  #        RETURN HERE FROM DISPLAY TERMINATE, BAD STALL OR TC Q.
017649,000037:                                                                                                  #        RETURN HERE FROM DISPLAY PROCEED OR GOOD RETURN FROM STALL.
017650,000038:                                                                                                  #        RETURN HERE FROM DISPLAY ENTER OR RECYCLE.
017651,000039: 
017652,000040:                                                                                                  #  THIS ROUTINE REQUIRES TWO ERASABLES (EBUF2, +1) IN UNSWITCHED WHICH ARE UNSHARED BY INTERRUPTS AND
017653,000041:                                                                                                  #  OTHER EMEMORY PROGRAMS.
017654,000042: 
017655,000043:                                                                                                  #  A + L ARE PRESERVED THROUGH BANKCALL AND E/BKCALL.
017656,000044: 
017657,000045: 13,2036           52134        E/BKCALL           DXCH     BUF2                                  #  SAVE A,L AND GET DP RETURN.
017658,000046: 13,2037           52364                           DXCH     EBUF2                                 #  SAVE DP RETURN.
017659,000047: 13,2040           24363                           INCR     EBUF2                                 #  RETURN +1 BECAUSE DOUBLE CADR.
017660,000048: 13,2041           30006                           CA       BBANK                                 
017661,000049: 13,2042           75070                           MASK     LOW10                                 #  GET CURRENT EBANK.  (SBANK SOMEDAY)
017662,000050: 13,2043           26364                           ADS      EBUF2      +1                         #  FORM BBCON.  (WAS FBANK)
017663,000051: 13,2044           50363                           NDX      EBUF2                                 
017664,000052: 13,2045           27777                           CA       0          -1                         #  GET CADR OF ROUTINE.
017665,000053: 13,2046           04702                           TC       SWCALL                                #  GO TO ROUTINE, SETTING Q TO SWRETURN
017666,000054:                                                                                                  #  AND RESTORING A + L.
017667,000055: 13,2047           02053                           TC       +4                                    #  TX Q, V34, OR BAD STALL RETURN.
017668,000056: 13,2050           02052                           TC       +2                                    #  PROCEED OR GOOD STALL RETURN.
017669,000057: 13,2051           24363                           INCR     EBUF2                                 #  ENTER OR RECYCLE RETURN.
017670,000058: 13,2052           24363                           INCR     EBUF2                                 
017671,000059: 13,2053           52364        E/SWITCH           DXCH     EBUF2                                 
017672,000060: 13,2054           52006                           DTCB                                           
017673,000061: 
017674,000062:                                                                                                  #  E/CALL        FOR CALLING A FIXED MEMORY INTERPRETIVE SUBROUTINE FROM ERASABLE AND RETURNING TO ERASABLE.
017675,000063: 
017676,000064:                                                                                                  #  THE CALLING SEQUENCE IS...
017677,000065: 
017678,000066:                                                                                                  #        RTB
017679,000067:                                                                                                  #                E/CALL
017680,000068:                                                                                                  #        CADR    ROUTINE                 THE INTERPRETIVE SUBROUTINE YOU WANT.
017681,000069:                                                                                                  #                                        RETURNS HERE IN INTERPRETIVE.
017682,000070: 
017683,000071: 13,2055           22164        E/CALL             LXCH     LOC                                   #  ADRES -1 OF CADR.
017684,000072: 13,2056           50001                           INDEX    L                                     
017685,000073: 13,2057           30001                           CA       L                                     #  CADR IN A.
017686,000074: 13,2060           24001                           INCR     L                                     
017687,000075: 13,2061           24001                           INCR     L                                     #  RETURN ADRES IN L.
017688,000076: 13,2062           52364                           DXCH     EBUF2                                 #  STORE CADR AND RETURN.
017689,000077: 13,2063           06006                           TC       INTPRET                               
017690,000078: 13,2064           77624                           CALL                                           
017691,000079: 13,2065           00363                                    EBUF2                                 #  INDIRECTLY EXECUTE ROUTINE.  IT MUST
017692,000080: 13,2066           77776                           EXIT                                           #  LEAVE VIA RVQ OR EQUIVALENT.
017693,000081: 13,2067           22364                           LXCH     EBUF2      +1                         #  PICK UP RETURN.
017694,000082: 13,2070           16010                           TCF      INTPRET    +2                         #  SET LOC AND RETURB TO CALLER
017695,000083: 
017696,000084:                                                                                                  #  E/JOBWAK      FOR WAKING UP ERASABLE MEMORY JOBS.
017697,000085: 
017698,000086:                                                                                                  #  THIS ROUTINE MUST BE CALLED IN INTERRUPT OR WITH INTERRUPTS INHIBITED.
017699,000087: 
017700,000088:                                                                                                  #  THE CALLING SEQUENCE IS:
017701,000089: 
017702,000090:                                                                                                  #        INHINT
017703,000091:                                                                                                  #          .
017704,000092:                                                                                                  #          .
017705,000093:                                                                                                  #        CA      WAKEADR         ADDRESS OF SLEEPING JOB
017706,000094:                                                                                                  #        TC      IBNKCALL
017707,000095:                                                                                                  #        CADR    E/JOBWAK
017708,000096:                                                                                                  #          .                     RETURNS HERE
017709,000097:                                                                                                  #          .
017710,000098:                                                                                                  #          .
017711,000099:                                                                                                  #        RELINT                  IF YOU DID AN INHINT.
017712,000100: 
017713,000101: 33,2000                                           BANK     33                                    
017714,000102: 04,2000                                           SETLOC   E/PROG                                
017715,000103: 04,2000                                           BANK                                           
017716,000104: 
017717,000105: 04,2606                                           COUNT*   $$/P07                                
017718,000106: 
017719,000107: 04,2606           05215        E/JOBWAK           TC       JOBWAKE                               #  ARRIVE IWTH ADRES IN A.
017720,000108: 04,2607           45021                           CS       BIT11                                 
017721,000109: 04,2610           50064                           NDX      LOCCTR                                
017722,000110: 04,2611           26164                           ADS      LOC                                   #  KNOCK FIXED MEMORY BIT OUT OF ADRES.
017723,000111: 04,2612           00072                           TC       RUPTREG3                              #  RETURN
017724,000112: 
017725,000113: 
017726,000114:                                                                                                  #  THESE PROGRAMS ARE PROVIDED TO ALLOW OVERLAY OF BANKS 30 THRU 33 OF THE 205 VERSIONS OF SYSTEM TESTS AND
017727,000115:                                                                                                  #  PRELAUNCH ALIGN.  THE INTENT IS TO ALLOW THE STG AND HYBRID LABS TO RUN ALL THE TESTS WITH COLOSSUS.
017728,000116: 
017729,000117: 
017730,000118: 33,2000                                           BANK     33                                    
017731,000119: 33,2000                                           SETLOC   TESTLEAD                              
017732,000120: 33,2000                                           BANK                                           
017733,000121: 
017734,000122: 33,2000                                           COUNT    33/COMST                              
017735,000123: 
017736,000124: 33,2000  E5,1425                                  EBANK=   QPLACE                                
017737,000125: 
017738,000126: 33,2000           03436        COMPVER            TC       GCOMPVER                              #  MUST BE 33,2000.
017739,000127: 
017740,000128: 33,2001           03131        GTSCPSS1           TC       GTSCPSS                               #  MUST BE AT 33,2001
017741,000129: 
017742,000130: 33,2002           05370        REDO               TC       NEWMODEX                              #  DISPLAY MM 07.
017743,000131: 33,2003           00007                           MM       07         B-14                       #  FALL INTO IMUTEST
017744,000132: 

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