Source Code

These source-code files are part of a reconstructed copy of Comanche 45, the second release, though not the final mission release, of the Apollo 10 Command Module (CM) Apollo Guidance Computer (AGC) software. Comanche 45 was preceded by Comanche 44 and followed by Comanche 45/2 (the flown release). The reconstruction is believed to be exactly accurate, but in the absence of an actual Apollo-era listing of Comanche 45, some explanation of the reconstruction process is needed to insure confidence in that accuracy.

The starting point was the source code of Comanche 44 (itself previously accurately reconstructed). Comanche 44 source code was then modified by incorporating changes known from contemporary documentation to have been made between revisions 44 and 45. The now-reconstructed Comanche 45 source code was verified by assembling it and checking that the assembled code had the expected known-correct memory-bank checksums. Note that page numbers in the reconstructed code tend to match those in the Comanche 55, the most-similar revision of Comanche for which we have access to an actual non-reconstructed hardcopy; the source code would likely have different page numbers in a contemporary Comanche 45 listing.

Annotations that were not present in the contemporary source code have been added to the reconstructed code to justify each change relative to Comanche 44. Here's a guide to the Apollo documentation referenced in those annotations:
There is also a detailed commentary about the reconstruction process.

Comments expected to have been present in the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". Report any errors noted by creating an issue report at the Virtual AGC Project's GitHub repository.

021727,000002:                                                                                                  ## Copyright:   Public domain.
021728,000003:                                                                                                  ## Filename:    P76.agc
021729,000004:                                                                                                  ## Purpose:     A section of Comanche revision 045.
021730,000005:                                                                                                  ##              It is part of the reconstructed source code for the
021731,000006:                                                                                                  ##              second release of the flight software for the Command
021732,000007:                                                                                                  ##              Module's (CM) Apollo Guidance Computer (AGC) for Apollo 10.
021733,000008:                                                                                                  ##              The code has been recreated from a copy of Comanche 055. It
021734,000009:                                                                                                  ##              has been adapted such that the resulting bugger words
021735,000010:                                                                                                  ##              exactly match those specified for Comanche 45 in NASA drawing
021736,000011:                                                                                                  ##              2021153D, which gives relatively high confidence that the
021737,000012:                                                                                                  ##              reconstruction is correct.
021738,000013:                                                                                                  ## Assembler:   yaYUL
021739,000014:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
021740,000015:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
021741,000016:                                                                                                  ## Mod history: 2020-12-06 MAS  Created from Comanche 44.
021742,000017: 

Page 511

021744,000019:                                                                                                  #  1)    PROGRAM NAME - TARGET DELTA V PROGRAM (P76).
021745,000020:                                                                                                  #  2)    FUNCTIONAL DESCRIPTION - UPON ENTRY BY ASTRONAUT ACTION, P76 FLASHES DSKY REQUESTS TO THE ASTRONAUT
021746,000021:                                                                                                  #        TO PROVIDE VIA DSKY (1) THE DELTA V TO BE APPLIED TO THE OTHER VEHICLE STATE VECTOR AND (2) THE
021747,000022:                                                                                                  #        TIME (TIG) AT WHICH THE OTHER VEHICLE VELOCITY WAS CHANGED BY EXECUTION OF A THRUSTING MANEUVER. THE
021748,000023:                                                                                                  #        OTHER VEHICLE STATE VECTOR IS INTEGRATED TO TIG AND UPDATED BY THE ADDITION OF DELTA V (DELTA V HAVING
021749,000024:                                                                                                  #        BEEN TRANSFORMED FROM LV TO REF COSYS).  USING INTEGRVS, THE PROGRAM THEN INTEGRATES THE OTHER
021750,000025:                                                                                                  #        VEHICLE STATE VECTOR TO THE STATE VECTOR OF THIS VEHICLE, THUS INSURING THAT THE W-MATRIX AND BOTH VEHICLE
021751,000026:                                                                                                  #        STATES CORRESPOND TO THE SAME TIME.
021752,000027:                                                                                                  #  3)    ERASABLE INITIALIZATION REQUIRED - NONE.
021753,000028:                                                                                                  #  4)    CALLING SEQUENCES AND EXIT MODES - CALLED BY ASTRONAUT REQUEST THRU DSKY V 37 E 76E.
021754,000029:                                                                                                  #        EXITS BY TCF ENDOFJOB.
021755,000030:                                                                                                  #  5)    OUTPUT - OTHER VEHICLE STATE VECTOR INTEGRATED TO TIG AND INCREMENTED BY DELTA V IN REF COSYS.
021756,000031:                                                                                                  #        THE PUSHLIST CONTAINS THE MATRIX BY WHICH THE INPUT DELTA V MUST BE POST-MULTIPLIED TO CONVERT FROM LV
021757,000032:                                                                                                  #        TO REF COSYS.
021758,000033:                                                                                                  #  6)    DEBRIS - OTHER VEHICLE STATE VECTOR.
021759,000034:                                                                                                  #  7)    SUBROUTINES CALLED - BANKCALL, GOXDSPF, CSMPREC (OR LEMPREC), ATOPCSM (OR ATOPLEM), INTSTALL, INTWAKE, PHASCHNG
021760,000035:                                                                                                  #        INTPRET, INTEGRVS, AND MINIRECT.
021761,000036:                                                                                                  #  8)    FLAG USE - MOONFLAG, CMOONFLAG, INTYPFLG, RASFLAG, AND MARKCTR.
021762,000037: 
021763,000038: 30,2000                                           BANK     30                                    
021764,000039: 13,2000                                           SETLOC   P76LOC                                
021765,000040: 13,2000                                           BANK                                           
021766,000041: 
021767,000042: 13,2071                                           COUNT*   $$/P76                                
021768,000043: 
021769,000044: 13,2071  E7,1412                                  EBANK=   TIG                                   
021770,000045: 
021771,000046: 13,2071           05546        P76                TC       UPFLAG                                
021772,000047: 13,2072           00031                           ADRES    TRACKFLG                              
021773,000048: 
021774,000049: 13,2073           32220                           CAF      V06N84                                #  FLASH LAST DELTA V,
021775,000050: 13,2074           04662                           TC       BANKCALL                              #  AND WAIT FOR KEYBOARD ACTION.
021776,000051: 13,2075           20720                           CADR     GOFLASH                               
021777,000052: 13,2076           12212                           TCF      ENDP76                                
021778,000053: 13,2077           02101                           TC       +2                                    #  PROCEED
021779,000054: 13,2100           02073                           TC       -5                                    #  STORE DATA AND REPEAT FLASHING
021780,000055: 13,2101           32221                           CAF      V06N84     +1                         #  FLASH VERB 06 NOUN 33, DISPLAY LAST TIG,
021781,000056: 13,2102           04662                           TC       BANKCALL                              #  AND WAIT FOR KEYBOARD ACTION.
021782,000057: 13,2103           20720                           CADR     GOFLASH                               
021783,000058: 13,2104           12212                           TCF      ENDP76                                
021784,000059: 13,2105           02107                           TC       +2                                    
021785,000060: 13,2106           02101                           TC       -5                                    
021786,000061: 13,2107           06006                           TC       INTPRET                               #  RETURN TO INTERPRETIVE CODE
021787,000062: 13,2110           77745                           DLOAD                                          #  SET D(MPAC)=TIG IN CSEC B28
021788,000063: 13,2111           03413                                    TIG                                   
021789,000064: 13,2112           34041                           STCALL   TDEC1                                 #  SET TDEC1=TIG FOR ORBITAL INTEGRATION
021790,000065: 13,2113           27105                                    OTHPREC                               
021791,000066: 13,2114           53575        COMPMAT            VLOAD    UNIT                                  
021792,000067: 13,2115           00001                                    RATT                                  

Page 512

021794,000069: 13,2116           77676                           VCOMP                                          #  U(-R)
021795,000070: 13,2117           00031                           STORE    24D                                   #  U(-R) TO 24D
021796,000071: 13,2120           53435                           VXV      UNIT                                  #  U(-R) X V = U(V X R)
021797,000072: 13,2121           00007                                    VATT                                  
021798,000073: 13,2122           00023                           STORE    18D                                   
021799,000074: 13,2123           53435                           VXV      UNIT                                  #  U(V X R) X U(-R) = U((R X V) X R)
021800,000075: 13,2124           00031                                    24D                                   
021801,000076: 13,2125           24015                           STOVL    12D                                   
021802,000077: 13,2126           03540                                    DELVOV                                
021803,000078: 13,2127           76505                           VXM      VSL1                                  #  V(MPAC)=DELTA V IN REFCOSYS
021804,000079: 13,2130           00015                                    12D                                   
021805,000080: 13,2131           77655                           VAD                                            
021806,000081: 13,2132           00007                                    VATT                                  
021807,000082: 13,2133           00007                           STORE    6                                     #  V(PD6)=VATT + DELTA V
021808,000083: 13,2134           77624                           CALL                                           #  PREVENT WOULD-BE USER OF ORBITAL
021809,000084: 13,2135           27442                                    INTSTALL                              #  INTEG FROM INTERFERING WITH UPDATING
021810,000085: 13,2136           77624                           CALL                                           
021811,000086: 13,2137           26222                                    P76SUB1                               
021812,000087: 13,2140           53775                           VLOAD    VSR*                                  
021813,000088: 13,2141           00007                                    6                                     
021814,000089: 13,2142           57176                                    0,2                                   
021815,000090: 13,2143           25543                           STOVL    VCV                                   
021816,000091: 13,2144           00001                                    RATT                                  
021817,000092: 13,2145           77657                           VSR*                                           
021818,000093: 13,2146           57176                                    0,2                                   
021819,000094: 13,2147           15535                           STODL    RCV                                   
021820,000095: 13,2150           03413                                    TIG                                   
021821,000096: 13,2151           01517                           STORE    TET                                   
021822,000097: 13,2152           71214                           CLEAR    DLOAD                                 
021823,000098: 13,2153           01673                                    INTYPFLG                              
021824,000099: 13,2154           01571                                    TETTHIS                               
021825,000100: 13,2155           34041        INTOTHIS           STCALL   TDEC1                                 
021826,000101: 13,2156           27135                                    INTEGRVS                              
021827,000102: 13,2157           77624                           CALL                                           
021828,000103: 13,2160           27442                                    INTSTALL                              
021829,000104: 13,2161           77624                           CALL                                           
021830,000105: 13,2162           26222                                    P76SUB1                               #  SET/CLEAR MOONFLAG
021831,000106: 13,2163           77775                           VLOAD                                          
021832,000107: 13,2164           00017                                    RATT1                                 
021833,000108: 13,2165           01503                           STORE    RRECT                                 
021834,000109: 13,2166           15535                           STODL    RCV                                   
021835,000110: 13,2167           00015                                    TAT                                   
021836,000111: 13,2170           25517                           STOVL    TET                                   
021837,000112: 13,2171           00025                                    VATT1                                 
021838,000113: 13,2172           77624                           CALL                                           
021839,000114: 13,2173           23435                                    MINIRECT                              
021840,000115: 13,2174           77776                           EXIT                                           
021841,000116: 13,2175           05412                           TC       PHASCHNG                              
021842,000117: 13,2176           04024                           OCT      04024                                 

Page 513

021844,000119: 13,2177           05546                           TC       UPFLAG                                
021845,000120: 13,2200           00236                           ADRES    REINTFLG                              
021846,000121: 
021847,000122: 13,2201           06006                           TC       INTPRET                               
021848,000123: 13,2202           77624                           CALL                                           
021849,000124: 13,2203           26760                                    ATOPOTH                               
021850,000125: 13,2204           77531                           SSP      EXIT                                  
021851,000126: 13,2205           00053                                    QPRET                                 
021852,000127: 13,2206           26211                                    OUT                                   
021853,000128: 13,2207           04662                           TC       BANKCALL                              #  PERMIT USE OF ORBITAL INTEGRATION
021854,000129: 13,2210           27477                           CADR     INTWAKE1                              
021855,000130: 13,2211           77776        OUT                EXIT                                           
021856,000131: 13,2212           35021        ENDP76             CAF      ZERO                                  
021857,000132: 13,2213           55126                           TS       MARKCTR                               #  CLEAR RR TRACKING MARK COUNTER
021858,000133: 13,2214           55125                           TS       VHFCNT                                
021859,000134: 
021860,000135: 13,2215           37716                           CAF      NEGONE                                
021861,000136: 13,2216           55734                           TS       MRKBUF2                               #  INVALIDATE MARK BUFFER
021862,000137: 
021863,000138: 13,2217           14106                           TCF      GOTOPOOH                              
021864,000139: 
021865,000140: 13,2220           01524        V06N84             NV       0684                                  
021866,000141: 13,2221           01441                           NV       0633                                  
021867,000142: 13,2222           67214        P76SUB1            CLEAR    SLOAD                                 
021868,000143: 13,2223           00263                                    MOONFLAG                              
021869,000144: 13,2224           00050                                    X2                                    
021870,000145: 13,2225           43030                           BHIZ     SET                                   #  X2=0...CLEAR MOONFLAG
021871,000146: 13,2226           26230                                    +2                                    #    =2.....SET MOONFLAG
021872,000147: 13,2227           00063                                    MOONFLAG                              
021873,000148: 13,2230           77616                           RVQ                                            
021874,000149: 

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