Source Code
These source code files are an attempted reconstruction of Sundance revision 306, the Apollo 9
LM (Lunar Module) AGC (Apollo Guidance Computer) flight software, created from binary dumps of
original core rope program modules, as follows:
|
051216,000002: ## Copyright: Public domain.
051217,000003: ## Filename: RESTARTS_ROUTINE.agc
051218,000004: ## Purpose: A section of an attempt to reconstruct Sundance revision 306
051219,000005: ## as closely as possible with available information. Sundance
051220,000006: ## 306 is the source code for the Lunar Module's (LM) Apollo
051221,000007: ## Guidance Computer (AGC) for Apollo 9. This program was created
051222,000008: ## using the mixed-revision SundanceXXX as a starting point, and
051223,000009: ## pulling back features from Luminary 69 believed to have been
051224,000010: ## added based on memos, checklists, observed address changes,
051225,000011: ## or the Sundance GSOPs.
051226,000012: ## Assembler: yaYUL
051227,000013: ## Contact: Ron Burkey <info@sandroid.org>.
051228,000014: ## Website: www.ibiblio.org/apollo/index.html
051229,000015: ## Mod history: 2020-07-24 MAS Created from SundanceXXX.
051230,000016:
051231,000017:
051232,000018:
051233,000019: 01,3314 BANK 01
051234,000020: 01,2000 SETLOC RESTART
051235,000021: 01,2000 BANK
051236,000022:
051237,000023: 01,3314 E3,1436 EBANK= PHSNAME1 # GOPROG MUST SWITCH TO THIS EBANK
051238,000024:
051239,000025: 01,3314 COUNT* $$/RSROU
051240,000026: 01,3314 30161 RESTARTS CA MPAC +5 # GET GROUP NUMBER -1
051241,000027: 01,3315 60000 DOUBLE # SAVE FOR INDEXING
051242,000028: 01,3316 54155 TS TEMP2G
051243,000029:
051244,000030: 01,3317 33556 CA PHS2CADR # SET UP EXIT IN CASE IT IS AN EVEN
051245,000031: 01,3320 54157 TS TEMPSWCH # TABLE PHASE
051246,000032:
051247,000033: 01,3321 33353 CA RTRNCADR # TO SAVE TIME ASSUME IT WILL GET NEXT
051248,000034: 01,3322 54707 TS GOLOC +2 # GROUP AFTER THIS
051249,000035:
051250,000036: 01,3323 30154 CA TEMPPHS
051251,000037: 01,3324 75057 MASK OCT1400
051252,000038: 01,3325 10000 CCS A # IS IT A VARIABLE OR TABLE RESTART
051253,000039: 01,3326 13337 TCF ITSAVAR # IT:S A VARIABLE RESTART
051254,000040:
051255,000041: 01,3327 10154 GETPART2 CCS TEMPPHS # IS IT AN X.1 RESTART
051256,000042: 01,3330 10000 CCS A
051257,000043: 01,3331 13437 TCF ITSATBL # NO, ITS A TABLE RESTART
051258,000044:
051259,000045: 01,3332 35074 CA PRIO14 # IT IS AN X.1 RESTART, THEREFORE START
051260,000046: 01,3333 05155 TC FINDVAC # THE DISPLAY RESTART JOB
051261,000047: 01,3334 E3,1400 EBANK= LST1
051262,000048: 01,3334 02735 20103 2CADR INITDSP
051263,000049:
051264,000050: 01,3336 03353 TC RTRNCADR # FINISHED WITH THIS GROUP, GET NEXT ONE
051265,000051:
051266,000052: 01,3337 75057 ITSAVAR MASK OCT1400 # IS IT TYPE B ?
051267,000053: 01,3340 10000 CCS A
051268,000054: 01,3341 13410 TCF ITSLIKEB # YES, IT IS TYPE B
051269,000055:
051270,000056: 01,3342 00006 EXTEND # STORE THE JOB (OR TASK) 2CADR FOR EXIT
051271,000057: 01,3343 50155 NDX TEMP2G
051272,000058: 01,3344 31437 DCA PHSNAME1
051273,000059: 01,3345 52706 DXCH GOLOC
051274,000060:
051275,000061: 01,3346 30154 CA TEMPPHS # SEE IF THIS IS A JOB, TASK, OR A LONGCAL
051276,000062: 01,3347 75032 MASK OCT7
051277,000063: 01,3350 67720 AD MINUS2
051278,000064: 01,3351 10000 CCS A
051279,000065: 01,3352 13522 TCF ITSLNGCL # ITS A LONGCALL
051280,000066:
051281,000067: 01,3353 04670 RTRNCADR TC SWRETURN # CANT GET HERE
051282,000068: 01,3354 13356 TCF ITSAWAIT
051283,000069:
051284,000070: 01,3355 13423 TCF ITSAJOB # ITS A JOB
051285,000071:
051286,000072: 01,3356 33562 ITSAWAIT CA WTLTCADR # SET UP WAITLIST CALL
051287,000073: 01,3357 54704 TS GOLOC -1
051288,000074:
051289,000075: 01,3360 50155 NDX TEMP2G # DIRECTLY STORED
051290,000076: 01,3361 31055 CA PHSPRDT1
051291,000077: 01,3362 10000 TIMETEST CCS A # IS IT AN IMMEDIATE RESTART
051292,000078: 01,3363 24000 INCR A # NO,
051293,000079: 01,3364 13367 TCF FINDTIME # FIND OUT WHEN IT SHOULD BEGIN
051294,000080:
051295,000081: 01,3365 15535 TCF ITSINDIR # STORED INDIRECTLY
051296,000082:
051297,000083: 01,3366 13406 TCF IMEDIATE # IT WANTS AN IMMEDIATE RESTART
051298,000084:
051299,000085: # ***** THIS MUST BE IN FIXED FIXED *****
051300,000086:
051301,000087: 5535 BLOCK 02
051302,000088: 4000 SETLOC FFTAG2
051303,000089: 4000 BANK
051304,000090:
051305,000091: 5535 COUNT* $$/RSROU
051306,000092: 5535 22706 ITSINDIR LXCH GOLOC +1 # GET THE CORRECT E BANK IN CASE THIS IS
051307,000093: 5536 22006 LXCH BB # SWITCHED ERRASIBLE
051308,000094:
051309,000095: 5537 50000 NDX A # GET THE TIME INDIRECTLY
051310,000096: 5540 30001 CA 1
051311,000097:
051312,000098: 5541 22006 LXCH BB # RESTORE THE BB AND GOLOC
051313,000099: 5542 22706 LXCH GOLOC +1
051314,000100:
051315,000101: 5543 13367 TCF FINDTIME # FIND OUT WHEN IT SHOULD BEGIN
051316,000102:
051317,000103: # ***** YOU MAY RETURN TO SWITCHED FIXED *****
051318,000104:
051319,000105: 01,3367 BANK 01
051320,000106: 01,2000 SETLOC RESTART
051321,000107: 01,2000 BANK
051322,000108:
051323,000109: 01,3367 COUNT* $$/RSROU
051324,000110: 01,3367 40000 FINDTIME COM # MAKE NEGITIVE SINCE IT WILL BE SUBTRACTD
051325,000111: 01,3370 54001 TS L # AND SAVE
051326,000112: 01,3371 50155 NDX TEMP2G
051327,000113: 01,3372 41054 CS TBASE1
051328,000114: 01,3373 00006 EXTEND
051329,000115: 01,3374 60025 SU TIME1
051330,000116: 01,3375 10000 CCS A
051331,000117: 01,3376 40000 COM
051332,000118: 01,3377 67703 AD OCT37776
051333,000119: 01,3400 65026 AD ONE
051334,000120: 01,3401 60001 AD L
051335,000121: 01,3402 10000 CCS A
051336,000122: 01,3403 35030 CA ZERO
051337,000123: 01,3404 13406 TCF +2
051338,000124: 01,3405 13406 TCF +1
051339,000125: 01,3406 65026 IMEDIATE AD ONE
051340,000126: 01,3407 00704 TC GOLOC -1
051341,000127: 01,3410 33353 ITSLIKEB CA RTRNCADR # TYPE B, SO STORE RETURN IN
051342,000128: 01,3411 54157 TS TEMPSWCH # TEMPSWCH IN CASE OF AN EVEN PHASE
051343,000129:
051344,000130: 01,3412 33557 CA PRT2CADR # SET UP EXIT TO GET TABLE PART OF THIS
051345,000131: 01,3413 54707 TS GOLOC +2 # VARIABLE TYPE OF PHASE
051346,000132:
051347,000133: 01,3414 30154 CA TEMPPHS # MAKE THE PHASE LOOK RIGHT FOR THE TABLE
051348,000134: 01,3415 76050 MASK OCT177 # PART OF THIS VARIABLE PHASE
051349,000135: 01,3416 54154 TS TEMPPHS
051350,000136:
051351,000137: 01,3417 00006 EXTEND
051352,000138: 01,3420 50155 NDX TEMP2G # OBTAIN THE JOB:S 2CADR
051353,000139: 01,3421 31437 DCA PHSNAME1
051354,000140: 01,3422 52706 DXCH GOLOC
051355,000141:
051356,000142: 01,3423 50155 ITSAJOB NDX TEMP2G # NOW ADD THE PRIORITY AND LET:S GO
051357,000143: 01,3424 31055 CA PHSPRDT1
051358,000144: 01,3425 54704 CHKNOVAC TS GOLOC -1 # SAVE PRIO UNTIL WE SEE IF ITS
051359,000145: 01,3426 00006 EXTEND # A FINDVAC OR A NOVAC
051360,000146: 01,3427 63433 BZMF ITSNOVAC
051361,000147:
051362,000148: 01,3430 33561 CAF FVACCADR # POSITIVE, SET UP FINDVAC CALL.
051363,000149: 01,3431 56704 XCH GOLOC -1 # PICK UP PRIO,
051364,000150: 01,3432 00704 TC GOLOC -1 # AND GO
051365,000151:
051366,000152: 01,3433 33563 ITSNOVAC CAF NOVACADR # NEGATIVE,
051367,000153: 01,3434 56704 XCH GOLOC -1 # SET UP NOVAC CALL,
051368,000154: 01,3435 40000 COM # CORRECT PRIO,
051369,000155: 01,3436 00704 TC GOLOC -1 # AND GO
051370,000156:
051371,000157: 01,3437 54020 ITSATBL TS CYR # FIND OUT IF THE PHASE IS ODD OR EVEN
051372,000158: 01,3440 10020 CCS CYR
051373,000159: 01,3441 13442 TCF +1 # IT:S EVEN
051374,000160: 01,3442 13540 TCF ITSEVEN
051375,000161:
051376,000162: 01,3443 33353 CA RTRNCADR # IN CASE THIS IS THE SECOND PART OF A
051377,000163: 01,3444 54707 TS GOLOC +2 # TYPE B RESTART, WE NEED PROPER EXIT
051378,000164:
051379,000165: 01,3445 30154 CA TEMPPHS # SET UP POINTER FOR FINDING OUR PLACE IN
051380,000166: 01,3446 54021 TS SR # THE RESTART TABLES
051381,000167: 01,3447 60021 AD SR
051382,000168: 01,3450 50155 NDX TEMP2G
051383,000169: 01,3451 62001 AD SIZETAB +1
051384,000170: 01,3452 54156 TS POINTER
051385,000171:
051386,000172: 01,3453 00006 CONTBL2 EXTEND # FIND OUT WHAT:S IN THE TABLE
051387,000173: 01,3454 50156 NDX POINTER
051388,000174: 01,3455 32002 DCA CADRTAB # GET THE 2CADR
051389,000175:
051390,000176: 01,3456 22706 LXCH GOLOC +1 # STORE THE BB INFORMATION
051391,000177:
051392,000178: 01,3457 10000 CCS A # IS IT A JOB OR IS IT TIMED
051393,000179: 01,3460 24000 INCR A # POSITIVE, MUST BE A JOB
051394,000180: 01,3461 13534 TCF ITSAJOB2
051395,000181:
051396,000182: 01,3462 24000 INCR A # MUST BE EITHER A WAITLIST OR LONGCALL
051397,000183: 01,3463 54705 TS GOLOC # LET-S STORE THE CORRECT CADR
051398,000184:
051399,000185: 01,3464 33562 CA WTLTCADR # SET UP OUR EXIT TO WAITLIST
051400,000186: 01,3465 54704 TS GOLOC -1
051401,000187:
051402,000188: 01,3466 30706 CA GOLOC +1 # NOW FIND OUT IF IT IS A WAITLIST CALL
051403,000189: 01,3467 75015 MASK BIT10 # THIS SHOULD BE ONE IF WE HAVE -BB
051404,000190: 01,3470 10000 CCS A # FOR THAT MATTER SO SHOULD BE BITS 9,8,7,
051405,000191: # 6,5, AND LAST BUT NOT LEAST (PERHAPS NOT
051406,000192: # IN IMPORTANCE ANYWAY. BIT 4
051407,000193: 01,3471 13527 TCF ITSWTLST # IT IS A WAITLIST CALL
051408,000194:
051409,000195: 01,3472 50156 NDX POINTER # OBTAIN THE ORIGINAL DELTA T
051410,000196: 01,3473 32000 CA PRDTTAB # ADDRESS FOR THIS LONGCALL
051411,000197:
051412,000198: 01,3474 15544 TCF ITSLGCL1 # NOW GO GET THE DELTA TIME
051413,000199:
051414,000200: # ***** THIS MUST BE IN FIXED FIXED *****
051415,000201:
051416,000202: 5544 BLOCK 02
051417,000203: 4000 SETLOC FFTAG2
051418,000204: 4000 BANK
051419,000205:
051420,000206: 5544 COUNT* $$/RSROU
051421,000207: 5544 22706 ITSLGCL1 LXCH GOLOC +1 # OBTAIN THE CORRECT E BANK
051422,000208: 5545 22006 LXCH BB
051423,000209: 5546 22706 LXCH GOLOC +1 # AND PRESERVE OUR E AND F BANKS
051424,000210:
051425,000211: 5547 00006 EXTEND # GET THE DELTA TIME
051426,000212: 5550 50000 NDX A
051427,000213: 5551 30001 DCA 0
051428,000214:
051429,000215: 5552 22706 LXCH GOLOC +1 # RESTORE OUR E AND F BANK
051430,000216: 5553 22006 LXCH BB # RESTORE THE TASKS E AND F BANKS
051431,000217: 5554 22706 LXCH GOLOC +1 # AND PRESERVE OUR L
051432,000218: 5555 13475 TCF ITSLGCL2 # NOW LET:S PROCESS THIS LONGCALL
051433,000219:
051434,000220: # ***** YOU MAY RETURN TO SWITCHED FIXED *****
051435,000221:
051436,000222: 01,3475 BANK 01
051437,000223: 01,2000 SETLOC RESTART
051438,000224: 01,2000 BANK
051439,000225:
051440,000226: 01,3475 COUNT* $$/RSROU
051441,000227: 01,3475 53165 ITSLGCL2 DXCH LONGTIME
051442,000228:
051443,000229: 01,3476 00006 EXTEND # CALCULATE TIME LEFT
051444,000230: 01,3477 40025 DCS TIME2
051445,000231: 01,3500 21165 DAS LONGTIME
051446,000232: 01,3501 00006 EXTEND
051447,000233: 01,3502 31163 DCA LONGBASE
051448,000234: 01,3503 21165 DAS LONGTIME
051449,000235:
051450,000236: 01,3504 11164 CCS LONGTIME # FIND OUT HOW THIS SHOULD BE RESTARTED
051451,000237: 01,3505 13515 TCF LONGCLCL
051452,000238: 01,3506 13510 TCF +2
051453,000239: 01,3507 13403 TCF IMEDIATE -3
051454,000240: 01,3510 11165 CCS LONGTIME +1
051455,000241: 01,3511 13515 TCF LONGCLCL
051456,000242: 01,3512 13513 NOOP # CAN:T GET HERE *********
051457,000243: 01,3513 13403 TCF IMEDIATE -3
051458,000244: 01,3514 13406 TCF IMEDIATE
051459,000245:
051460,000246: 01,3515 33560 LONGCLCL CA LGCLCADR # WE WILL GO TO LONGCALL
051461,000247: 01,3516 54704 TS GOLOC -1
051462,000248:
051463,000249: 01,3517 00006 EXTEND # PREPARE OUR ENTRY TO LONGCALL
051464,000250: 01,3520 31165 DCA LONGTIME
051465,000251: 01,3521 00704 TC GOLOC -1
051466,000252:
051467,000253: 01,3522 33562 ITSLNGCL CA WTLTCADR # ASSUME IT WILL GO TO WAITLIST
051468,000254: 01,3523 54704 TS GOLOC -1
051469,000255:
051470,000256: 01,3524 50155 NDX TEMP2G
051471,000257: 01,3525 41055 CS PHSPRDT1 # GET THE DELTA T ADDRESS
051472,000258:
051473,000259: 01,3526 15544 TCF ITSLGCL1 # NOW GET THE DELTA TIME
051474,000260:
051475,000261: 01,3527 40706 ITSWTLST CS GOLOC +1 # CORRECT THE BBCON INFORMATION
051476,000262: 01,3530 54706 TS GOLOC +1
051477,000263:
051478,000264: 01,3531 50156 NDX POINTER # GET THE DT AND FIND OUT IF IT WAS STORED
051479,000265: 01,3532 32000 CA PRDTTAB # DIRECTLY OR INDIRECTLY
051480,000266:
051481,000267: 01,3533 13362 TCF TIMETEST # FIND OUT HOW THE TIME IS STORED
051482,000268:
051483,000269: 01,3534 56705 ITSAJOB2 XCH GOLOC # STORE THE CADR
051484,000270:
051485,000271: 01,3535 50156 NDX POINTER # ADD THE PRIORITY AND LET:S GO
051486,000272: 01,3536 32000 CA PRDTTAB
051487,000273:
051488,000274: 01,3537 13425 TCF CHKNOVAC
051489,000275:
051490,000276: 01,3540 30157 ITSEVEN CA TEMPSWCH # SET UP FOR EITHER THE SECOND PART OF THE
051491,000277: 01,3541 54707 TS GOLOC +2 # TABLE, OR A RETURN FOR THE NEXT GROUP
051492,000278:
051493,000279: 01,3542 50155 NDX TEMP2G # SET UP POINTER FOR OUR LOCATION WITHIN
051494,000280: 01,3543 32000 CA SIZETAB # THE TABLE
051495,000281: 01,3544 60154 AD TEMPPHS # THIS MAY LOOK BAD BUT LET:S SEE YOU DO
051496,000282: 01,3545 60154 AD TEMPPHS # BETTER IN TIME OR NUMBERR OF LOCATIONS
051497,000283: 01,3546 60154 AD TEMPPHS
051498,000284: 01,3547 54156 TS POINTER
051499,000285:
051500,000286: 01,3550 13453 TCF CONTBL2 # NOW PROCESS WHAT IS IN THE TABLE
051501,000287:
051502,000288: 01,3551 36221 PHSPART2 CA THREE # SET THE POINTER FOR THE SECOND HALF OF
051503,000289: 01,3552 26156 ADS POINTER # THE TABLE
051504,000290:
051505,000291: 01,3553 33353 CA RTRNCADR # THIS WILL BE OUR LAST TIME THROUGH THE
051506,000292: 01,3554 54707 TS GOLOC +2 # EVEN TABLE, SO AFTER IT GET THE NEXT
051507,000293: # GROUP
051508,000294: 01,3555 13453 TCF CONTBL2 # SO LET:S GET THE SECOND ENTRY IN THE TBL
051509,000295:
051510,000296: 01,3556 0154 TEMPPHS EQUALS MPAC
051511,000297: 01,3556 0155 TEMP2G EQUALS MPAC +1
051512,000298: 01,3556 0156 POINTER EQUALS MPAC +2
051513,000299: 01,3556 0157 TEMPSWCH EQUALS MPAC +3
051514,000300: 01,3556 0705 GOLOC EQUALS VAC5 +20D
051515,000301: 01,3556 7720 MINUS2 EQUALS NEG2
051516,000302: 01,3556 6050 OCT177 EQUALS LOW7
051517,000303:
051518,000304: 01,3556 03551 PHS2CADR GENADR PHSPART2
051519,000305: 01,3557 03327 PRT2CADR GENADR GETPART2
051520,000306: 01,3560 05347 LGCLCADR GENADR LONGCALL
051521,000307: 01,3561 05155 FVACCADR GENADR FINDVAC
051522,000308: 01,3562 05252 WTLTCADR GENADR WAITLIST
051523,000309: 01,3563 05142 NOVACADR GENADR NOVAC
051524,000310:
051525,000311:
End of include-file RESTARTS_ROUTINE.agc. Parent file is MAIN.agc