Source Code
These source-code files are part of a reconstructed copy of Comanche 72/3 (AKA Manche72 revision 3),
the final, flown mission release of the Apollo Guidance Computer (AGC) Command Module (CM) software
for Apollo 13.
The starting point was the source code of Comanche 72 (itself previously reconstructed). Comanche 72 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 72 and 72/3. 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/3 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. |
042899,000002: ## Copyright: Public domain.
042900,000003: ## Filename: MYSUBS.agc
042901,000004: ## Purpose: A section of Manche72 revision 3.
042902,000005: ## It is part of the reconstructed source code for the final, flown
042903,000006: ## release of the software for the Command Module's (CM) Apollo
042904,000007: ## Guidance Computer (AGC) for Apollo 13. No original listings
042905,000008: ## of this program are available; instead, this file was recreated
042906,000009: ## from a reconstructed copy of Comanche 072. It has been adapted
042907,000010: ## such that the resulting bugger words exactly match those
042908,000011: ## specified for Manche72 revision 3 in NASA drawing 2021153G,
042909,000012: ## which gives relatively high confidence that the reconstruction
042910,000013: ## is correct.
042911,000014: ## Assembler: yaYUL
042912,000015: ## Contact: Ron Burkey <info@sandroid.org>.
042913,000016: ## Website: www.ibiblio.org/apollo/index.html
042914,000017: ## Mod history: 2024-05-19 MAS Created from Comanche 072.
042915,000018:
042916,000019: 20,3650 BANK 20
042917,000020: 21,2000 SETLOC MYSUBS
042918,000021: 21,2000 BANK
042919,000022:
042920,000023: 21,2054 E6,1510 EBANK= KMPAC
042921,000024: 21,2054 5110 SPCOS1 EQUALS SPCOS
042922,000025: 21,2054 5111 SPSIN1 EQUALS SPSIN
042923,000026: 21,2054 5110 SPCOS2 EQUALS SPCOS
042924,000027: 21,2054 5111 SPSIN2 EQUALS SPSIN
042925,000028:
042926,000029: 21,2054 COUNT 21/DAPMS
042927,000030:
042928,000031: # ONE AND ONE HALF PRECISION MULTIPLICATION ROUTINE
042929,000032:
042930,000033: 21,2054 55512 SMALLMP TS KMPTEMP # A(X+Y)
042931,000034: 21,2055 00006 EXTEND
042932,000035: 21,2056 71511 MP KMPAC +1
042933,000036: 21,2057 55511 TS KMPAC +1 # AY
042934,000037: 21,2060 35035 CAF ZERO
042935,000038: 21,2061 57510 XCH KMPAC
042936,000039: 21,2062 00006 EXTEND
042937,000040: 21,2063 71512 MP KMPTEMP # AX
042938,000041: 21,2064 21511 DAS KMPAC # AX+AY
042939,000042: 21,2065 00002 TC Q
042940,000043:
042941,000044: # SUBROUTINE FOR DOUBLE PRECISION ADDITIONS OF ANGLES
042942,000045: # A AND L CONTAIN A DP(1S) ANGLE SCALED BY 180 DEGS TO BE ADDED TO KMPAC.
042943,000046: # RESULT IS PLACED IN KMPAC. TIMING = 6 MCT (22 MCT ON OVERFLOW)
042944,000047:
042945,000048: 21,2066 21511 DPADD DAS KMPAC
042946,000049: 21,2067 00006 EXTEND
042947,000050: 21,2070 12105 BZF TSK +1 # NO OVERFLOW
042948,000051: 21,2071 11510 CCS KMPAC
042949,000052: 21,2072 12106 TCF DPADD+ # + OVERFLOW
042950,000053: 21,2073 12075 TCF +2
042951,000054: 21,2074 12110 TCF DPADD- # - OVERFLOW
042952,000055: 21,2075 11511 CCS KMPAC +1
042953,000056: 21,2076 12113 TCF DPADD2+ # UPPER = 0, LOWER +
042954,000057: 21,2077 12101 TCF +2
042955,000058: 21,2100 40000 COM # UPPER = 0, LOWER -
042956,000059: 21,2101 65013 AD POSMAX # LOWER = 0, A = 0
042957,000060: 21,2102 55511 TS KMPAC +1 # CAN NOT OVERFLOW
042958,000061: 21,2103 35013 CA POSMAX # UPPER WAS = 0
042959,000062: 21,2104 55510 TSK TS KMPAC
042960,000063: 21,2105 00002 TC Q
042961,000064:
042962,000065: 21,2106 65015 DPADD+ AD NEGMAX # KMPAC GREATER THAN 0
042963,000066: 21,2107 12104 TCF TSK
042964,000067:
042965,000068: 21,2110 40000 DPADD- COM
042966,000069: 21,2111 65013 AD POSMAX # KMPAC LESS THAN 0
042967,000070: 21,2112 12104 TCF TSK
042968,000071:
042969,000072: 21,2113 65015 DPADD2+ AD NEGMAX # CAN NOT OVERFLOW
042970,000073: 21,2114 55511 TS KMPAC +1
042971,000074: 21,2115 35015 CA NEGMAX # UPPER WAS = 0
042972,000075: 21,2116 12104 TCF TSK
End of include-file MYSUBS.agc. Parent file is MAIN.agc