Source Code

These source-code files were obtained by digitally photographing an Artemis 72 (Apollo 15-17 Command Module) program listing from a private collection and then modifying pre-existing Comanche 55 (Apollo 11) source files to incorporate changes. Photography was by Ron Burkey, and transcription was performed by a team of volunteers. Note that the page images presented online are of reduced quality, and that additional images may be 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 072 OF AGC PROGRAM ARTEMIS 
	BY NASA 2021114-011 11:40 FEB. 26, 1971
Note that the date is the date of the printout, not the date of the program revision.

060596,000002:                                                                                                  ## Copyright:   Public domain.
060597,000003:                                                                                                  ## Filename:    RESTARTS_ROUTINE.agc
060598,000004:                                                                                                  ## Purpose:     Part of the source code for Artemis (i.e., Colossus 3),
060599,000005:                                                                                                  ##              build 072.  This is for the Command Module's (CM)
060600,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for
060601,000007:                                                                                                  ##              Apollo 15-17.
060602,000008:                                                                                                  ## Assembler:   yaYUL
060603,000009:                                                                                                  ## Contact:     Jim Lawton <jim DOT lawton AT gmail DOT com>
060604,000010:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
060605,000011:                                                                                                  ## Page Scans:  www.ibiblio.org/apollo/ScansForConversion/Artemis072/
060606,000012:                                                                                                  ## Mod history: 2009-08-18 JL   Adapted from corresponding Comanche 055 file.
060607,000013:                                                                                                  ##              2010-02-02 JL   Fixed page numbers.
060608,000014:                                                                                                  ##              2010-02-20 RSB  Un-##'d this header.
060609,000015:                                                                                                  ##              2010-04-04 JL   Added a missing # comment delimiter.
060610,000016:                                                                                                  ##              2017-02-08 RSB  Proofed comment text by diff'ing vs Comanche 55
060611,000017:                                                                                                  ##                              and/or octopus/ProoferComments as most-appropriate.
060612,000018:                                                                                                  ##              2017-03-14 RSB  Comment-text fixes noted in proofing Luminary 116.
060613,000019: 

Page 1411

060615,000021: 01,2000                                           SETLOC   RESTART                               
060616,000022: 01,2000                                           BANK                                           
060617,000023: 
060618,000024: 01,3467  E3,1436                                  EBANK=   PHSNAME1                              #  GOPROG MUST SWITCH TO THIS EBANK
060619,000025: 
060620,000026: 01,3467                                           COUNT*   $$/RSROU                              
060621,000027: 01,3467           30161        RESTARTS           CA       MPAC       +5                         #  GET GROUP NUMBER -1
060622,000028: 01,3470           60000                           DOUBLE                                         #  SAVE FOR INDEXING
060623,000029: 01,3471           54155                           TS       TEMP2G                                
060624,000030: 
060625,000031: 01,3472           33127                           CA       PHS2CADR                              #  SET UP EXIT IN CASE IT IS AN EVEN
060626,000032: 01,3473           54157                           TS       TEMPSWCH                              #  TABLE PHASE
060627,000033: 
060628,000034: 01,3474           33526                           CA       RTRNCADR                              #  TO SAVE TIME ASSUME IT WILL GET NEXT
060629,000035: 01,3475           54707                           TS       GOLOC      +2                         #  GROUP AFTER THIS
060630,000036: 
060631,000037: 01,3476           30154                           CA       TEMPPHS                               
060632,000038: 01,3477           75024                           MASK     OCT1400                               
060633,000039: 01,3500           10000                           CCS      A                                     #  IS IT A VARIABLE OR TABLE RESTART
060634,000040: 01,3501           13512                           TCF      ITSAVAR                               #  IT:S A VARIABLE RESTART
060635,000041: 
060636,000042: 01,3502           10154        GETPART2           CCS      TEMPPHS                               #  IS IT AN X.1 RESTART
060637,000043: 01,3503           10000                           CCS      A                                     
060638,000044: 01,3504           13612                           TCF      ITSATBL                               #  NO, ITS A TABLE RESTART
060639,000045: 
060640,000046: 01,3505           35053                           CA       PRIO14                                #  IT IS AN X.1 RESTART, THEREFORE START
060641,000047: 01,3506           05135        FVACCADR           TC       FINDVAC                               #  THE DISPLAY RESTART ROUTINE (=GENADR)
060642,000048: 01,3507  E3,1400                                  EBANK=   LST1                                  
060643,000049: 01,3507           03263 20063                     2CADR    INITDSP                               
060644,000050: 
060645,000051: 
060646,000052: 01,3511           03526                           TC       RTRNCADR                              #  FINISHED WITH THIS GROUP, GET NEXT ONE
060647,000053: 
060648,000054: 01,3512           75024        ITSAVAR            MASK     OCT1400                               #  IS IT TYPE B ?
060649,000055: 01,3513           10000                           CCS      A                                     
060650,000056: 01,3514           13563                           TCF      ITSLIKEB                              #  YES, IT IS TYPE B
060651,000057: 
060652,000058: 01,3515           00006                           EXTEND                                         #  STORE THE JOB (OR TASK) 2CADR FOR EXIT
060653,000059: 01,3516           50155                           NDX      TEMP2G                                
060654,000060: 01,3517           31437                           DCA      PHSNAME1                              
060655,000061: 01,3520           52706                           DXCH     GOLOC                                 
060656,000062: 
060657,000063: 01,3521           30154                           CA       TEMPPHS                               #  SEE IF THIS IS A JOB, TASK, OR A LONGCAL
060658,000064: 01,3522           74774                           MASK     OCT7                                  
060659,000065: 01,3523           67701                           AD       MINUS2                                
060660,000066: 01,3524           10000                           CCS      A                                     
060661,000067: 01,3525           13675                           TCF      ITSLNGCL                              #  ITS A LONGCALL
060662,000068: 
060663,000069: 01,3526           04651        RTRNCADR           TC       SWRETURN                              #  CANT GET HERE
060664,000070: 01,3527           13531                           TCF      ITSAWAIT                              

Page 1412

060666,000072: 01,3530           13576                           TCF      ITSAJOB                               #  ITS A JOB
060667,000073: 
060668,000074: 01,3531           33463        ITSAWAIT           CA       WTLTCADR                              #  SET UP WAITLIST CALL
060669,000075: 01,3532           54704                           TS       GOLOC      -1                         
060670,000076: 
060671,000077: 01,3533           50155                           NDX      TEMP2G                                #  DIRECTLY STORED
060672,000078: 01,3534           31260                           CA       PHSPRDT1                              
060673,000079: 01,3535           10000        TIMETEST           CCS      A                                     #  IS IT AN IMMEDIATE RESTART
060674,000080: 01,3536           24000                           INCR     A                                     #  NO,
060675,000081: 01,3537           13542                           TCF      FINDTIME                              #  FIND OUT WHEN IT SHOULD BEGIN
060676,000082: 
060677,000083: 01,3540           15470                           TCF      ITSINDIR                              #  STORED INDIRECTLY
060678,000084: 
060679,000085: 01,3541           13561                           TCF      IMEDIATE                              #  IT WANTS AN IMMEDIATE RESTART
060680,000086: 
060681,000087:                                                                                                  #  ***** THIS MUST BE IN FIXED FIXED *****
060682,000088: 
060683,000089:    4000                                           SETLOC   FFTAG2                                
060684,000090:    4000                                           BANK                                           
060685,000091: 
060686,000092:    5470                                           COUNT*   $$/RSROU                              
060687,000093:    5470           22706        ITSINDIR           LXCH     GOLOC      +1                         #  GET THE CORRECT E BANK IN CASE THIS IS
060688,000094:    5471           22006                           LXCH     BB                                    #  SWITCHED ERRASIBLE
060689,000095: 
060690,000096:    5472           50000                           NDX      A                                     #  GET THE TIME INDIRECTLY
060691,000097:    5473           30001                           CA       1                                     
060692,000098: 
060693,000099:    5474           22006                           LXCH     BB                                    #  RESTORE THE BB AND GOLOC
060694,000100:    5475           22706                           LXCH     GOLOC      +1                         
060695,000101: 
060696,000102:    5476           13542                           TCF      FINDTIME                              #  FIND OUT WHEN IT SHOULD BEGIN
060697,000103: 
060698,000104:                                                                                                  #  ***** YOU MAY RETURN TO  SWITCHED FIXED *****
060699,000105: 
060700,000106: 01,2000                                           SETLOC   RESTART                               
060701,000107: 01,2000                                           BANK                                           
060702,000108: 
060703,000109: 01,3542                                           COUNT*   $$/RSROU                              
060704,000110: 01,3542           40000        FINDTIME           COM                                            #  MAKE NEGITIVE SINCE IT WILL BE SUBTRACTD
060705,000111: 01,3543           54001                           TS       L                                     #  AND SAVE
060706,000112: 01,3544           50155                           NDX      TEMP2G                                
060707,000113: 01,3545           41257                           CS       TBASE1                                
060708,000114: 01,3546           00006                           EXTEND                                         
060709,000115: 01,3547           60025                           SU       TIME1                                 
060710,000116: 01,3550           10000                           CCS      A                                     
060711,000117: 01,3551           40000                           COM                                            
060712,000118: 01,3552           67663                           AD       OCT37776                              
060713,000119: 01,3553           64770                           AD       ONE                                   
060714,000120: 01,3554           60001                           AD       L                                     
060715,000121: 01,3555           10000                           CCS      A                                     

Page 1413

060717,000123: 01,3556           34772                 -3        CAF      ZERO                                  
060718,000124: 01,3557           13561                           TCF      +2                                    
060719,000125: 01,3560           13561                           TCF      +1                                    
060720,000126: 01,3561           64770        IMEDIATE           AD       ONE                                   
060721,000127: 01,3562           00704                           TC       GOLOC      -1                         
060722,000128: 01,3563           33526        ITSLIKEB           CA       RTRNCADR                              #  TYPE B, SO STORE RETURN IN
060723,000129: 01,3564           54157                           TS       TEMPSWCH                              #  TEMPSWCH IN CASE OF AN EVEN PHASE
060724,000130: 
060725,000131: 01,3565           33133                           CA       PRT2CADR                              #  SET UP EXIT TO GET TABLE PART OF THIS
060726,000132: 01,3566           54707                           TS       GOLOC      +2                         #  VARIABLE TYPE OF PHASE
060727,000133: 
060728,000134: 01,3567           30154                           CA       TEMPPHS                               #  MAKE THE PHASE LOOK RIGHT FOR THE TABLE
060729,000135: 01,3570           76043                           MASK     OCT177                                #  PART OF THIS VARIABLE PHASE
060730,000136: 01,3571           54154                           TS       TEMPPHS                               
060731,000137: 
060732,000138: 01,3572           00006                           EXTEND                                         
060733,000139: 01,3573           50155                           NDX      TEMP2G                                #  OBTAIN THE JOB:S 2CADR
060734,000140: 01,3574           31437                           DCA      PHSNAME1                              
060735,000141: 01,3575           52706                           DXCH     GOLOC                                 
060736,000142: 
060737,000143: 01,3576           50155        ITSAJOB            NDX      TEMP2G                                #  NOW ADD THE PRIORITY AND LET:S GO
060738,000144: 01,3577           31260                           CA       PHSPRDT1                              
060739,000145: 01,3600           54704        CHKNOVAC           TS       GOLOC      -1                         #  SAVE PRIO UNTIL WE SEE IF ITS
060740,000146: 01,3601           00006                           EXTEND                                         #  A FINDVAC OR A NOVAC
060741,000147: 01,3602           63606                           BZMF     ITSNOVAC                              
060742,000148: 
060743,000149: 01,3603           33506                           CAF      FVACCADR                              #  POSITIVE, SET UP FINDVAC CALL.
060744,000150: 01,3604           56704                           XCH      GOLOC      -1                         #  PICK UP PRIO,
060745,000151: 01,3605           00704                           TC       GOLOC      -1                         #  AND GO
060746,000152: 
060747,000153: 01,3606           35310        ITSNOVAC           CAF      NOVACADR                              #  NEGATIVE,
060748,000154: 01,3607           56704                           XCH      GOLOC      -1                         #  SET UP NOVAC CALL,
060749,000155: 01,3610           40000                           COM                                            #  CORRECT PRIO,
060750,000156: 01,3611           00704                           TC       GOLOC      -1                         #  AND GO
060751,000157: 
060752,000158: 01,3612           54020        ITSATBL            TS       CYR                                   #  FIND OUT IF THE PHASE IS ODD OR EVEN
060753,000159: 01,3613           10020                           CCS      CYR                                   
060754,000160: 01,3614           13615                           TCF      +1                                    #  IT:S EVEN
060755,000161: 01,3615           13713                           TCF      ITSEVEN                               
060756,000162: 
060757,000163: 01,3616           33526                           CA       RTRNCADR                              #  IN CASE THIS IS THE SECOND PART OF A
060758,000164: 01,3617           54707                           TS       GOLOC      +2                         #  TYPE B RESTART, WE NEED PROPER EXIT
060759,000165: 
060760,000166: 01,3620           30154                           CA       TEMPPHS                               #  SET UP POINTER FOR FINDING OUR PLACE IN
060761,000167: 01,3621           54021                           TS       SR                                    #  THE RESTART TABLES
060762,000168: 01,3622           60021                           AD       SR                                    
060763,000169: 01,3623           50155                           NDX      TEMP2G                                
060764,000170: 01,3624           62001                           AD       SIZETAB    +1                         
060765,000171: 01,3625           54156                           TS       POINTER                               

Page 1414

060767,000173: 
060768,000174: 01,3626           00006        CONTBL2            EXTEND                                         #  FIND OUT WHAT:S IN THE TABLE
060769,000175: 01,3627           50156                           NDX      POINTER                               
060770,000176: 01,3630           32002                           DCA      CADRTAB                               #  GET THE 2CADR
060771,000177: 
060772,000178: 01,3631           22706                           LXCH     GOLOC      +1                         #  STORE THE BB INFORMATION
060773,000179: 
060774,000180: 01,3632           10000                           CCS      A                                     #  IS IT A JOB OR IS IT TIMED
060775,000181: 01,3633           24000                           INCR     A                                     #  POSITIVE, MUST BE A JOB
060776,000182: 01,3634           13707                           TCF      ITSAJOB2                              
060777,000183: 
060778,000184: 01,3635           24000                           INCR     A                                     #  MUST BE EITHER A WAITLIST OR LONGCALL
060779,000185: 01,3636           54705                           TS       GOLOC                                 #  LET-S STORE THE CORRECT CADR
060780,000186: 
060781,000187: 01,3637           33463                           CA       WTLTCADR                              #  SET UP OUR EXIT TO WAITLIST
060782,000188: 01,3640           54704                           TS       GOLOC      -1                         
060783,000189: 
060784,000190: 01,3641           30706                           CA       GOLOC      +1                         #  NOW FIND OUT IF IT IS A WAITLIST CALL
060785,000191: 01,3642           74757                           MASK     BIT10                                 #  THIS SHOULD BE ONE IF WE HAVE -BB
060786,000192: 01,3643           10000                           CCS      A                                     #  FOR THAT MATTER SO SHOULD BE BITS 9,8,7,
060787,000193:                                                                                                  #  6,5, AND LAST BUT NOT LEAST (PERHAPS NOT
060788,000194:                                                                                                  #  IN IMPORTANCE ANYWAY. BIT 4
060789,000195: 01,3644           13702                           TCF      ITSWTLST                              #  IT IS A WAITLIST CALL
060790,000196: 
060791,000197: 01,3645           50156                           NDX      POINTER                               #  OBTAIN THE ORIGINAL DELTA T
060792,000198: 01,3646           32000                           CA       PRDTTAB                               #  ADDRESS FOR THIS LONGCALL
060793,000199: 
060794,000200: 01,3647           15477                           TCF      ITSLGCL1                              #  NOW GO GET THE DELTA TIME
060795,000201: 
060796,000202:                                                                                                  #  ***** THIS MUST BE IN FIXED FIXED *****
060797,000203: 
060798,000204:    4000                                           SETLOC   FFTAG2                                
060799,000205:    4000                                           BANK                                           
060800,000206: 
060801,000207:    5477                                           COUNT*   $$/RSROU                              
060802,000208:    5477           22706        ITSLGCL1           LXCH     GOLOC      +1                         #  OBTAIN THE CORRECT E BANK
060803,000209:    5500           22006                           LXCH     BB                                    
060804,000210:    5501           22706                           LXCH     GOLOC      +1                         #  AND PRESERVE OUR E AND F BANKS
060805,000211: 
060806,000212:    5502           00006                           EXTEND                                         #  GET THE DELTA TIME
060807,000213:    5503           50000                           NDX      A                                     
060808,000214:    5504           30001                           DCA      0                                     
060809,000215:    5505           22706                           LXCH     GOLOC      +1                         #  RESTORE OUR E AND F BANK
060810,000216:    5506           22006                           LXCH     BB                                    #  RESTORE THE TASKS E AND F BANKS
060811,000217:    5507           22706                           LXCH     GOLOC      +1                         #  AND PRESERVE OUR L
060812,000218: 
060813,000219:    5510           13650                           TCF      ITSLGCL2                              #  NOW LET:S PROCESS THIS LONGCALL
060814,000220: 
060815,000221:                                                                                                  #  ***** YOU MAY RETURN TO  SWITCHED FIXED *****
060816,000222: 

Page 1415

060818,000224: 01,2000                                           SETLOC   RESTART                               
060819,000225: 01,2000                                           BANK                                           
060820,000226: 
060821,000227: 01,3650                                           COUNT*   $$/RSROU                              
060822,000228: 01,3650           53305        ITSLGCL2           DXCH     LONGTIME                              
060823,000229: 
060824,000230: 01,3651           00006                           EXTEND                                         #  CALCULATE TIME LEFT
060825,000231: 01,3652           40025                           DCS      TIME2                                 
060826,000232: 01,3653           21305                           DAS      LONGTIME                              
060827,000233: 01,3654           00006                           EXTEND                                         
060828,000234: 01,3655           31303                           DCA      LONGBASE                              
060829,000235: 01,3656           21305                           DAS      LONGTIME                              
060830,000236: 
060831,000237: 01,3657           11304                           CCS      LONGTIME                              #  FIND OUT HOW THIS SHOULD BE RESTARTED
060832,000238: 01,3660           13670                           TCF      LONGCLCL                              
060833,000239: 01,3661           13663                           TCF      +2                                    
060834,000240: 01,3662           13556                           TCF      IMEDIATE   -3                         
060835,000241: 01,3663           11305                           CCS      LONGTIME   +1                         
060836,000242: 01,3664           13670                           TCF      LONGCLCL                              
060837,000243: 01,3665           13666                           NOOP                                           #  CAN:T GET HERE    *********
060838,000244: 01,3666           13556                           TCF      IMEDIATE   -3                         
060839,000245: 01,3667           13561                           TCF      IMEDIATE                              
060840,000246: 
060841,000247: 01,3670           33137        LONGCLCL           CA       LGCLCADR                              #  WE WILL GO TO LONGCALL
060842,000248: 01,3671           54704                           TS       GOLOC      -1                         
060843,000249: 
060844,000250: 01,3672           00006                           EXTEND                                         #  PREPARE OUR ENTRY TO LONGCALL
060845,000251: 01,3673           31305                           DCA      LONGTIME                              
060846,000252: 01,3674           00704                           TC       GOLOC      -1                         
060847,000253: 
060848,000254: 01,3675           33463        ITSLNGCL           CA       WTLTCADR                              #  ASSUME IT WILL GO TO WAITLIST
060849,000255: 01,3676           54704                           TS       GOLOC      -1                         
060850,000256: 
060851,000257: 01,3677           50155                           NDX      TEMP2G                                
060852,000258: 01,3700           41260                           CS       PHSPRDT1                              #  GET THE DELTA T ADDRESS
060853,000259: 
060854,000260: 01,3701           15477                           TCF      ITSLGCL1                              #  NOW GET THE DELTA TIME
060855,000261: 
060856,000262: 01,3702           40706        ITSWTLST           CS       GOLOC      +1                         #  CORRECT THE BBCON INFORMATION
060857,000263: 01,3703           54706                           TS       GOLOC      +1                         
060858,000264: 
060859,000265: 01,3704           50156                           NDX      POINTER                               #  GET THE DT AND FIND OUT IF IT WAS STORED
060860,000266: 01,3705           32000                           CA       PRDTTAB                               #  DIRECTLY OR INDIRECTLY
060861,000267: 
060862,000268: 01,3706           13535                           TCF      TIMETEST                              #  FIND OUT HOW THE TIME IS STORED
060863,000269: 
060864,000270: 01,3707           56705        ITSAJOB2           XCH      GOLOC                                 #  STORE THE CADR
060865,000271: 
060866,000272: 01,3710           50156                           NDX      POINTER                               #  ADD THE PRIORITY AND LET:S GO
060867,000273: 01,3711           32000                           CA       PRDTTAB                               
060868,000274: 

Page 1416

060870,000276: 01,3712           13600                           TCF      CHKNOVAC                              
060871,000277: 
060872,000278: 01,3713           30157        ITSEVEN            CA       TEMPSWCH                              #  SET UP FOR EITHER THE SECOND PART OF THE
060873,000279: 01,3714           54707                           TS       GOLOC      +2                         #  TABLE, OR A RETURN FOR THE NEXT GROUP
060874,000280: 
060875,000281: 01,3715           50155                           NDX      TEMP2G                                #  SET UP POINTER FOR OUR LOCATION WITHIN
060876,000282: 01,3716           32000                           CA       SIZETAB                               #  THE TABLE
060877,000283: 01,3717           60154                           AD       TEMPPHS                               #  THIS MAY LOOK BAD BUT LET:S SEE YOU DO
060878,000284: 01,3720           60154                           AD       TEMPPHS                               #  BETTER IN TIME OR NUMBERR OF LOCATIONS
060879,000285: 01,3721           60154                           AD       TEMPPHS                               
060880,000286: 01,3722           54156                           TS       POINTER                               
060881,000287: 
060882,000288: 01,3723           13626                           TCF      CONTBL2                               #  NOW PROCESS WHAT IS IN THE TABLE
060883,000289: 
060884,000290: 01,3724           36214        PHSPART2           CA       THREE                                 #  SET THE POINTER FOR THE SECOND HALF OF
060885,000291: 01,3725           26156                           ADS      POINTER                               #  THE TABLE
060886,000292: 
060887,000293: 01,3726           33526                           CA       RTRNCADR                              #  THIS WILL BE OUR LAST TIME THROUGH THE
060888,000294: 01,3727           54707                           TS       GOLOC      +2                         #  EVEN TABLE, SO AFTER IT GET THE NEXT
060889,000295:                                                                                                  #  GROUP
060890,000296: 01,3730           13626                           TCF      CONTBL2                               #  SO LET:S GET THE SECOND ENTRY IN THE TBL
060891,000297: 
060892,000298: 01,3731     0154               TEMPPHS            EQUALS   MPAC                                  
060893,000299: 01,3731     0155               TEMP2G             EQUALS   MPAC       +1                         
060894,000300: 01,3731     0156               POINTER            EQUALS   MPAC       +2                         
060895,000301: 01,3731     0157               TEMPSWCH           EQUALS   MPAC       +3                         
060896,000302: 01,3731     7701               MINUS2             EQUALS   NEG2                                  
060897,000303: 01,3731     6043               OCT177             EQUALS   LOW7                                  
060898,000304: 

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