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.

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

Page 1411

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

Page 1412

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

Page 1413

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

Page 1414

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

Page 1415

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

Page 1416

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

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