Source Code

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

They have been adapted from sources files created from a listing of Comanche 55. These source files were updated to match binary dumps of a set of Comanche 67 rope modules. They were then further modified by applying known changes between Comanche 67 and Comanche 72. A binary dump of module B2 of Comanche 72, part number 2010802-021, was also used to validate changes made to banks 05-13. The resulting code assembles to have identical memory-bank checksums as those specified in NASA drawing 2021153G; this gives reasonably high confidence that the changes that have been made are correct. In places where ambiguity exists, this ambiguity is discussed in "## Reconstruction:" comments.

Since no contemporary listings of Comanche 72 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.

017778,000002:                                                                                                  ## Copyright:   Public domain.
017779,000003:                                                                                                  ## Filename:    SYSTEM_TEST_STANDARD_LEAD_INS.agc
017780,000004:                                                                                                  ## Purpose:     A section of Comanche revision 072.
017781,000005:                                                                                                  ##              It is part of the reconstructed source code for the first
017782,000006:                                                                                                  ##              release of the software for the Command Module's (CM) Apollo
017783,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 13. No original listings
017784,000008:                                                                                                  ##              of this program are available; instead, this file was recreated
017785,000009:                                                                                                  ##              from a printout of Comanche 055, binary dumps of a set of
017786,000010:                                                                                                  ##              Comanche 067 rope modules, and changelogs between Comanche 067
017787,000011:                                                                                                  ##              and 072. It has been adapted such that the resulting bugger words
017788,000012:                                                                                                  ##              exactly match those specified for Comanche 072 in NASA drawing
017789,000013:                                                                                                  ##              2021153G, which gives relatively high confidence that the
017790,000014:                                                                                                  ##              reconstruction is correct.
017791,000015:                                                                                                  ## Assembler:   yaYUL
017792,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
017793,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
017794,000018:                                                                                                  ## Mod history: 2024-05-13 MAS  Created from Comanche 067.
017795,000019: 
017796,000020: 22,3151  E5,1671                                  EBANK=   XSM                                   
017797,000021: 
017798,000022: 33,2000                                           BANK     33                                    
017799,000023: 13,2000                                           SETLOC   E/PROG1                               
017800,000024: 13,2000                                           BANK                                           
017801,000025: 
017802,000026: 13,2036                                           COUNT*   $$/P07                                
017803,000027: 
017804,000028:                                                                                                  #  SPECIAL PROGRAMS TO EASE THE PANGS OF ERASABLE MEMORY PROGRAMS.
017805,000029: 
017806,000030:                                                                                                  #  E/BKCALL      FOR DOING BANKCALLS FROM AND RETURNING TO ERASABLE.
017807,000031: 
017808,000032:                                                                                                  #  THIS ROUTINE IS CALLABLE FROM ERASABLE OR FIXED.  LIKE BANKCALL, HOWEVER, SWITCHING BETWEEN S3 AND S4
017809,000033:                                                                                                  #  IS NOT POSSIBLE.
017810,000034: 
017811,000035:                                                                                                  #  THE CALLING SEQUENCE IS:
017812,000036: 
017813,000037:                                                                                                  #        TC      BANKCALL
017814,000038:                                                                                                  #        CADR    E/BKCALL
017815,000039:                                                                                                  #        CADR    ROUTINE         WHERE YOU WANT TO GO IN FIXED.
017816,000040:                                                                                                  #        RETURN HERE FROM DISPLAY TERMINATE, BAD STALL OR TC Q.
017817,000041:                                                                                                  #        RETURN HERE FROM DISPLAY PROCEED OR GOOD RETURN FROM STALL.
017818,000042:                                                                                                  #        RETURN HERE FROM DISPLAY ENTER OR RECYCLE.
017819,000043: 
017820,000044:                                                                                                  #  THIS ROUTINE REQUIRES TWO ERASABLES (EBUF2, +1) IN UNSWITCHED WHICH ARE UNSHARED BY INTERRUPTS AND
017821,000045:                                                                                                  #  OTHER EMEMORY PROGRAMS.
017822,000046: 
017823,000047:                                                                                                  #  A + L ARE PRESERVED THROUGH BANKCALL AND E/BKCALL.
017824,000048: 
017825,000049: 13,2036           52134        E/BKCALL           DXCH     BUF2                                  #  SAVE A,L AND GET DP RETURN.
017826,000050: 13,2037           52364                           DXCH     EBUF2                                 #  SAVE DP RETURN.
017827,000051: 13,2040           24363                           INCR     EBUF2                                 #  RETURN +1 BECAUSE DOUBLE CADR.
017828,000052: 13,2041           30006                           CA       BBANK                                 
017829,000053: 13,2042           75070                           MASK     LOW10                                 #  GET CURRENT EBANK.  (SBANK SOMEDAY)
017830,000054: 13,2043           26364                           ADS      EBUF2      +1                         #  FORM BBCON.  (WAS FBANK)
017831,000055: 13,2044           50363                           NDX      EBUF2                                 
017832,000056: 13,2045           27777                           CA       0          -1                         #  GET CADR OF ROUTINE.
017833,000057: 13,2046           04702                           TC       SWCALL                                #  GO TO ROUTINE, SETTING Q TO SWRETURN
017834,000058:                                                                                                  #  AND RESTORING A + L.
017835,000059: 13,2047           02053                           TC       +4                                    #  TX Q, V34, OR BAD STALL RETURN.
017836,000060: 13,2050           02052                           TC       +2                                    #  PROCEED OR GOOD STALL RETURN.
017837,000061: 13,2051           24363                           INCR     EBUF2                                 #  ENTER OR RECYCLE RETURN.
017838,000062: 13,2052           24363                           INCR     EBUF2                                 
017839,000063: 13,2053           52364        E/SWITCH           DXCH     EBUF2                                 
017840,000064: 13,2054           52006                           DTCB                                           
017841,000065: 
017842,000066:                                                                                                  #  E/CALL        FOR CALLING A FIXED MEMORY INTERPRETIVE SUBROUTINE FROM ERASABLE AND RETURNING TO ERASABLE.
017843,000067: 
017844,000068:                                                                                                  #  THE CALLING SEQUENCE IS...
017845,000069: 
017846,000070:                                                                                                  #        RTB
017847,000071:                                                                                                  #                E/CALL
017848,000072:                                                                                                  #        CADR    ROUTINE                 THE INTERPRETIVE SUBROUTINE YOU WANT.
017849,000073:                                                                                                  #                                        RETURNS HERE IN INTERPRETIVE.
017850,000074: 
017851,000075: 13,2055           22164        E/CALL             LXCH     LOC                                   #  ADRES -1 OF CADR.
017852,000076: 13,2056           50001                           INDEX    L                                     
017853,000077: 13,2057           30001                           CA       L                                     #  CADR IN A.
017854,000078: 13,2060           24001                           INCR     L                                     
017855,000079: 13,2061           24001                           INCR     L                                     #  RETURN ADRES IN L.
017856,000080: 13,2062           52364                           DXCH     EBUF2                                 #  STORE CADR AND RETURN.
017857,000081: 13,2063           06006                           TC       INTPRET                               
017858,000082: 13,2064           77624                           CALL                                           
017859,000083: 13,2065           00363                                    EBUF2                                 #  INDIRECTLY EXECUTE ROUTINE.  IT MUST
017860,000084: 13,2066           77776                           EXIT                                           #  LEAVE VIA RVQ OR EQUIVALENT.
017861,000085: 13,2067           22364                           LXCH     EBUF2      +1                         #  PICK UP RETURN.
017862,000086: 13,2070           16010                           TCF      INTPRET    +2                         #  SET LOC AND RETURB TO CALLER
017863,000087: 
017864,000088:                                                                                                  #  E/JOBWAK      FOR WAKING UP ERASABLE MEMORY JOBS.
017865,000089: 
017866,000090:                                                                                                  #  THIS ROUTINE MUST BE CALLED IN INTERRUPT OR WITH INTERRUPTS INHIBITED.
017867,000091: 
017868,000092:                                                                                                  #  THE CALLING SEQUENCE IS:
017869,000093: 
017870,000094:                                                                                                  #        INHINT
017871,000095:                                                                                                  #          .
017872,000096:                                                                                                  #          .
017873,000097:                                                                                                  #        CA      WAKEADR         ADDRESS OF SLEEPING JOB
017874,000098:                                                                                                  #        TC      IBNKCALL
017875,000099:                                                                                                  #        CADR    E/JOBWAK
017876,000100:                                                                                                  #          .                     RETURNS HERE
017877,000101:                                                                                                  #          .
017878,000102:                                                                                                  #          .
017879,000103:                                                                                                  #        RELINT                  IF YOU DID AN INHINT.
017880,000104: 
017881,000105: 33,2000                                           BANK     33                                    
017882,000106: 04,2000                                           SETLOC   E/PROG                                
017883,000107: 04,2000                                           BANK                                           
017884,000108: 
017885,000109: 04,2606                                           COUNT*   $$/P07                                
017886,000110: 
017887,000111: 04,2606           05215        E/JOBWAK           TC       JOBWAKE                               #  ARRIVE IWTH ADRES IN A.
017888,000112: 04,2607           45021                           CS       BIT11                                 
017889,000113: 04,2610           50064                           NDX      LOCCTR                                
017890,000114: 04,2611           26164                           ADS      LOC                                   #  KNOCK FIXED MEMORY BIT OUT OF ADRES.
017891,000115: 04,2612           00072                           TC       RUPTREG3                              #  RETURN
017892,000116: 
017893,000117: 
017894,000118:                                                                                                  #  THESE PROGRAMS ARE PROVIDED TO ALLOW OVERLAY OF BANKS 30 THRU 33 OF THE 205 VERSIONS OF SYSTEM TESTS AND
017895,000119:                                                                                                  #  PRELAUNCH ALIGN.  THE INTENT IS TO ALLOW THE STG AND HYBRID LABS TO RUN ALL THE TESTS WITH COLOSSUS.
017896,000120: 
017897,000121: 
017898,000122: 33,2000                                           BANK     33                                    
017899,000123: 33,2000                                           SETLOC   TESTLEAD                              
017900,000124: 33,2000                                           BANK                                           
017901,000125: 
017902,000126: 33,2000                                           COUNT    33/COMST                              
017903,000127: 
017904,000128: 33,2000  E5,1425                                  EBANK=   QPLACE                                
017905,000129: 
017906,000130: 33,2000           03436        COMPVER            TC       GCOMPVER                              #  MUST BE 33,2000.
017907,000131: 
017908,000132: 33,2001           03131        GTSCPSS1           TC       GTSCPSS                               #  MUST BE AT 33,2001
017909,000133: 
017910,000134: 33,2002           05370        REDO               TC       NEWMODEX                              #  DISPLAY MM 07.
017911,000135: 33,2003           00007                           MM       07         B-14                       #  FALL INTO IMUTEST
017912,000136: 

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