Source Code
This is a reconstructed version of Luminary 130, the initial AGC program released
in November 1969 for the Apollo 13 LM. Three more releases
followed before the flown revision was finally manufactured in February 1970.
This reconstruction was created from a previous transcription of the original listing of Luminary 131, combined with Luminary memo #129 which describes the small difference between the Luminary 130 and 131. The reconstructed source code was verified by matching memory-bank checksums to those listed for Luminary 130 in drawing 2021152G. In this source code, program comments from the original (Luminary 131) code are prefixed with '#', while those added later by the Virtual AGC project are prefixed with '##'. |
054957,000002: ## Copyright: Public domain.
054958,000003: ## Filename: RESTARTS_ROUTINE.agc
054959,000004: ## Purpose: A section of the reconstructed source code for Luminary 130.
054960,000005: ## This was the original program released for the Apollo 13 LM,
054961,000006: ## although several more revisions would follow. It has been
054962,000007: ## reconstructed from a listing of Luminary 131, from which it
054963,000008: ## differs on only two lines in P70-P71. The difference is
054964,000009: ## described in detail in Luminary memo #129, which was used
054965,000010: ## to perform the reconstruction. This file is intended to be a
054966,000011: ## faithful reconstruction, except that the code format has been
054967,000012: ## changed to conform to the requirements of the yaYUL assembler
054968,000013: ## rather than the original YUL assembler.
054969,000014: ## Reference: pp. 1295-1300
054970,000015: ## Contact: Ron Burkey <info@sandroid.org>.
054971,000016: ## Website: www.ibiblio.org/apollo/index.html
054972,000017: ## Mod history: 06/05/03 RSB. Began transcribing.
054973,000018: ## 05/14/05 RSB Corrected website references above.
054974,000019: ## 2010-10-25 JL Added missing # in comment.
054975,000020: ## 2017-01-06 RSB Page numbers now agree with those on the
054976,000021: ## original hardcopy, as opposed to the PDF page
054977,000022: ## numbers in 1701.pdf.
054978,000023: ## 2017-02-27 RSB Proofed comment text using octopus/ProoferComments.
054979,000024: ## 2017-03-01 RSB Fixed lingering comment-text typos.
054980,000025: ## 2017-03-14 RSB Comment-text fixes noted in proofing Luminary 116.
054981,000026: ## 2017-03-16 RSB Comment-text fixes identified in 5-way
054982,000027: ## side-by-side diff of Luminary 69/99/116/131/210.
054983,000028: ## 2018-09-04 MAS Copied from Luminary 131 for Luminary 130.
054984,000029:
Page 1295 |
054986,000031: 01,3527 BANK 01
054987,000032: 01,2000 SETLOC RESTART
054988,000033: 01,2000 BANK
054989,000034:
054990,000035: 01,3527 E3,1436 EBANK= PHSNAME1 # GOPROG MUST SWITCH TO THIS EBANK
054991,000036:
054992,000037: 01,3527 COUNT* $$/RSROU
054993,000038: 01,3527 30161 RESTARTS CA MPAC +5 # GET GROUP NUMBER -1
054994,000039: 01,3530 60000 DOUBLE # SAVE FOR INDEXING
054995,000040: 01,3531 54155 TS TEMP2G
054996,000041:
054997,000042: 01,3532 33771 CA PHS2CADR # SET UP EXIT IN CASE IT IS AN EVEN
054998,000043: 01,3533 54157 TS TEMPSWCH # TABLE PHASE
054999,000044:
055000,000045: 01,3534 33566 CA RTRNCADR # TO SAVE TIME ASSUME IT WILL GET NEXT
055001,000046: 01,3535 54707 TS GOLOC +2 # GROUP AFTER THIS
055002,000047:
055003,000048: 01,3536 30154 CA TEMPPHS
055004,000049: 01,3537 75007 MASK OCT1400
055005,000050: 01,3540 10000 CCS A # IS IT A VARIABLE OR TABLE RESTART
055006,000051: 01,3541 13552 TCF ITSAVAR # IT:S A VARIABLE RESTART
055007,000052:
055008,000053: 01,3542 10154 GETPART2 CCS TEMPPHS # IS IT AN X.1 RESTART
055009,000054: 01,3543 10000 CCS A
055010,000055: 01,3544 13652 TCF ITSATBL # NO, ITS A TABLE RESTART
055011,000056:
055012,000057: 01,3545 35024 CA PRIO14 # IT IS AN X.1 RESTART, THEREFORE START
055013,000058: 01,3546 05105 TC FINDVAC # THE DISPLAY RESTART JOB
055014,000059: 01,3547 E3,1400 EBANK= LST1
055015,000060: 01,3547 03040 20103 2CADR INITDSP
055016,000061:
055017,000062: 01,3551 03566 TC RTRNCADR # FINISHED WITH THIS GROUP, GET NEXT ONE
055018,000063:
055019,000064: 01,3552 75007 ITSAVAR MASK OCT1400 # IS IT TYPE B ?
055020,000065: 01,3553 10000 CCS A
055021,000066: 01,3554 13623 TCF ITSLIKEB # YES, IT IS TYPE B
055022,000067:
055023,000068: 01,3555 00006 EXTEND # STORE THE JOB (OR TASK) 2CADR FOR EXIT
055024,000069: 01,3556 50155 NDX TEMP2G
055025,000070: 01,3557 31437 DCA PHSNAME1
055026,000071: 01,3560 52706 DXCH GOLOC
055027,000072:
055028,000073: 01,3561 30154 CA TEMPPHS # SEE IF THIS IS A JOB, TASK, OR A LONGCAL
055029,000074: 01,3562 74757 MASK OCT7
055030,000075: 01,3563 67751 AD MINUS2
055031,000076: 01,3564 10000 CCS A
055032,000077: 01,3565 13735 TCF ITSLNGCL # ITS A LONGCALL
055033,000078:
055034,000079: 01,3566 04631 RTRNCADR TC SWRETURN # CANT GET HERE
Page 1296 |
055036,000081: 01,3567 13571 TCF ITSAWAIT
055037,000082:
055038,000083: 01,3570 13636 TCF ITSAJOB # ITS A JOB
055039,000084:
055040,000085: 01,3571 33775 ITSAWAIT CA WTLTCADR # SET UP WAITLIST CALL
055041,000086: 01,3572 54704 TS GOLOC -1
055042,000087:
055043,000088: 01,3573 50155 NDX TEMP2G # DIRECTLY STORED
055044,000089: 01,3574 31053 CA PHSPRDT1
055045,000090: 01,3575 10000 TIMETEST CCS A # IS IT AN IMMEDIATE RESTART
055046,000091: 01,3576 24000 INCR A # NO,
055047,000092: 01,3577 13602 TCF FINDTIME # FIND OUT WHEN IT SHOULD BEGIN
055048,000093:
055049,000094: 01,3600 15436 TCF ITSINDIR # STORED INDIRECTLY
055050,000095:
055051,000096: 01,3601 13621 TCF IMEDIATE # IT WANTS AN IMMEDIATE RESTART
055052,000097:
055053,000098: # ***** THIS MUST BE IN FIXED FIXED *****
055054,000099:
055055,000100: 5436 BLOCK 02
055056,000101: 4000 SETLOC FFTAG2
055057,000102: 4000 BANK
055058,000103:
055059,000104: 5436 COUNT* $$/RSROU
055060,000105: 5436 22706 ITSINDIR LXCH GOLOC +1 # GET THE CORRECT E BANK IN CASE THIS IS
055061,000106: 5437 22006 LXCH BB # SWITCHED ERRASIBLE
055062,000107:
055063,000108: 5440 50000 NDX A # GET THE TIME INDIRECTLY
055064,000109: 5441 30001 CA 1
055065,000110:
055066,000111: 5442 22006 LXCH BB # RESTORE THE BB AND GOLOC
055067,000112: 5443 22706 LXCH GOLOC +1
055068,000113:
055069,000114: 5444 13602 TCF FINDTIME # FIND OUT WHEN IT SHOULD BEGIN
055070,000115:
055071,000116: # ***** YOU MAY RETURN TO SWITCHED FIXED *****
055072,000117:
055073,000118: 01,3602 BANK 01
055074,000119: 01,2000 SETLOC RESTART
055075,000120: 01,2000 BANK
055076,000121:
055077,000122: 01,3602 COUNT* $$/RSROU
055078,000123: 01,3602 40000 FINDTIME COM # MAKE NEGITIVE SINCE IT WILL BE SUBTRACTD
055079,000124: 01,3603 54001 TS L # AND SAVE
055080,000125: 01,3604 50155 NDX TEMP2G
055081,000126: 01,3605 41052 CS TBASE1
055082,000127: 01,3606 00006 EXTEND
055083,000128: 01,3607 60025 SU TIME1
055084,000129: 01,3610 10000 CCS A
055085,000130: 01,3611 40000 COM
Page 1297 |
055087,000132: 01,3612 67734 AD OCT37776
055088,000133: 01,3613 64753 AD ONE
055089,000134: 01,3614 60001 AD L
055090,000135: 01,3615 10000 CCS A
055091,000136: 01,3616 34755 CA ZERO
055092,000137: 01,3617 13621 TCF +2
055093,000138: 01,3620 13621 TCF +1
055094,000139: 01,3621 64753 IMEDIATE AD ONE
055095,000140: 01,3622 00704 TC GOLOC -1
055096,000141: 01,3623 33566 ITSLIKEB CA RTRNCADR # TYPE B, SO STORE RETURN IN
055097,000142: 01,3624 54157 TS TEMPSWCH # TEMPSWCH IN CASE OF AN EVEN PHASE
055098,000143:
055099,000144: 01,3625 33772 CA PRT2CADR # SET UP EXIT TO GET TABLE PART OF THIS
055100,000145: 01,3626 54707 TS GOLOC +2 # VARIABLE TYPE OF PHASE
055101,000146:
055102,000147: 01,3627 30154 CA TEMPPHS # MAKE THE PHASE LOOK RIGHT FOR THE TABLE
055103,000148: 01,3630 76077 MASK OCT177 # PART OF THIS VARIABLE PHASE
055104,000149: 01,3631 54154 TS TEMPPHS
055105,000150:
055106,000151: 01,3632 00006 EXTEND
055107,000152: 01,3633 50155 NDX TEMP2G # OBTAIN THE JOB:S 2CADR
055108,000153: 01,3634 31437 DCA PHSNAME1
055109,000154: 01,3635 52706 DXCH GOLOC
055110,000155:
055111,000156: 01,3636 50155 ITSAJOB NDX TEMP2G # NOW ADD THE PRIORITY AND LET:S GO
055112,000157: 01,3637 31053 CA PHSPRDT1
055113,000158: 01,3640 54704 CHKNOVAC TS GOLOC -1 # SAVE PRIO UNTIL WE SEE IF ITS
055114,000159: 01,3641 00006 EXTEND # A FINDVAC OR A NOVAC
055115,000160: 01,3642 63646 BZMF ITSNOVAC
055116,000161:
055117,000162: 01,3643 33774 CAF FVACCADR # POSITIVE, SET UP FINDVAC CALL.
055118,000163: 01,3644 56704 XCH GOLOC -1 # PICK UP PRIO,
055119,000164: 01,3645 00704 TC GOLOC -1 # AND GO
055120,000165:
055121,000166: 01,3646 33776 ITSNOVAC CAF NOVACADR # NEGATIVE,
055122,000167: 01,3647 56704 XCH GOLOC -1 # SET UP NOVAC CALL,
055123,000168: 01,3650 40000 COM # CORRECT PRIO,
055124,000169: 01,3651 00704 TC GOLOC -1 # AND GO
055125,000170:
055126,000171: 01,3652 54020 ITSATBL TS CYR # FIND OUT IF THE PHASE IS ODD OR EVEN
055127,000172: 01,3653 10020 CCS CYR
055128,000173: 01,3654 13655 TCF +1 # IT:S EVEN
055129,000174: 01,3655 13753 TCF ITSEVEN
055130,000175:
055131,000176: 01,3656 33566 CA RTRNCADR # IN CASE THIS IS THE SECOND PART OF A
055132,000177: 01,3657 54707 TS GOLOC +2 # TYPE B RESTART, WE NEED PROPER EXIT
055133,000178:
055134,000179: 01,3660 30154 CA TEMPPHS # SET UP POINTER FOR FINDING OUR PLACE IN
055135,000180: 01,3661 54021 TS SR # THE RESTART TABLES
055136,000181: 01,3662 60021 AD SR
Page 1298 |
055138,000183: 01,3663 50155 NDX TEMP2G
055139,000184: 01,3664 62003 AD SIZETAB +1
055140,000185: 01,3665 54156 TS POINTER
055141,000186:
055142,000187: 01,3666 00006 CONTBL2 EXTEND # FIND OUT WHAT:S IN THE TABLE
055143,000188: 01,3667 50156 NDX POINTER
055144,000189: 01,3670 32002 DCA CADRTAB # GET THE 2CADR
055145,000190:
055146,000191: 01,3671 22706 LXCH GOLOC +1 # STORE THE BB INFORMATION
055147,000192:
055148,000193: 01,3672 10000 CCS A # IS IT A JOB OR IS IT TIMED
055149,000194: 01,3673 24000 INCR A # POSITIVE, MUST BE A JOB
055150,000195: 01,3674 13747 TCF ITSAJOB2
055151,000196:
055152,000197: 01,3675 24000 INCR A # MUST BE EITHER A WAITLIST OR LONGCALL
055153,000198: 01,3676 54705 TS GOLOC # LET-S STORE THE CORRECT CADR
055154,000199:
055155,000200: 01,3677 33775 CA WTLTCADR # SET UP OUR EXIT TO WAITLIST
055156,000201: 01,3700 54704 TS GOLOC -1
055157,000202:
055158,000203: 01,3701 30706 CA GOLOC +1 # NOW FIND OUT IF IT IS A WAITLIST CALL
055159,000204: 01,3702 74742 MASK BIT10 # THIS SHOULD BE ONE IF WE HAVE -BB
055160,000205: 01,3703 10000 CCS A # FOR THAT MATTER SO SHOULD BE BITS 9,8,7,
055161,000206: # 6,5, AND LAST BUT NOT LEAST (PERHAPS NOT
055162,000207: # IN IMPORTANCE ANYWAY. BIT 4
055163,000208: 01,3704 13742 TCF ITSWTLST # IT IS A WAITLIST CALL
055164,000209:
055165,000210: 01,3705 50156 NDX POINTER # OBTAIN THE ORIGINAL DELTA T
055166,000211: 01,3706 32000 CA PRDTTAB # ADDRESS FOR THIS LONGCALL
055167,000212:
055168,000213: 01,3707 15445 TCF ITSLGCL1 # NOW GO GET THE DELTA TIME
055169,000214:
055170,000215: # ***** THIS MUST BE IN FIXED FIXED *****
055171,000216:
055172,000217: 5445 BLOCK 02
055173,000218: 4000 SETLOC FFTAG2
055174,000219: 4000 BANK
055175,000220:
055176,000221: 5445 COUNT* $$/RSROU
055177,000222: 5445 22706 ITSLGCL1 LXCH GOLOC +1 # OBTAIN THE CORRECT E BANK
055178,000223: 5446 22006 LXCH BB
055179,000224: 5447 22706 LXCH GOLOC +1 # AND PRESERVE OUR E AND F BANKS
055180,000225:
055181,000226: 5450 00006 EXTEND # GET THE DELTA TIME
055182,000227: 5451 50000 NDX A
055183,000228: 5452 30001 DCA 0
055184,000229:
055185,000230: 5453 22706 LXCH GOLOC +1 # RESTORE OUR E AND F BANK
055186,000231: 5454 22006 LXCH BB # RESTORE THE TASKS E AND F BANKS
055187,000232: 5455 22706 LXCH GOLOC +1 # AND PRESERVE OUR L
Page 1299 |
055189,000234: 5456 13710 TCF ITSLGCL2 # NOW LET:S PROCESS THIS LONGCALL
055190,000235:
055191,000236: # ***** YOU MAY RETURN TO SWITCHED FIXED *****
055192,000237:
055193,000238: 01,3710 BANK 01
055194,000239: 01,2000 SETLOC RESTART
055195,000240: 01,2000 BANK
055196,000241:
055197,000242: 01,3710 COUNT* $$/RSROU
055198,000243: 01,3710 53153 ITSLGCL2 DXCH LONGTIME
055199,000244:
055200,000245: 01,3711 00006 EXTEND # CALCULATE TIME LEFT
055201,000246: 01,3712 40025 DCS TIME2
055202,000247: 01,3713 21153 DAS LONGTIME
055203,000248: 01,3714 00006 EXTEND
055204,000249: 01,3715 31151 DCA LONGBASE
055205,000250: 01,3716 21153 DAS LONGTIME
055206,000251:
055207,000252: 01,3717 11152 CCS LONGTIME # FIND OUT HOW THIS SHOULD BE RESTARTED
055208,000253: 01,3720 13730 TCF LONGCLCL
055209,000254: 01,3721 13723 TCF +2
055210,000255: 01,3722 13616 TCF IMEDIATE -3
055211,000256: 01,3723 11153 CCS LONGTIME +1
055212,000257: 01,3724 13730 TCF LONGCLCL
055213,000258: 01,3725 13726 NOOP # CAN:T GET HERE *********
055214,000259: 01,3726 13616 TCF IMEDIATE -3
055215,000260: 01,3727 13621 TCF IMEDIATE
055216,000261:
055217,000262: 01,3730 33773 LONGCLCL CA LGCLCADR # WE WILL GO TO LONGCALL
055218,000263: 01,3731 54704 TS GOLOC -1
055219,000264:
055220,000265: 01,3732 00006 EXTEND # PREPARE OUR ENTRY TO LONGCALL
055221,000266: 01,3733 31153 DCA LONGTIME
055222,000267: 01,3734 00704 TC GOLOC -1
055223,000268:
055224,000269: 01,3735 33775 ITSLNGCL CA WTLTCADR # ASSUME IT WILL GO TO WAITLIST
055225,000270: 01,3736 54704 TS GOLOC -1
055226,000271:
055227,000272: 01,3737 50155 NDX TEMP2G
055228,000273: 01,3740 41053 CS PHSPRDT1 # GET THE DELTA T ADDRESS
055229,000274:
055230,000275: 01,3741 15445 TCF ITSLGCL1 # NOW GET THE DELTA TIME
055231,000276:
055232,000277: 01,3742 40706 ITSWTLST CS GOLOC +1 # CORRECT THE BBCON INFORMATION
055233,000278: 01,3743 54706 TS GOLOC +1
055234,000279:
055235,000280: 01,3744 50156 NDX POINTER # GET THE DT AND FIND OUT IF IT WAS STORED
055236,000281: 01,3745 32000 CA PRDTTAB # DIRECTLY OR INDIRECTLY
055237,000282:
055238,000283: 01,3746 13575 TCF TIMETEST # FIND OUT HOW THE TIME IS STORED
055239,000284:
Page 1300 |
055241,000286: 01,3747 56705 ITSAJOB2 XCH GOLOC # STORE THE CADR
055242,000287:
055243,000288: 01,3750 50156 NDX POINTER # ADD THE PRIORITY AND LET:S GO
055244,000289: 01,3751 32000 CA PRDTTAB
055245,000290:
055246,000291: 01,3752 13640 TCF CHKNOVAC
055247,000292:
055248,000293: 01,3753 30157 ITSEVEN CA TEMPSWCH # SET UP FOR EITHER THE SECOND PART OF THE
055249,000294: 01,3754 54707 TS GOLOC +2 # TABLE, OR A RETURN FOR THE NEXT GROUP
055250,000295:
055251,000296: 01,3755 50155 NDX TEMP2G # SET UP POINTER FOR OUR LOCATION WITHIN
055252,000297: 01,3756 32002 CA SIZETAB # THE TABLE
055253,000298: 01,3757 60154 AD TEMPPHS # THIS MAY LOOK BAD BUT LET:S SEE YOU DO
055254,000299: 01,3760 60154 AD TEMPPHS # BETTER IN TIME OR NUMBERR OF LOCATIONS
055255,000300: 01,3761 60154 AD TEMPPHS
055256,000301: 01,3762 54156 TS POINTER
055257,000302:
055258,000303: 01,3763 13666 TCF CONTBL2 # NOW PROCESS WHAT IS IN THE TABLE
055259,000304:
055260,000305: 01,3764 36250 PHSPART2 CA THREE # SET THE POINTER FOR THE SECOND HALF OF
055261,000306: 01,3765 26156 ADS POINTER # THE TABLE
055262,000307:
055263,000308: 01,3766 33566 CA RTRNCADR # THIS WILL BE OUR LAST TIME THROUGH THE
055264,000309: 01,3767 54707 TS GOLOC +2 # EVEN TABLE, SO AFTER IT GET THE NEXT
055265,000310: # GROUP
055266,000311: 01,3770 13666 TCF CONTBL2 # SO LET:S GET THE SECOND ENTRY IN THE TBL
055267,000312:
055268,000313: 01,3771 0154 TEMPPHS EQUALS MPAC
055269,000314: 01,3771 0155 TEMP2G EQUALS MPAC +1
055270,000315: 01,3771 0156 POINTER EQUALS MPAC +2
055271,000316: 01,3771 0157 TEMPSWCH EQUALS MPAC +3
055272,000317: 01,3771 0705 GOLOC EQUALS VAC5 +20D
055273,000318: 01,3771 7751 MINUS2 EQUALS NEG2
055274,000319: 01,3771 6077 OCT177 EQUALS LOW7
055275,000320:
055276,000321: 01,3771 03764 PHS2CADR GENADR PHSPART2
055277,000322: 01,3772 03542 PRT2CADR GENADR GETPART2
055278,000323: 01,3773 05277 LGCLCADR GENADR LONGCALL
055279,000324: 01,3774 05105 FVACCADR GENADR FINDVAC
055280,000325: 01,3775 05203 WTLTCADR GENADR WAITLIST
055281,000326: 01,3776 05072 NOVACADR GENADR NOVAC
055282,000327:
055283,000328:
End of include-file RESTARTS_ROUTINE.agc. Parent file is MAIN.agc