Source Code

These source-code files were transcribed from scans made from Don Eyles's personal copy of Luminary 069. They were scanned at archive.org's Boston facility, and the scanning was sponsored by Onno Hommes. The code was transcribed from these scans by a team of volunteers who are referenced in the program comments. Comments from the original source code are prefixed with a single '#' symbol, whereas comments added later are prefixed by "##" or "###". In some cases, where similar code blocks exist in previously-transcribed AGC programs (primarily Luminary 99, from Apollo 11) those code blocks were used as a starting point and then corrected to agree with the Luminary 69 scans. The full scans are available at the Virtual AGC project's collection at archive.org, while more-convenient reduced-size (but reduced-quality) images are available at the main Virtual AGC website. Report any errors noted by creating an issue report at the Virtual AGC project's GitHub repository. Notations on the program listing read, in part:

	GAP:  ASSEMBLE REVISION 069 OF AGC PROGRAM LUMINARY BY NASA 2021112-011
	19:02 NOV. 25,1968
Note that the date is the date of the printout, not the date of the program revision.

059342,000002:                                                                                                  ## Copyright:   Public domain.
059343,000003:                                                                                                  ## Filename:    SERVICE_ROUTINES.agc
059344,000004:                                                                                                  ## Purpose:     The main source file for Luminary revision 069.
059345,000005:                                                                                                  ##              It is part of the source code for the original release
059346,000006:                                                                                                  ##              of the flight software for the Lunar Module's (LM) Apollo
059347,000007:                                                                                                  ##              Guidance Computer (AGC) for Apollo 10. The actual flown
059348,000008:                                                                                                  ##              version was Luminary 69 revision 2, which included a
059349,000009:                                                                                                  ##              newer lunar gravity model and only affected module 2.
059350,000010:                                                                                                  ##              This file is intended to be a faithful transcription, except
059351,000011:                                                                                                  ##              that the code format has been changed to conform to the
059352,000012:                                                                                                  ##              requirements of the yaYUL assembler rather than the
059353,000013:                                                                                                  ##              original YUL assembler.
059354,000014:                                                                                                  ## Reference:   pp. 1368-1374
059355,000015:                                                                                                  ## Assembler:   yaYUL
059356,000016:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
059357,000017:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
059358,000018:                                                                                                  ## Mod history: 2016-12-13 MAS  Created from Luminary 99.
059359,000019:                                                                                                  ##              2016-12-18 MAS  Updated from comment-proofed Luminary 99 version.
059360,000020:                                                                                                  ##              2017-01-10 RRB  Updated for Luminary 69.
059361,000021:                                                                                                  ##              2017-01-21 HG   fix operand OCT 7 -> OCT7
059362,000022:                                                                                                  ##              2017-01-28 RSB  Proofed comment text using octopus/prooferComments
059363,000023:                                                                                                  ##                              and fixed errors found.
059364,000024: 

Page 1368

059366,000026: 10,3416                                           BANK     10                                    
059367,000027: 10,2000                                           SETLOC   DISPLAYS                              
059368,000028: 10,2000                                           BANK                                           
059369,000029: 10,3416                                           COUNT*   $$/DSPLA                              
059370,000030: 
059371,000031: 10,3416           54001        UPENT2             TS       L                                     #  WHICH FLAGWORD IS IT
059372,000032: 10,3417           74757                           MASK     OCT7                                  
059373,000033: 10,3420           56001                           XCH      L                                     #  SAVE IN L FOR INDEXING
059374,000034: 
059375,000035: 10,3421           75660                           MASK     OCT77770                              #  OBTAIN THE BIT INFORMATION
059376,000036: 10,3422           00004                           INHINT                                         #  PREVENT INTERUPTS
059377,000037: 10,3423           54061                           TS       ITEMP1                                #  STORE THE BIT INFORMATION TEMPORARIALY
059378,000038: 
059379,000039: 10,3424           50001                           NDX      L                                     
059380,000040: 10,3425           40074                           CS       FLAGWRD0                              
059381,000041: 10,3426           70061                           MASK     ITEMP1                                
059382,000042: 10,3427           50001                           NDX      L                                     
059383,000043: 10,3430           26074                           ADS      FLAGWRD0                              
059384,000044: 10,3431           00003                           RELINT                                         #  RELEASE INTERUPT INHIBIT
059385,000045: 
059386,000046: 10,3432           24002                           INCR     Q                                     #  OBTAIN THE CORRECT RETURN ADDRESS
059387,000047: 10,3433           00002                           TC       Q                                     #  RETURN
059388,000048: 
059389,000049: 10,3434           54001        DOWNENT2           TS       L                                     #  WHICH FLAGWORD IS IT
059390,000050: 10,3435           74757                           MASK     OCT7                                  
059391,000051: 10,3436           56001                           XCH      L                                     #  SAVE IN L FOR INDEXING
059392,000052: 
059393,000053: 10,3437           75660                           MASK     OCT77770                              #  OBTAIN THE BIT INFORMATION
059394,000054: 10,3440           40000                           COM                                            #  START TO PROCESS THE INFORMATION
059395,000055: 
059396,000056: 10,3441           00004                           INHINT                                         #  PREVENT INTERUPTS
059397,000057: 10,3442           50001                           NDX      L                                     
059398,000058: 10,3443           70074                           MASK     FLAGWRD0                              
059399,000059: 10,3444           50001                           NDX      L                                     
059400,000060: 10,3445           54074                           TS       FLAGWRD0                              
059401,000061: 10,3446           00003                           RELINT                                         #  RELEASE INTERUPT INHIBIT
059402,000062: 
059403,000063: 10,3447           24002                           INCR     Q                                     #  OBTAIN THE CORRECT RETURN ADDRESS
059404,000064: 10,3450           00002                           TC       Q                                     #  RETURN
059405,000065: 
059406,000066: 10,3451     4757               OCT7               EQUALS   SEVEN                                 
059407,000067: 

Page 1369

059409,000069:                                                                                                  #      UPFLAG AND DOWNFLAG ARE ENTIRELY GENERAL FLAG SETTING AND CLEARING SUBROUTINES.   USING THEM, WHETHER OR
059410,000070:                                                                                                  #  NOT IN INTERRUPT, ONE MAY SET OR CLEAR ANY SINGLE, NAMED BIT IN ANY ERASABLE REGISTER, SUBJECT OF COURSE TO
059411,000071:                                                                                                  #  EBANK SETTING.   A "NAMED" BIT, AS THE WORD IS USED HERE, IS ANY BIT WITH A NAME FORMALLY ASSIGNED BY THE YUL
059412,000072:                                                                                                  #  ASSEMBLER.
059413,000073: 
059414,000074:                                                                                                  #      AT PRESENT THE ONLY NAMED BITS ARE THOSE IN THE FLAGWORDS.   ASSEMBLER CHANGES WILL MAKE IT POSSIBLE TO
059415,000075:                                                                                                  #  NAME ANY BIT IN ERASABLE MEMORY.
059416,000076: 
059417,000077:                                                                                                  #      CALLING SEQUENCES ARE AS FOLLOWS :-
059418,000078:                                                                                                  #                TC      UPFLAG                  TC      DOWNFLAG
059419,000079:                                                                                                  #                ADRES   NAME OF FLAG            ADRES   NAME OF FLAG
059420,000080: 
059421,000081:                                                                                                  #      RETURN IS TO THE LOCATION FOLLOWING THE "ADRES" ABOUT .58 MS AFTER THE "TC".
059422,000082: 
059423,000083:                                                                                                  #      UPON RETURN A CONTAINS THE CURRENT FLAGWRD SETTING.
059424,000084: 
059425,000085:    5504                                           BLOCK    02                                    
059426,000086:    4000                                           SETLOC   FFTAG1                                
059427,000087:    4000                                           BANK                                           
059428,000088:    5504                                           COUNT*   $$/FLAG                               
059429,000089: 
059430,000090:    5504           30002        UPFLAG             CA       Q                                     
059431,000091:    5505           05522                           TC       DEBIT                                 
059432,000092:    5506           40000                           COM                                            #  +(15 - BIT)
059433,000093:    5507           00006                           EXTEND                                         
059434,000094:    5510           04001                           ROR      LCHAN                                 #  SET BIT
059435,000095:    5511           50061        COMFLAG            INDEX    ITEMP1                                
059436,000096:    5512           54074                           TS       FLAGWRD0                              
059437,000097:    5513           22063                           LXCH     ITEMP3                                
059438,000098:    5514           00003                           RELINT                                         
059439,000099:    5515           00001                           TC       L                                     
059440,000100: 
059441,000101:    5516           30002        DOWNFLAG           CA       Q                                     
059442,000102:    5517           05522                           TC       DEBIT                                 
059443,000103:    5520           70001                           MASK     L                                     #  RESET BIT
059444,000104:    5521           15511                           TCF      COMFLAG                               
059445,000105: 
059446,000106:    5522           64753        DEBIT              AD       ONE                                   #  GET DE BITS
059447,000107:    5523           00004                           INHINT                                         
059448,000108:    5524           54063                           TS       ITEMP3                                
059449,000109:    5525           34762                           CA       LOW4                                  #  DEC15
059450,000110:    5526           54061                           TS       ITEMP1                                
059451,000111:    5527           50063                           INDEX    ITEMP3                                
059452,000112:    5530           27777                           CA       0          -1                         #  ADRES
059453,000113:    5531           54001                           TS       L                                     
059454,000114:    5532           34755                           CA       ZERO                                  

Page 1370

059456,000116:    5533           00006                           EXTEND                                         
059457,000117:    5534           10061                           DV       ITEMP1                                #  A = FLAGWRD, L = (15 - BIT)
059458,000118:    5535           52062                           DXCH     ITEMP1                                
059459,000119:    5536           50061                           INDEX    ITEMP1                                
059460,000120:    5537           30074                           CA       FLAGWRD0                              
059461,000121:    5540           54001                           TS       L                                     #  CURRENT STATE
059462,000122:    5541           50062                           INDEX    ITEMP2                                
059463,000123:    5542           44735                           CS       BIT15                                 #  -(15 - BIT)
059464,000124:    5543           00002                           TC       Q                                     
059465,000125: 

Page 1371

059467,000127:                                                                                                  #  DELAYJOB - A GENERAL ROUTINE TO DELAY A JOB A SPECIFIC AMOUNT OF TIME BEFORE PICKING UP AGAIN.
059468,000128: 
059469,000129:                                                                                                  #  ENTRANCE REQUIREMENTS ...
059470,000130:                                                                                                  #                CAF     DT              DELAY JOB FOR DT CENTISECS
059471,000131:                                                                                                  #                TC      BANKCALL
059472,000132:                                                                                                  #                CADR    DELAYJOB
059473,000133: 
059474,000134: 06,3715                                           BANK     06                                    
059475,000135: 00,2000                                           SETLOC   DLAYJOB                               
059476,000136: 00,2000                                           BANK                                           
059477,000137: 
059478,000138:                                                                                                  #  THIS MUST REMAIN IN BANK 0 *****************************************
059479,000139: 
059480,000140: 00,3735                                           COUNT*   $$/DELAY                              
059481,000141: 00,3735           00004        DELAYJOB           INHINT                                         
059482,000142: 00,3736           54002                           TS       Q                                     #  STORE DELAY DT IN Q FOR DLY -1 IN
059483,000143: 
059484,000144: 00,3737           34752                           CAF      DELAYNUM                              #  WAITLIST
059485,000145: 00,3740           54070        DELLOOP            TS       RUPTREG1                              
059486,000146: 00,3741           50000                           INDEX    A                                     
059487,000147: 00,3742           31326                           CA       DELAYLOC                              #  IS THIS DELAYLOC AVAILABLE
059488,000148: 00,3743           00006                           EXTEND                                         
059489,000149: 00,3744           13752                           BZF      OK2DELAY                              #  YES
059490,000150: 
059491,000151: 00,3745           10070                           CCS      RUPTREG1                              #  NO, TRY NEXT DELAYLOC
059492,000152: 00,3746           13740                           TCF      DELLOOP                               
059493,000153: 
059494,000154: 00,3747           52134                           DXCH     BUF2                                  
059495,000155: 00,3750           05710                           TC       BAILOUT1                              #  NO AVAILABLE LOCS.
059496,000156: 00,3751           01104                           OCT      1104                                  
059497,000157: 
059498,000158: 00,3752           33772        OK2DELAY           CA       TCSLEEP                               #  SET WAITLIST IMMEDIATE RETURN
059499,000159: 00,3753           54061                           TS       WAITEXIT                              
059500,000160: 
059501,000161: 00,3754           30004                           CA       FBANK                                 
059502,000162: 00,3755           60070                           AD       RUPTREG1                              #  STORE BBANK FOR TASK CALL
059503,000163: 00,3756           54001                           TS       L                                     
059504,000164: 
059505,000165: 00,3757           33773                           CAF      WAKECAD                               #  STORE CADR FOR TASK CALL
059506,000166: 00,3760           15211                           TCF      DLY2       -1                         #  DLY IS IN WAITLIST ROUTINE
059507,000167: 
059508,000168: 00,3761           04645        TCGETCAD           TC       MAKECADR                              #  GET CALLERS FCADR
059509,000169: 
059510,000170: 00,3762           50070                           INDEX    RUPTREG1                              
059511,000171: 00,3763           55326                           TS       DELAYLOC                              #  SAVE DELAY CADRS
059512,000172: 
059513,000173: 00,3764           05133                           TC       JOBSLEEP                              
059514,000174: 
059515,000175: 00,3765           34755        WAKER              CAF      ZERO                                  
059516,000176: 00,3766           50006                           INDEX    BBANK                                 
059517,000177: 00,3767           57326                           XCH      DELAYLOC                              #  MAKE DELAYLOC AVAILABLE

Page 1372

059519,000179: 00,3770           05137                           TC       JOBWAKE                               
059520,000180: 
059521,000181: 00,3771           05261                           TC       TASKOVER                              
059522,000182: 
059523,000183: 00,3772           03757        TCSLEEP            GENADR   TCGETCAD   -2                         
059524,000184: 00,3773           03765        WAKECAD            GENADR   WAKER                                 
059525,000185: 

Page 1373

059527,000187:                                                                                                  #  GENTRAN, A BLOCK TRANSFER ROUTINE.
059528,000188: 
059529,000189:                                                                                                  #  WRITTEN BY D. EYLES
059530,000190:                                                                                                  #  MOD 1 BY KERNAN                               UTILITYM REV 17 11/18/67
059531,000191: 
059532,000192:                                                                                                  #  MOD 2 BY SCHULENBERG (REMOVE RELINT) SKIPPER REV 4 2/28/68
059533,000193: 
059534,000194:                                                                                                  #           THIS ROUTINE IS USEFULL FOR TRANSFERING N CONSECUTIVE ERASABLE OR FIXED QUANTITIES TO SOME OTHER N
059535,000195:                                                                                                  #  CONSECUTIVE ERASABLE LOCATIONS.  IF BOTH BLOCKS OF DATA ARE IN SWITCHABLE EBANKS, THEY MUST BE IN THE SAME ONE.
059536,000196: 
059537,000197:                                                                                                  #           GENTRAN IS CALLABLE IN A JOB AS WELL AS A RUPT.  THE CALLING SEQUENCE IS:
059538,000198:                                                                                                  #                                          I        CA    N-1              # OF QUANTITIES MINUS ONE.
059539,000199:                                                                                                  #                                          I +1     TC    GENTRAN          IN FIXED-FIXED.
059540,000200:                                                                                                  #                                          I +2     ADRES L                STARTING ADRES OF DATA TO BE MOVED.
059541,000201:                                                                                                  #                                          I +3     ADRES M                STARTING ADRES OF DUPLICATION BLOCK.
059542,000202:                                                                                                  #                                          I +4                            RETURNS HERE.
059543,000203: 
059544,000204:                                                                                                  #           GENTRAN TAKES 25 MCT'S (300 MICROSECONDS) PER ITEM + 5 MCT'S (60 MICS) FOR ENTERING AND EXITING.
059545,000205:                                                                                                  #           A, L AND ITEMP1 ARE NOT PRESERVED.
059546,000206: 
059547,000207:    5544                                           BLOCK    02                                    
059548,000208:    4000                                           SETLOC   FFTAG4                                
059549,000209:    4000                                           BANK                                           
059550,000210: 
059551,000211:    5544     0061                                  EBANK=   ITEMP1                                
059552,000212: 
059553,000213:    5544                                           COUNT*   $$/TRAN                               
059554,000214: 
059555,000215:    5544           00004        GENTRAN            INHINT                                         
059556,000216:    5545           54061                           TS       ITEMP1                                #  SAVE N-1.
059557,000217:    5546           50002                           INDEX    Q                                     #  C(Q) = ADRES L.
059558,000218:    5547           60000                           AD       0                                     #  ADRES (L + N - 1).
059559,000219:    5550           50000                           INDEX    A                                     
059560,000220:    5551           30000                           CA       0                                     #  C(ABOVE).
059561,000221:    5552           54001                           TS       L                                     #  SAVE DATA.
059562,000222:    5553           30061                           CA       ITEMP1                                
059563,000223:    5554           50002                           INDEX    Q                                     
059564,000224:    5555           60001                           AD       1                                     #  ADRES (M + N - 1).
059565,000225:    5556           50000                           INDEX    A                                     
059566,000226:    5557           22000                           LXCH     0                                     #  STUFF IT.
059567,000227:    5560           10061                           CCS      ITEMP1                                #  LOOP UNTIL N-1 = 0.
059568,000228:    5561           15545                           TCF      GENTRAN    +1                         
059569,000229:    5562           16740                           TCF      Q+2                                   #  RETURN TO CALLER.
059570,000230: 

Page 1374

059572,000232:                                                                                                  #  B5OFF   ZERO BIT 5 OF EXTVBACT, WHICH IS SET BY TESTXACT.
059573,000233:                                                                                                  #           MAY BE USED AS NEEDED BY ANY EXTENDED VERB WHICH HAS DONE TESTXACT
059574,000234: 
059575,000235:    5563                                           COUNT*   $$/EXTVB                              
059576,000236: 
059577,000237:    5563           44747        B5OFF              CS       BIT5                                  
059578,000238:    5564           71044                           MASK     EXTVBACT                              
059579,000239:    5565           55044                           TS       EXTVBACT                              
059580,000240:    5566           05155                           TC       ENDOFJOB                              
059581,000241: 
059582,000242: 
059583,000243: 

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