Source Code
These source-code files are part of a reconstructed copy of Artemis 071, the
first release of the Apollo 15 through 17 Command Module (CM) Apollo Guidance
Computer (AGC) software.
The reconstruction began with source code of Artemis 072 previously transcribed from a digitized copy of that program. The code was then updated by undoing changes between the two versions. The reconstruction was verified by matching memory-bank checksums to those listed in drawing 2021154-. Note that page numbers in the reconstructed code match those on the Artemis 072 printout, although the changed code would likely have changed page numbers for a real Artemis 071 listing. Comments from 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. |
023086,000002: ## Copyright: Public domain.
023087,000003: ## Filename: P15.agc
023088,000004: ## Purpose: A section of Artemis revision 071.
023089,000005: ## It is part of the reconstructed source code for the first
023090,000006: ## release of the flight software for the Command Module's
023091,000007: ## (CM) Apollo Guidance Computer (AGC) for Apollo 15 through
023092,000008: ## 17. The code has been recreated from a copy of Artemis 072.
023093,000009: ## It has been adapted such that the resulting bugger words
023094,000010: ## exactly match those specified for Artemis 071 in NASA
023095,000011: ## drawing 2021154-, which gives relatively high confidence
023096,000012: ## that the reconstruction is correct.
023097,000013: ## Reference: 527
023098,000014: ## Assembler: yaYUL
023099,000015: ## Contact: Ron Burkey <info@sandroid.org>.
023100,000016: ## Website: www.ibiblio.org/apollo/index.html
023101,000017: ## Mod history: 2019-08-14 MAS Created from Artemis 072.
023102,000018: ## 2019-08-15 MAS Undid changes between Artemis 071 and 072
023103,000019: ## in the KILLSIVB logic.
023104,000020:
Page 527 |
023106,000022:
023107,000023: # P15 TLI INITIATE/CUTOFF
023108,000024: #
023109,000025: # DISPLAYS N33 : TIME OF SIVB INJECTION SEQUENCE START (TB6)
023110,000026: # ESTABLISHES T6SET TO BE EXECUTED AT TB6 TIME
023111,000027: # SETS TLITIG = TB6 + 9:37.6
023112,000028: # DISPLAYS N14 : INERTIAL VELOCITY MAGNITUDE AT TLI C/O
023113,000029: # DISPLAYS N95 : TFI - TIME FROM TLITIG (DECREASING)
023114,000030: # VG - VELOCITY-TO-BE-GAINED
023115,000031: # V - INERTIAL VELOCITY MAGNITUDE
023116,000032: # T6SET : SETS THE SIVB INJECTION SEQUENCE START BIT,
023117,000033: # ESTABLISHES T6RESET (DT = 10 SECS), AND
023118,000034: # TURNS ON THE UPLINK ACTIVITY LIGHT
023119,000035: # T6RESET : CLEARS THE SIVB I.S.S. BIT AND
023120,000036: # TURNS OFF THE UPLINK ACTIVITY LIGHT
023121,000037: # P40S/SV : CALLS MIDTOAV1 TO INTEGRATE THE CSM
023122,000038: # STATE VECTOR TO TLITLIG - 100 AND
023123,000039: # ESTABLISHES TIGBLNK AT TLITIG - 105
023124,000040: # TIGBLNK : BLANKS THE DSKY FOR 5 SECS AND
023125,000041: # ESTABLISHES TIGAVEG FOR TLITIG - 100
023126,000042: # TIGAVEG : STARTS READACCS AND REDISPLAYS
023127,000043: # N95 (VG AND V NOW DYNAMIC)
023128,000044: # SIVBCOMP : UPDATES VG AND V AND
023129,000045: # AFTER TLITIG + 10 CALCULATES TGO AND
023130,000046: # CHANGES THE N95 R1 DISPLAY TO TFC
023131,000047: # WHEN TGO < 4 SECS, SIVBCOMP ESTABLISHES SIVBOFF (DT = TGO)
023132,000048: # SIVBOFF : SHUTS DOWN THE SIVB AND CALLS POSTTLI
023133,000049: # POSTTLI : FLASHES N95 TO INDICATE TLI IS COMPLETED
023134,000050: # P15 EXITS VIA GOTOPOOH
023135,000051: 33,2000 SETLOC P15LOC1
023136,000052: 33,2000 BANK
023137,000053: 33,3455 COUNT* $$/P15
023138,000054: 33,3455 E7,1412 EBANK= TIG
023139,000055: 33,3455 35026 P15JOB CAF V06N33 # DISPLAY TB6 TIME
023140,000056: 33,3456 05535 TC VNFLASH
023141,000057: 33,3457 06006 TC INTPRET
023142,000058: 33,3460 43345 DLOAD DAD
023143,000059: 33,3461 03413 TIG
023144,000060: 33,3462 27533 TLIDT
023145,000061: 33,3463 03464 STORE TLITMP
023146,000062: 33,3464 44234 RTB BDSU
023147,000063: 33,3465 51751 LOADTIME
023148,000064: 33,3466 03413 TIG
023149,000065: 33,3467 03673 STORE P40TMP # TIG-TIME2
023150,000066: 33,3470 77776 EXIT # .TO P40TMP
023151,000067: 33,3471 52155 DXCH MPAC # ..AND A,L
023152,000068: 33,3472 05332 TC LONGCALL
023153,000069: 33,3473 E7,1672 EBANK= P40TMP
023154,000070: 33,3473 02311 40067 2CADR T6SET
023155,000071: 33,3475 05362 TC 2PHSCHNG
Page 528 |
023157,000073: 33,3476 00153 OCT 00153 # A,3.15=T6SET IN P40TMP CSEC
023158,000074: 33,3477 24024 OCT 24024 # C,JOB BELOW,LONGBASE FOR A ABOVE
023159,000075: 33,3500 01,2077 3P15SPT1 = 3.15SPOT
023160,000076: 33,3500 00006 EXTEND
023161,000077: 33,3501 31464 DCA TLITMP
023162,000078: 33,3502 53413 DXCH TIG # TLITIG = TB6 + 9:37.6
023163,000079: 33,3503 33536 DISP14 CAF V06N14 # DISPLAY V AT TLI C/O
023164,000080: 33,3504 05535 TC VNFLASH
023165,000081: 33,3505 06006 TC INTPRET
023166,000082: 33,3506 51575 VLOAD ABVAL
023167,000083: 33,3507 01563 VRECTCSM # M/CS B+7
023168,000084: 33,3510 03723 STORE VNOW
023169,000085: 33,3511 43021 BDSU SET
023170,000086: 33,3512 02356 VC/O # B+7
023171,000087: 33,3513 03464 TIMRFLAG # ENABLE CLOKTASK
023172,000088: 33,3514 17725 STODL VGTLI # VGTLI = VC/O - |VRECTCSM| B+7
023173,000089: 33,3515 27535 S4BCOMP
023174,000090: 33,3516 01062 STORE AVEGEXIT # SET AVERAGEG EXIT TO SIVBCOMP
023175,000091: 33,3517 77776 EXIT
023176,000092: 33,3520 33537 CAF V06N95
023177,000093: 33,3521 54777 TS NVWORD1 # ENABLE CLOCKJOB
023178,000094: 33,3522 34770 CLOKNOW CAF ONE
023179,000095: 33,3523 05233 TC WAITLIST
023180,000096: 33,3524 E7,1412 EBANK= TIG
023181,000097: 33,3524 03225 50067 2CADR CLOKTASK
023182,000098:
023183,000099: 33,3526 05362 TC 2PHSCHNG
023184,000100: 33,3527 40036 OCT 40036 # 6.3SPOT FOR CLOKTASK
023185,000101: 33,3530 00004 OCT 00004 # KILL GROUP 4
023186,000102: 33,3531 01,2325 6P3SPT4 = 6.3SPOT
023187,000103: 33,3531 15205 TCF ENDOFJOB
023188,000104:
023189,000105: 33,3532 00003 20640 TLIDT 2DEC 57760 B-28 # 9 MIN 37.6 SEC (TB6 + TLIDT = TLITIG)
023190,000106:
023191,000107: 33,3534 E7,1412 EBANK= TIG
023192,000108: 33,3534 03540 66067 S4BCOMP 2CADR SIVBCOMP
023193,000109:
023194,000110: 33,3536 01416 V06N14 VN 0614
023195,000111: 33,3537 01537 V06N95 VN 0695
023196,000112:
023197,000113:
023198,000114: 20,2000 SETLOC P15LOC
023199,000115: 20,2000 BANK
023200,000116: 20,2311 E7,1412 EBANK= TIG
023201,000117: 20,2311 COUNT* $$/P15
023202,000118: 20,2311 00006 T6SET EXTEND
023203,000119: 20,2312 30025 DCA TIME2
023204,000120: 20,2313 53022 DXCH TEVENT
023205,000121: 20,2314 32330 CAF 10SEC # T6RESET IN 10 SEC.
023206,000122: 20,2315 05223 TC TWIDDLE
Page 529 |
023208,000124: 20,2316 02331 ADRES T6RESET
023209,000125: 20,2317 05402 TC PHASCHNG
023210,000126: 20,2320 40023 OCT 40023 # A,3.2=T6CHNSET IMMED.,
023211,000127: # T6RESET IN 10 SEC,TBASE NOW
023212,000128:
023213,000129: 20,2321 01,2052 3P2SPT1 = 3.2SPOT
023214,000130: 20,2321 34754 T6CHNSET CAF BIT13
023215,000131: 20,2322 00006 EXTEND # SIVB INJECTION
023216,000132: 20,2323 05012 WOR CHAN12 # SEQUENCE START
023217,000133: 20,2324 34766 CAF BIT3
023218,000134: 20,2325 00006 EXTEND
023219,000135: 20,2326 05011 WOR DSALMOUT # UPLINK ACTIV. ON
023220,000136: 20,2327 05314 TC TASKOVER
023221,000137:
023222,000138: 20,2330 01750 10SEC DEC 1000 B-14
023223,000139:
023224,000140: 20,2331 44754 T6RESET CS BIT13 # PROTECTED BY GROUP 3
023225,000141: 20,2332 00006 EXTEND # CLEAR SIVB ISS
023226,000142: 20,2333 03012 WAND CHAN12
023227,000143: 20,2334 44766 CS BIT3 # TURN OFF UPLINK ACTIVITY
023228,000144: 20,2335 00006 EXTEND
023229,000145: 20,2336 03011 WAND DSALMOUT
023230,000146: 20,2337 05362 TC 2PHSCHNG
023231,000147: 20,2340 00003 OCT 00003 # KILL GROUP 3
023232,000148: 20,2341 05014 OCT 05014
023233,000149: 20,2342 77777 DEC -0 B-14 # GROUP 4 CONTINUES BELOW
023234,000150: 20,2343 00006 P15INTEG EXTEND
023235,000151: 20,2344 32354 DCA 100SEC
023236,000152: 20,2345 53460 DXCH AVEGDT # START AVERAGEG AT TIG - 100.00
023237,000153: 20,2346 34664 CAF PRIO12
023238,000154: 20,2347 05135 TC FINDVAC
023239,000155: 20,2350 E7,1412 EBANK= TIG
023240,000156: 20,2350 02523 50067 2CADR P40S/SV # COMMON CODE IN P40
023241,000157: 20,2352 15314 TCF TASKOVER
023242,000158:
023243,000159: 20,2353 00000 23420 100SEC 2DEC 10000 B-28
023244,000160:
Page 530 |
023246,000162:
023247,000163: # SIVB SHUTDOWN COMPUTATIONS
023248,000164:
023249,000165: # CALLED VIA AVEGEXIT EVERY 2 SECS STARTING AT TLITIG - 100
023250,000166: # VG AND V (N95) ARE ALWAYS UPDATED
023251,000167: # TGO CALCULATONS FOR TLI SHUTDOWN AND TTOGO (N95)
023252,000168: # ARE ENABLED (STEERSW = 1) AT TLITIG + 10
023253,000169: 33,2000 SETLOC P15LOC1
023254,000170: 33,2000 BANK
023255,000171: 33,3540 E7,1412 EBANK= TIG
023256,000172: 33,3540 COUNT* $$/P15
023257,000173: 33,3540 06006 SIVBCOMP TC INTPRET
023258,000174: 33,3541 45345 DLOAD DSU
023259,000175: 33,3542 03661 TTOGO
023260,000176: 33,3543 27666 TENSEC # TFI > +10 ? (TFC CAN NEVER EXCEED +2)
023261,000177: 33,3544 43040 BMN SET # YES, SET STERSW TO ENABLE TGO CALC
023262,000178: 33,3545 67547 +2 # NO
023263,000179: 33,3546 01064 STEERSW
023264,000180: 33,3547 77624 CALL
023265,000181: 33,3550 70537 S11.1 # VMAG, HDOT, AND H FOR N62
023266,000182: 33,3551 44345 DLOAD BDSU
023267,000183: 33,3552 03723 VNOW # VMAG M/CS B+7 FOR N95
023268,000184: 33,3553 02356 VC/O # VMAG(C/O) M/CS B+7
023269,000185: 33,3554 17725 STODL VGTLI # VG = VC/O - VNOW FOR N95
023270,000186: 33,3555 03723 VNOW
023271,000187: 33,3556 45214 BOFF DSU
023272,000188: 33,3557 01344 STEERSW
023273,000189: 33,3560 67605 SETVPAST # STEERSW = 0, EXIT
023274,000190: 33,3561 03462 VPAST # MPAC = VNOW - VPAST (DV FOR LAST 2 SECS)
023275,000191: 33,3562 41440 BMN PUSH # 00D = DV FOR LAST 2 SECS
023276,000192: 33,3563 67605 SETVPAST # DV NEGATIVE, EXIT
023277,000193: 33,3564 54345 DLOAD SR
023278,000194: 33,3565 03725 VGTLI # B+7
023279,000195: 33,3566 20612 09D # SR9 NOW B+16
023280,000196: 33,3567 77671 DDV # B+16 / B+7 NOW B+9
023281,000197: 33,3570 41200 BOV DMP
023282,000198: 33,3571 67605 SETVPAST # OVERFLOW, EXIT
023283,000199: 33,3572 27670 200B+19 # B+9 X B+19 NOW B+28
023284,000200: 33,3573 67206 PUSH SLOAD # 00D = TGO WITHOUT TAILOFF EFFECTS
023285,000201: 33,3574 02355 DTF # TLI TAILOFF CONSTANT B+14
023286,000202: 33,3575 44261 SR BDSU # COMPENSATE FOR TAILOFF
023287,000203: 33,3576 20617 14D # B+28
023288,000204: 33,3577 43206 PUSH DAD # 00D = COMPENSATED TGO
023289,000205: 33,3600 01044 PIPTIME
023290,000206: 33,3601 17413 STODL TIG # FOR CLOKTASK (N95)
023291,000207: 33,3602 50025 DSU BMN # TGO FROM 00D
023292,000208: 33,3603 27664 4SEC # TGO < 4 SECS ?
023293,000209: 33,3604 67611 KILLSIVB # YES : SET UP SIVB SHUTDOWN
023294,000210: 33,3605 77745 SETVPAST DLOAD
023295,000211: 33,3606 03723 VNOW
023296,000212: 33,3607 37462 STCALL VPAST # VPAST = VNOW
Page 531 |
023298,000214: 33,3610 51603 SERVXT1 # ** NO RETURN ** SAME AS GOTO SERVXT1
023299,000215:
023300,000216:
023301,000217: 33,3611 E7,1412 EBANK= TIG
023302,000218: 33,3611 77776 KILLSIVB EXIT
023303,000219: 33,3612 00004 INHINT
023304,000220: 33,3613 00006 EXTEND
The following code has a bug with sign agreement that was fixed in Artemis 072. It is possible for the (TIG - TIME2) calculation to result in a mixed-sign result, in which case the following logic will behave incorrectly. In Artemis 072, the result of the calculation was stored in MPAC instead of AVEGDT. After the DAS, sign agreement was then forced via a "TCR DPAGREE". Finally, because the result was now in MPAC instead of AVEGDT where it needed to be, the TCF +3 was changed to TCF +2 to ensure the number made it safely into AVEGDT +1. |
023312,000228: 33,3614 31413 DCA TIG
023313,000229: 33,3615 53460 DXCH AVEGDT
023314,000230: 33,3616 00006 EXTEND
023315,000231: 33,3617 40025 DCS TIME2
023316,000232: 33,3620 21460 DAS AVEGDT
023317,000233: 33,3621 31460 CAE AVEGDT +1 # DT TO C/O = TIG - TIME2 (< 4 SECS TO GO)
023318,000234: # PIPTIME + TGO - TIME2
023319,000235: 33,3622 00006 EXTEND # DT <= 0 ?
023320,000236: 33,3623 63625 BZMF +2 # YES
023321,000237: 33,3624 13627 TCF +3 # NO
023322,000238: 33,3625 34770 CAF ONE
023323,000239: 33,3626 55460 TS AVEGDT +1
023324,000240: 33,3627 05223 TC TWIDDLE
023325,000241: 33,3630 03636 ADRES SIVBOFF
023326,000242: 33,3631 05362 TC 2PHSCHNG
023327,000243: 33,3632 40614 OCT 40614 # 4.61 SIVBOFF IN (AVEGDT+1) CS
023328,000244: 33,3633 10035 OCT 10035
023329,000245:
023330,000246: 33,3634 01,2231 4P61SPT1 = 4.61SPOT
023331,000247: 33,3634 01,2250 5P3SPT16 = 5.3SPOT
023332,000248: 33,3634 04655 TC POSTJUMP
023333,000249: 33,3635 51134 CADR CLEARSTR
023334,000250:
023335,000251: 33,3636 0003777 EBANK= WHOCARES
023336,000252: 33,3636 34753 SIVBOFF CAF BIT14
023337,000253: 33,3637 00006 EXTEND
023338,000254: 33,3640 05012 WOR CHAN12 # SHUTDOWN THE SIVB
023339,000255: 33,3641 00006 EXTEND
023340,000256: 33,3642 30025 DCA TIME2
023341,000257: 33,3643 53022 DXCH TEVENT # SET TEVENT
023342,000258: 33,3644 05255 TC FIXDELAY
023343,000259: 33,3645 00372 DEC 250 B-14 # DELAY 2.5 SECS
023344,000260: 33,3646 34772 CAF ZERO
023345,000261: 33,3647 54777 TS NVWORD1 # ZERO NVWORD1 IN CASE CLOCKJOB WAITING
023346,000262: 33,3650 44756 CS TIMRBIT
023347,000263: 33,3651 70103 MASK FLAGWRD7
023348,000264: 33,3652 54103 TS FLAGWRD7 # DISABLE CLOKTASK
023349,000265: 33,3653 05402 TC PHASCHNG
023350,000266: 33,3654 05014 OCT 05014
023351,000267: 33,3655 77777 DEC -0 B-14 # START BELOW
023352,000268: 33,3656 34664 CAF PRIO12
023353,000269: 33,3657 05121 TC NOVAC
Page 532 |
023355,000271: 33,3660 0003777 EBANK= WHOCARES
023356,000272: 33,3660 02012 74067 2CADR POSTTLI
023357,000273:
023358,000274: 33,3662 05314 TC TASKOVER
023359,000275:
023360,000276: 33,3663 00000 00620 4SEC 2DEC 400 B-28
023361,000277: 33,3665 00000 01750 TENSEC 2DEC 1000 B-28
023362,000278: 33,3667 00006 10000 200B+19 2DEC 200 B-19
023363,000279:
023364,000280:
023365,000281: 36,2000 SETLOC P15LOC2
023366,000282: 36,2000 BANK
023367,000283: 36,2012 0003777 EBANK= WHOCARES
023368,000284:
023369,000285: 36,2012 COUNT* $$/P15
023370,000286: 36,2012 32015 POSTTLI CAF V16N95
023371,000287: 36,2013 05535 TC VNFLASH
023372,000288: 36,2014 14103 TCF GOTOPOOH
023373,000289:
023374,000290:
023375,000291: 36,2015 04137 V16N95 VN 1695
023376,000292:
Page 533 |
023378,000294:
This page empty. |
023380,000296:
End of include-file P15.agc. Parent file is MAIN.agc