Source Code
These source-code files were from the printout at the MIT Museum, with many thanks
to Deborah Douglas, the Museum's Curator of Science and Technology, for releasing
it to us. The printout was digitally photographed by Paul Fjeld. A team of
volunteers transcribed the source code manually from these images or, where
appropriate, modified already-transcribed but similar source Luminary 131 (Apollo 13)
source code to agree with the images from the printout. Note that the page images
presented online are of reduced quality, and that higher-quality images
are available. Report any conversion errors or legibility
problems in page images to info@sandroid.org.
Notations on the program listing read, in part:GAP: ASSEMBLE REVISION 001 OF AGC PROGRAM LMY99 BY NASA 2021112-061 16:27 JULY 14,1969Note that the date is the date of the printout, not the date of the program revision. |
055939,000002: ## Copyright: Public domain.
055940,000003: ## Filename: RESTARTS_ROUTINE.agc
055941,000004: ## Purpose: Part of the source code for Luminary 1A build 099.
055942,000005: ## It is part of the source code for the Lunar Module's (LM)
055943,000006: ## Apollo Guidance Computer (AGC), for Apollo 11.
055944,000007: ## Assembler: yaYUL
055945,000008: ## Contact: Onno Hommes <ohommes@cmu.edu>.
055946,000009: ## Website: www.ibiblio.org/apollo.
055947,000010: ## Pages: 1303-1309
055948,000011: ## Mod history: 2009-05-27 OH Transcribed from page images.
055949,000012: ## 2016-12-18 RSB Proofed text comments with octopus/ProoferComments
055950,000013: ## and corrected the errors found.
055951,000014: ## 2017-03-14 RSB Comment-text fixes noted in proofing Luminary 116.
055952,000015: ## 2017-03-16 RSB Comment-text fixes identified in 5-way
055953,000016: ## side-by-side diff of Luminary 69/99/116/131/210.
055954,000017:
055955,000018: ## This source code has been transcribed or otherwise adapted from
055956,000019: ## digitized images of a hardcopy from the MIT Museum. The digitization
055957,000020: ## was performed by Paul Fjeld, and arranged for by Deborah Douglas of
055958,000021: ## the Museum. Many thanks to both. The images (with suitable reduction
055959,000022: ## in storage size and consequent reduction in image quality as well) are
055960,000023: ## available online at www.ibiblio.org/apollo. If for some reason you
055961,000024: ## find that the images are illegible, contact me at info@sandroid.org
055962,000025: ## about getting access to the (much) higher-quality images which Paul
055963,000026: ## actually created.
055964,000027: ##
055965,000028: ## Notations on the hardcopy document read, in part:
055966,000029: ##
055967,000030: ## Assemble revision 001 of AGC program LMY99 by NASA 2021112-61
055968,000031: ## 16:27 JULY 14, 1969
055969,000032:
Page 1303 |
055971,000034: 01,3526 BANK 01
055972,000035: 01,2000 SETLOC RESTART
055973,000036: 01,2000 BANK
055974,000037:
055975,000038: 01,3526 E3,1436 EBANK= PHSNAME1 # GOPROG MUST SWITCH TO THIS EBANK
055976,000039:
055977,000040: 01,3526 COUNT* $$/RSROU
055978,000041: 01,3526 30161 RESTARTS CA MPAC +5 # GET GROUP NUMBER -1
055979,000042: 01,3527 60000 DOUBLE # SAVE FOR INDEXING
055980,000043: 01,3530 54155 TS TEMP2G
055981,000044:
055982,000045: 01,3531 33770 CA PHS2CADR # SET UP EXIT IN CASE IT IS AN EVEN
055983,000046: 01,3532 54157 TS TEMPSWCH # TABLE PHASE
055984,000047:
055985,000048: 01,3533 33565 CA RTRNCADR # TO SAVE TIME ASSUME IT WILL GET NEXT
055986,000049: 01,3534 54707 TS GOLOC +2 # GROUP AFTER THIS
055987,000050:
055988,000051: 01,3535 30154 CA TEMPPHS
055989,000052: 01,3536 75007 MASK OCT1400
055990,000053: 01,3537 10000 CCS A # IS IT A VARIABLE OR TABLE RESTART
055991,000054: 01,3540 13551 TCF ITSAVAR # IT:S A VARIABLE RESTART
055992,000055:
055993,000056: 01,3541 10154 GETPART2 CCS TEMPPHS # IS IT AN X.1 RESTART
055994,000057: 01,3542 10000 CCS A
055995,000058: 01,3543 13651 TCF ITSATBL # NO, ITS A TABLE RESTART
055996,000059:
055997,000060: 01,3544 35024 CA PRIO14 # IT IS AN X.1 RESTART, THEREFORE START
055998,000061: 01,3545 05105 TC FINDVAC # THE DISPLAY RESTART JOB
055999,000062: 01,3546 E3,1400 EBANK= LST1
056000,000063: 01,3546 03037 20103 2CADR INITDSP
056001,000064:
056002,000065: 01,3550 03565 TC RTRNCADR # FINISHED WITH THIS GROUP, GET NEXT ONE
056003,000066:
056004,000067: 01,3551 75007 ITSAVAR MASK OCT1400 # IS IT TYPE B ?
056005,000068: 01,3552 10000 CCS A
056006,000069: 01,3553 13622 TCF ITSLIKEB # YES, IT IS TYPE B
056007,000070:
056008,000071: 01,3554 00006 EXTEND # STORE THE JOB (OR TASK) 2CADR FOR EXIT
056009,000072: 01,3555 50155 NDX TEMP2G
056010,000073: 01,3556 31437 DCA PHSNAME1
056011,000074: 01,3557 52706 DXCH GOLOC
056012,000075:
056013,000076: 01,3560 30154 CA TEMPPHS # SEE IF THIS IS A JOB, TASK, OR A LONGCAL
056014,000077: 01,3561 74757 MASK OCT7
056015,000078: 01,3562 67746 AD MINUS2
056016,000079: 01,3563 10000 CCS A
056017,000080: 01,3564 13734 TCF ITSLNGCL # ITS A LONGCALL
056018,000081:
056019,000082: 01,3565 04631 RTRNCADR TC SWRETURN # CANT GET HERE
Page 1304 |
056021,000084: 01,3566 13570 TCF ITSAWAIT
056022,000085:
056023,000086: 01,3567 13635 TCF ITSAJOB # ITS A JOB
056024,000087:
056025,000088: 01,3570 33774 ITSAWAIT CA WTLTCADR # SET UP WAITLIST CALL
056026,000089: 01,3571 54704 TS GOLOC -1
056027,000090:
056028,000091: 01,3572 50155 NDX TEMP2G # DIRECTLY STORED
056029,000092: 01,3573 31054 CA PHSPRDT1
056030,000093: 01,3574 10000 TIMETEST CCS A # IS IT AN IMMEDIATE RESTART
056031,000094: 01,3575 24000 INCR A # NO,
056032,000095: 01,3576 13601 TCF FINDTIME # FIND OUT WHEN IT SHOULD BEGIN
056033,000096:
056034,000097: 01,3577 15436 TCF ITSINDIR # STORED INDIRECTLY
056035,000098:
056036,000099: 01,3600 13620 TCF IMEDIATE # IT WANTS AN IMMEDIATE RESTART
056037,000100:
056038,000101: # ***** THIS MUST BE IN FIXED FIXED *****
056039,000102:
056040,000103: 5436 BLOCK 02
056041,000104: 4000 SETLOC FFTAG2
056042,000105: 4000 BANK
056043,000106:
056044,000107: 5436 COUNT* $$/RSROU
056045,000108: 5436 22706 ITSINDIR LXCH GOLOC +1 # GET THE CORRECT E BANK IN CASE THIS IS
056046,000109: 5437 22006 LXCH BB # SWITCHED ERRASIBLE
056047,000110:
056048,000111: 5440 50000 NDX A # GET THE TIME INDIRECTLY
056049,000112: 5441 30001 CA 1
056050,000113:
056051,000114: 5442 22006 LXCH BB # RESTORE THE BB AND GOLOC
056052,000115: 5443 22706 LXCH GOLOC +1
056053,000116:
056054,000117: 5444 13601 TCF FINDTIME # FIND OUT WHEN IT SHOULD BEGIN
056055,000118:
056056,000119: # ***** YOU MAY RETURN TO SWITCHED FIXED *****
056057,000120:
056058,000121: 01,3601 BANK 01
056059,000122: 01,2000 SETLOC RESTART
056060,000123: 01,2000 BANK
056061,000124:
056062,000125: 01,3601 COUNT* $$/RSROU
056063,000126: 01,3601 40000 FINDTIME COM # MAKE NEGITIVE SINCE IT WILL BE SUBTRACTD
056064,000127: 01,3602 54001 TS L # AND SAVE
056065,000128: 01,3603 50155 NDX TEMP2G
056066,000129: 01,3604 41053 CS TBASE1
056067,000130: 01,3605 00006 EXTEND
056068,000131: 01,3606 60025 SU TIME1
056069,000132: 01,3607 10000 CCS A
056070,000133: 01,3610 40000 COM
Page 1305 |
056072,000135: 01,3611 67731 AD OCT37776
056073,000136: 01,3612 64753 AD ONE
056074,000137: 01,3613 60001 AD L
056075,000138: 01,3614 10000 CCS A
056076,000139: 01,3615 34755 CA ZERO
056077,000140: 01,3616 13620 TCF +2
056078,000141: 01,3617 13620 TCF +1
056079,000142: 01,3620 64753 IMEDIATE AD ONE
056080,000143: 01,3621 00704 TC GOLOC -1
056081,000144: 01,3622 33565 ITSLIKEB CA RTRNCADR # TYPE B, SO STORE RETURN IN
056082,000145: 01,3623 54157 TS TEMPSWCH # TEMPSWCH IN CASE OF AN EVEN PHASE
056083,000146:
056084,000147: 01,3624 33771 CA PRT2CADR # SET UP EXIT TO GET TABLE PART OF THIS
056085,000148: 01,3625 54707 TS GOLOC +2 # VARIABLE TYPE OF PHASE
056086,000149:
056087,000150: 01,3626 30154 CA TEMPPHS # MAKE THE PHASE LOOK RIGHT FOR THE TABLE
056088,000151: 01,3627 76074 MASK OCT177 # PART OF THIS VARIABLE PHASE
056089,000152: 01,3630 54154 TS TEMPPHS
056090,000153:
056091,000154: 01,3631 00006 EXTEND
056092,000155: 01,3632 50155 NDX TEMP2G # OBTAIN THE JOB:S 2CADR
056093,000156: 01,3633 31437 DCA PHSNAME1
056094,000157: 01,3634 52706 DXCH GOLOC
056095,000158:
056096,000159: 01,3635 50155 ITSAJOB NDX TEMP2G # NOW ADD THE PRIORITY AND LET:S GO
056097,000160: 01,3636 31054 CA PHSPRDT1
056098,000161: 01,3637 54704 CHKNOVAC TS GOLOC -1 # SAVE PRIO UNTIL WE SEE IF ITS
056099,000162: 01,3640 00006 EXTEND # A FINDVAC OR A NOVAC
056100,000163: 01,3641 63645 BZMF ITSNOVAC
056101,000164:
056102,000165: 01,3642 33773 CAF FVACCADR # POSITIVE, SET UP FINDVAC CALL.
056103,000166: 01,3643 56704 XCH GOLOC -1 # PICK UP PRIO,
056104,000167: 01,3644 00704 TC GOLOC -1 # AND GO
056105,000168:
056106,000169: 01,3645 33775 ITSNOVAC CAF NOVACADR # NEGATIVE,
056107,000170: 01,3646 56704 XCH GOLOC -1 # SET UP NOVAC CALL,
056108,000171: 01,3647 40000 COM # CORRECT PRIO,
056109,000172: 01,3650 00704 TC GOLOC -1 # AND GO
056110,000173:
056111,000174: 01,3651 54020 ITSATBL TS CYR # FIND OUT IF THE PHASE IS ODD OR EVEN
056112,000175: 01,3652 10020 CCS CYR
056113,000176: 01,3653 13654 TCF +1 # IT:S EVEN
056114,000177: 01,3654 13752 TCF ITSEVEN
056115,000178:
056116,000179: 01,3655 33565 CA RTRNCADR # IN CASE THIS IS THE SECOND PART OF A
056117,000180: 01,3656 54707 TS GOLOC +2 # TYPE B RESTART, WE NEED PROPER EXIT
056118,000181:
056119,000182: 01,3657 30154 CA TEMPPHS # SET UP POINTER FOR FINDING OUR PLACE IN
056120,000183: 01,3660 54021 TS SR # THE RESTART TABLES
056121,000184: 01,3661 60021 AD SR
Page 1306 |
056123,000186: 01,3662 50155 NDX TEMP2G
056124,000187: 01,3663 62003 AD SIZETAB +1
056125,000188: 01,3664 54156 TS POINTER
056126,000189:
056127,000190: 01,3665 00006 CONTBL2 EXTEND # FIND OUT WHAT:S IN THE TABLE
056128,000191: 01,3666 50156 NDX POINTER
056129,000192: 01,3667 32002 DCA CADRTAB # GET THE 2CADR
056130,000193:
056131,000194: 01,3670 22706 LXCH GOLOC +1 # STORE THE BB INFORMATION
056132,000195:
056133,000196: 01,3671 10000 CCS A # IS IT A JOB OR IS IT TIMED
056134,000197: 01,3672 24000 INCR A # POSITIVE, MUST BE A JOB
056135,000198: 01,3673 13746 TCF ITSAJOB2
056136,000199:
056137,000200: 01,3674 24000 INCR A # MUST BE EITHER A WAITLIST OR LONGCALL
056138,000201: 01,3675 54705 TS GOLOC # LET-S STORE THE CORRECT CADR
056139,000202:
056140,000203: 01,3676 33774 CA WTLTCADR # SET UP OUR EXIT TO WAITLIST
056141,000204: 01,3677 54704 TS GOLOC -1
056142,000205:
056143,000206: 01,3700 30706 CA GOLOC +1 # NOW FIND OUT IF IT IS A WAITLIST CALL
056144,000207: 01,3701 74742 MASK BIT10 # THIS SHOULD BE ONE IF WE HAVE -BB
056145,000208: 01,3702 10000 CCS A # FOR THAT MATTER SO SHOULD BE BITS 9,8,7,
056146,000209: # 6,5, AND LAST BUT NOT LEAST (PERHAPS NOT
056147,000210: # IN IMPORTANCE ANYWAY. BIT 4
056148,000211: 01,3703 13741 TCF ITSWTLST # IT IS A WAITLIST CALL
056149,000212:
056150,000213: 01,3704 50156 NDX POINTER # OBTAIN THE ORIGINAL DELTA T
056151,000214: 01,3705 32000 CA PRDTTAB # ADDRESS FOR THIS LONGCALL
056152,000215:
056153,000216: 01,3706 15445 TCF ITSLGCL1 # NOW GO GET THE DELTA TIME
056154,000217:
056155,000218: # ***** THIS MUST BE IN FIXED FIXED *****
056156,000219:
056157,000220: 5445 BLOCK 02
056158,000221: 4000 SETLOC FFTAG2
056159,000222: 4000 BANK
056160,000223:
056161,000224: 5445 COUNT* $$/RSROU
056162,000225: 5445 22706 ITSLGCL1 LXCH GOLOC +1 # OBTAIN THE CORRECT E BANK
056163,000226: 5446 22006 LXCH BB
056164,000227: 5447 22706 LXCH GOLOC +1 # AND PRESERVE OUR E AND F BANKS
056165,000228:
056166,000229: 5450 00006 EXTEND # GET THE DELTA TIME
056167,000230: 5451 50000 NDX A
056168,000231: 5452 30001 DCA 0
056169,000232:
056170,000233: 5453 22706 LXCH GOLOC +1 # RESTORE OUR E AND F BANK
056171,000234: 5454 22006 LXCH BB # RESTORE THE TASKS E AND F BANKS
056172,000235: 5455 22706 LXCH GOLOC +1 # AND PRESERVE OUR L
Page 1307 |
056174,000237: 5456 13707 TCF ITSLGCL2 # NOW LET:S PROCESS THIS LONGCALL
056175,000238:
056176,000239: # ***** YOU MAY RETURN TO SWITCHED FIXED *****
056177,000240:
056178,000241: 01,3707 BANK 01
056179,000242: 01,2000 SETLOC RESTART
056180,000243: 01,2000 BANK
056181,000244:
056182,000245: 01,3707 COUNT* $$/RSROU
056183,000246: 01,3707 53154 ITSLGCL2 DXCH LONGTIME
056184,000247:
056185,000248: 01,3710 00006 EXTEND # CALCULATE TIME LEFT
056186,000249: 01,3711 40025 DCS TIME2
056187,000250: 01,3712 21154 DAS LONGTIME
056188,000251: 01,3713 00006 EXTEND
056189,000252: 01,3714 31152 DCA LONGBASE
056190,000253: 01,3715 21154 DAS LONGTIME
056191,000254:
056192,000255: 01,3716 11153 CCS LONGTIME # FIND OUT HOW THIS SHOULD BE RESTARTED
056193,000256: 01,3717 13727 TCF LONGCLCL
056194,000257: 01,3720 13722 TCF +2
056195,000258: 01,3721 13615 TCF IMEDIATE -3
056196,000259: 01,3722 11154 CCS LONGTIME +1
056197,000260: 01,3723 13727 TCF LONGCLCL
056198,000261: 01,3724 13725 NOOP # CAN:T GET HERE *********
056199,000262: 01,3725 13615 TCF IMEDIATE -3
056200,000263: 01,3726 13620 TCF IMEDIATE
056201,000264:
056202,000265: 01,3727 33772 LONGCLCL CA LGCLCADR # WE WILL GO TO LONGCALL
056203,000266: 01,3730 54704 TS GOLOC -1
056204,000267:
056205,000268: 01,3731 00006 EXTEND # PREPARE OUR ENTRY TO LONGCALL
056206,000269: 01,3732 31154 DCA LONGTIME
056207,000270: 01,3733 00704 TC GOLOC -1
056208,000271:
056209,000272: 01,3734 33774 ITSLNGCL CA WTLTCADR # ASSUME IT WILL GO TO WAITLIST
056210,000273: 01,3735 54704 TS GOLOC -1
056211,000274:
056212,000275: 01,3736 50155 NDX TEMP2G
056213,000276: 01,3737 41054 CS PHSPRDT1 # GET THE DELTA T ADDRESS
056214,000277:
056215,000278: 01,3740 15445 TCF ITSLGCL1 # NOW GET THE DELTA TIME
056216,000279:
056217,000280: 01,3741 40706 ITSWTLST CS GOLOC +1 # CORRECT THE BBCON INFORMATION
056218,000281: 01,3742 54706 TS GOLOC +1
056219,000282:
056220,000283: 01,3743 50156 NDX POINTER # GET THE DT AND FIND OUT IF IT WAS STORED
056221,000284: 01,3744 32000 CA PRDTTAB # DIRECTLY OR INDIRECTLY
056222,000285:
056223,000286: 01,3745 13574 TCF TIMETEST # FIND OUT HOW THE TIME IS STORED
056224,000287:
Page 1308 |
056226,000289: 01,3746 56705 ITSAJOB2 XCH GOLOC # STORE THE CADR
056227,000290:
056228,000291: 01,3747 50156 NDX POINTER # ADD THE PRIORITY AND LET:S GO
056229,000292: 01,3750 32000 CA PRDTTAB
056230,000293:
056231,000294: 01,3751 13637 TCF CHKNOVAC
056232,000295:
056233,000296: 01,3752 30157 ITSEVEN CA TEMPSWCH # SET UP FOR EITHER THE SECOND PART OF THE
056234,000297: 01,3753 54707 TS GOLOC +2 # TABLE, OR A RETURN FOR THE NEXT GROUP
056235,000298:
056236,000299: 01,3754 50155 NDX TEMP2G # SET UP POINTER FOR OUR LOCATION WITHIN
056237,000300: 01,3755 32002 CA SIZETAB # THE TABLE
056238,000301: 01,3756 60154 AD TEMPPHS # THIS MAY LOOK BAD BUT LET:S SEE YOU DO
056239,000302: 01,3757 60154 AD TEMPPHS # BETTER IN TIME OR NUMBERR OF LOCATIONS
056240,000303: 01,3760 60154 AD TEMPPHS
056241,000304: 01,3761 54156 TS POINTER
056242,000305:
056243,000306: 01,3762 13665 TCF CONTBL2 # NOW PROCESS WHAT IS IN THE TABLE
056244,000307:
056245,000308: 01,3763 36245 PHSPART2 CA THREE # SET THE POINTER FOR THE SECOND HALF OF
056246,000309: 01,3764 26156 ADS POINTER # THE TABLE
056247,000310:
056248,000311: 01,3765 33565 CA RTRNCADR # THIS WILL BE OUR LAST TIME THROUGH THE
056249,000312: 01,3766 54707 TS GOLOC +2 # EVEN TABLE, SO AFTER IT GET THE NEXT
056250,000313: # GROUP
056251,000314: 01,3767 13665 TCF CONTBL2 # SO LET:S GET THE SECOND ENTRY IN THE TBL
056252,000315:
056253,000316: 01,3770 0154 TEMPPHS EQUALS MPAC
056254,000317: 01,3770 0155 TEMP2G EQUALS MPAC +1
056255,000318: 01,3770 0156 POINTER EQUALS MPAC +2
056256,000319: 01,3770 0157 TEMPSWCH EQUALS MPAC +3
056257,000320: 01,3770 0705 GOLOC EQUALS VAC5 +20D
056258,000321: 01,3770 7746 MINUS2 EQUALS NEG2
056259,000322: 01,3770 6074 OCT177 EQUALS LOW7
056260,000323:
056261,000324: 01,3770 03763 PHS2CADR GENADR PHSPART2
056262,000325: 01,3771 03541 PRT2CADR GENADR GETPART2
056263,000326: 01,3772 05277 LGCLCADR GENADR LONGCALL
056264,000327: 01,3773 05105 FVACCADR GENADR FINDVAC
056265,000328: 01,3774 05203 WTLTCADR GENADR WAITLIST
056266,000329: 01,3775 05072 NOVACADR GENADR NOVAC
056267,000330:
056268,000331:
End of include-file RESTARTS_ROUTINE.agc. Parent file is MAIN.agc