Source Code

This is an attempt to recreate Luminary 99 Rev 2, otherwise known as LUM99R2, from Luminary 99 Rev 1 and ephemeris data from Luminary 116. The differences are confined to the last 10-12 lines of the CONTROLLED CONSTANTS. Luminary 99 Rev 1 source-code was transcribed from a printout in the MIT Museum, while Luminary 116 source code was transcribed from a printout belonging to Don Eyles. AGC developer James Kernan, the "rope mother" for the Apollo 11 Lunar Module's AGC, explains as follows: "At the last minute, Dan Lickly, our chief engineer, appeared with ephemerides updates and it took two tries to get it right. The result was that we created Lum99 Revision 1 and Lum99 Revision 2." It is suspected that the former is what's in the MIT Museum, and the latter is what we are trying to recreate here. As for which revision actually flew in Apollo 11, all of the other available surviving evidence points to Rev 1 rather than to Rev 2, so we're just not sure!

057842,000002:                                                                                                  ## Copyright:   Public domain.
057843,000003:                                                                                                  ## Filename:    SERVICE_ROUTINES.agc
057844,000004:                                                                                                  ## Purpose:     Part of the source code for Luminary 1A build 099.
057845,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
057846,000006:                                                                                                  ##              Apollo Guidance Computer (AGC), for Apollo 11.
057847,000007:                                                                                                  ## Assembler:   yaYUL
057848,000008:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
057849,000009:                                                                                                  ## Website:     www.ibiblio.org/apollo.
057850,000010:                                                                                                  ## Pages:       1374-1380
057851,000011:                                                                                                  ## Mod history: 2009-05-10 SN   (Sergio Navarro).  Started adapting
057852,000012:                                                                                                  ##                              from the Luminary131/ file of the same
057853,000013:                                                                                                  ##                              name, using Luminary099 page images.
057854,000014:                                                                                                  ##              2016-12-18 RSB  Proofed text comments with octopus/ProoferComments
057855,000015:                                                                                                  ##                              and corrected the errors found.
057856,000016:                                                                                                  ##              2017-03-03 RSB  Snapshot of Luminary 99 Rev 1. 
057857,000017:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
057858,000018:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
057859,000019: 

Page 1374

057861,000021: 10,3544                                           BANK     10                                    
057862,000022: 10,2000                                           SETLOC   DISPLAYS                              
057863,000023: 10,2000                                           BANK                                           
057864,000024: 10,3544                                           COUNT*   $$/DSPLA                              
057865,000025: 
057866,000026: 10,3544           00004        UPENT2             INHINT                                         
057867,000027: 10,3545           75660                           MASK     OCT77770                              
057868,000028: 10,3546           54001                           TS       L                                     
057869,000029: 10,3547           40100                           CS       FLAGWRD4                              
057870,000030: 10,3550           70001                           MASK     L                                     
057871,000031: 10,3551           26100                           ADS      FLAGWRD4                              
057872,000032: 10,3552           00003        JOIN               RELINT                                         
057873,000033: 10,3553           16737                           TCF      Q+1                                   
057874,000034: 
057875,000035: 10,3554           00004        DOWNENT2           INHINT                                         
057876,000036: 10,3555           75660                           MASK     OCT77770                              
057877,000037: 10,3556           40000                           COM                                            
057878,000038: 10,3557           70100                           MASK     FLAGWRD4                              
057879,000039: 10,3560           54100                           TS       FLAGWRD4                              
057880,000040: 10,3561           13552                           TCF      JOIN                                  
057881,000041: 
057882,000042: 10,3562     4757               OCT7               EQUALS   SEVEN                                 
057883,000043: 

Page 1375

057885,000045:                                                                                                  #  UPFLAG AND DOWNFLAG ARE ENTIRELY GENERAL FLAG SETTING AND CLEARING SUBROUTINES.  USING THEM, WHETHER OR
057886,000046:                                                                                                  #  NOT IN INTERRUPT, ONE MAY SET OR CLEAR ANY SINGLE, NAMED BIT IN ANY ERASABLE REGISTER, SUBJECT OF COURSE TO
057887,000047:                                                                                                  #  EBANK SETTING.  A "NAMED" BIT, AS THE WORD IS USED HERE, IS ANY BIT WITH A NAME FORMALLY ASSIGNED BY THE YUL
057888,000048:                                                                                                  #  ASSEMBLER.
057889,000049: 
057890,000050:                                                                                                  #  AT PRESENT THE ONLY NAMED BITS ARE THOSE IN THE FLAGWORDS.  ASSEMBLER CHANGES WILL MAKE IT POSSIBLE TO
057891,000051:                                                                                                  #  NAME ANY BIT IN ERASABLE MEMORY.
057892,000052: 
057893,000053:                                                                                                  #  CALLING SEQUENCES ARE AS FOLLOWS :-
057894,000054:                                                                                                  #                TC      UPFLAG                  TC      DOWNFLAG
057895,000055:                                                                                                  #                ADRES   NAME OF FLAG            ADRES   NAME OF FLAG
057896,000056: 
057897,000057:                                                                                                  #  RETURN IS TO THE LOCATION FOLLOWING THE "ADRES" ABOUT .58 MS AFTER THE "TC".
057898,000058:                                                                                                  #  UPON RETURN A CONTAINS THE CURRENT FLAGWRD SETTING.
057899,000059: 
057900,000060:    5504                                           BLOCK    02                                    
057901,000061:    4000                                           SETLOC   FFTAG1                                
057902,000062:    4000                                           BANK                                           
057903,000063:    5504                                           COUNT*   $$/FLAG                               
057904,000064: 
057905,000065:    5504           30002        UPFLAG             CA       Q                                     
057906,000066:    5505           05522                           TC       DEBIT                                 
057907,000067:    5506           40000                           COM                                            #  +(15 - BIT)
057908,000068:    5507           00006                           EXTEND                                         
057909,000069:    5510           04001                           ROR      LCHAN                                 #  SET BIT
057910,000070:    5511           50061        COMFLAG            INDEX    ITEMP1                                
057911,000071:    5512           54074                           TS       FLAGWRD0                              
057912,000072:    5513           22063                           LXCH     ITEMP3                                
057913,000073:    5514           00003                           RELINT                                         
057914,000074:    5515           00001                           TC       L                                     
057915,000075: 
057916,000076:    5516           30002        DOWNFLAG           CA       Q                                     
057917,000077:    5517           05522                           TC       DEBIT                                 
057918,000078:    5520           70001                           MASK     L                                     #  RESET BIT
057919,000079:    5521           15511                           TCF      COMFLAG                               
057920,000080: 
057921,000081:    5522           64753        DEBIT              AD       ONE                                   #  GET DE BITS
057922,000082:    5523           00004                           INHINT                                         
057923,000083:    5524           54063                           TS       ITEMP3                                
057924,000084:    5525           34762                           CA       LOW4                                  #  DEC15
057925,000085:    5526           54061                           TS       ITEMP1                                
057926,000086:    5527           50063                           INDEX    ITEMP3                                
057927,000087:    5530           27777                           CA       0          -1                         #  ADRES
057928,000088:    5531           54001                           TS       L                                     
057929,000089:    5532           34755                           CA       ZERO                                  

Page 1376

057931,000091:    5533           00006                           EXTEND                                         
057932,000092:    5534           10061                           DV       ITEMP1                                #  A = FLAGWRD, L = (15 - BIT)
057933,000093:    5535           52062                           DXCH     ITEMP1                                
057934,000094:    5536           50061                           INDEX    ITEMP1                                
057935,000095:    5537           30074                           CA       FLAGWRD0                              
057936,000096:    5540           54001                           TS       L                                     #  CURRENT STATE
057937,000097:    5541           50062                           INDEX    ITEMP2                                
057938,000098:    5542           44735                           CS       BIT15                                 #  -(15 - BIT)
057939,000099:    5543           00002                           TC       Q                                     
057940,000100: 

Page 1377

057942,000102:                                                                                                  #  DELAYJOB - A GENERAL ROUTINE TO DELAY A JOB A SPECIFIC AMOUNT OF TIME BEFORE PICKING UP AGAIN.
057943,000103: 
057944,000104:                                                                                                  #  ENTRANCE REQUIREMENTS ...
057945,000105:                                                                                                  #                CAF     DT              DELAY JOB FOR DT CENTISECS
057946,000106:                                                                                                  #                TC      BANKCALL
057947,000107:                                                                                                  #                CADR    DELAYJOB
057948,000108: 
057949,000109: 06,3764                                           BANK     06                                    
057950,000110: 00,2000                                           SETLOC   DLAYJOB                               
057951,000111: 00,2000                                           BANK                                           
057952,000112: 
057953,000113:                                                                                                  #  THIS MUST REMAIN IN BANK 0 *****************************************
057954,000114: 
057955,000115: 00,3735                                           COUNT*   $$/DELAY                              
057956,000116: 00,3735           00004        DELAYJOB           INHINT                                         
057957,000117: 00,3736           54002                           TS       Q                                     #  STORE DELAY DT IN Q FOR DLY -1 IN
057958,000118: 00,3737           34752                           CAF      DELAYNUM                              #  WAITLIST
057959,000119: 00,3740           54070        DELLOOP            TS       RUPTREG1                              
057960,000120: 00,3741           50000                           INDEX    A                                     
057961,000121: 00,3742           31326                           CA       DELAYLOC                              #  IS THIS DELAYLOC AVAILABLE
057962,000122: 00,3743           00006                           EXTEND                                         
057963,000123: 00,3744           13752                           BZF      OK2DELAY                              #  YES
057964,000124: 
057965,000125: 00,3745           10070                           CCS      RUPTREG1                              #  NO, TRY NEXT DELAYLOC
057966,000126: 00,3746           13740                           TCF      DELLOOP                               
057967,000127: 
057968,000128: 00,3747           52134                           DXCH     BUF2                                  
057969,000129: 00,3750           05716                           TC       BAILOUT1                              #  NO AVAILABLE LOCS.
057970,000130: 00,3751           01104                           OCT      1104                                  
057971,000131: 
057972,000132: 00,3752           33772        OK2DELAY           CA       TCSLEEP                               #  SET WAITLIST IMMEDIATE RETURN
057973,000133: 00,3753           54061                           TS       WAITEXIT                              
057974,000134: 
057975,000135: 00,3754           30004                           CA       FBANK                                 
057976,000136: 00,3755           60070                           AD       RUPTREG1                              #  STORE BBANK FOR TASK CALL
057977,000137: 00,3756           54001                           TS       L                                     
057978,000138: 
057979,000139: 00,3757           33773                           CAF      WAKECAD                               #  STORE CADR FOR TASK CALL
057980,000140: 00,3760           15211                           TCF      DLY2       -1                         #  DLY IS IN WAITLIST ROUTINE
057981,000141: 
057982,000142: 00,3761           04645        TCGETCAD           TC       MAKECADR                              #  GET CALLERS FCADR
057983,000143: 
057984,000144: 00,3762           50070                           INDEX    RUPTREG1                              
057985,000145: 00,3763           55326                           TS       DELAYLOC                              #  SAVE DELAY CADRS
057986,000146: 
057987,000147: 00,3764           05133                           TC       JOBSLEEP                              
057988,000148: 
057989,000149: 00,3765           34755        WAKER              CAF      ZERO                                  
057990,000150: 00,3766           50006                           INDEX    BBANK                                 
057991,000151: 00,3767           57326                           XCH      DELAYLOC                              #  MAKE DELAYLOC AVAILABLE

Page 1378

057993,000153: 00,3770           05137                           TC       JOBWAKE                               
057994,000154: 
057995,000155: 00,3771           05261                           TC       TASKOVER                              
057996,000156: 
057997,000157: 00,3772           03757        TCSLEEP            GENADR   TCGETCAD   -2                         
057998,000158: 00,3773           03765        WAKECAD            GENADR   WAKER                                 
057999,000159: 

Page 1379

058001,000161:                                                                                                  #  GENTRAN, A BLOCK TRANSFER ROUTINE.
058002,000162:                                                                                                  #  WRITTEN BY D. EYLES
058003,000163:                                                                                                  #  MOD 1 BY KERNAN                               UTILITYM REV 17 11/18/67
058004,000164:                                                                                                  #  MOD 2 BY SCHULENBERG (REMOVE RELINT) SKIPPER REV 4 2/28/68
058005,000165: 
058006,000166:                                                                                                  #  THIS ROUTINE IS USEFULL FOR TRANSFERING N CONSECUTIVE ERASABLE OR FIXED QUANTITIES TO SOME OTHER N
058007,000167:                                                                                                  #  CONSECUTIVE ERASABLE LOCATIONS.  IF BOTH BLOCKS OF DATA ARE IN SWITCHABLE EBANKS, THEY MUST BE IN THE SAME ONE.
058008,000168: 
058009,000169:                                                                                                  #  GENTRAN IS CALLABLE IN A JOB AS WELL AS A RUPT.  THE CALLING SEQUENCE IS:
058010,000170:                                                                                                  #        I       CA      N-1             # OF QUANTITIES MINUS ONE.
058011,000171:                                                                                                  #        I +1    TC      GENTRAN         IN FIXED-FIXED.
058012,000172:                                                                                                  #        I +2    ADRES   L               STARTING ADRES OF DATA TO BE MOVED.
058013,000173:                                                                                                  #        I +3    ADRES   M               STARTING ADRES OF DUPLICATION BLOCK.
058014,000174:                                                                                                  #        I +4                            RETURNS HERE.
058015,000175: 
058016,000176:                                                                                                  #  GENTRAN TAKES 25 MCT'S (300 MICROSECONDS) PER ITEM + 5 MCT'S (60 MICS) FOR ENTERING AND EXITING.
058017,000177:                                                                                                  #  A, L AND ITEMP1 ARE NOT PRESERVED.
058018,000178: 
058019,000179:    5544                                           BLOCK    02                                    
058020,000180:    4000                                           SETLOC   FFTAG4                                
058021,000181:    4000                                           BANK                                           
058022,000182: 
058023,000183:    5544     0061                                  EBANK=   ITEMP1                                
058024,000184: 
058025,000185:    5544                                           COUNT*   $$/TRAN                               
058026,000186: 
058027,000187:    5544           00004        GENTRAN            INHINT                                         
058028,000188:    5545           54061                           TS       ITEMP1                                #  SAVE N-1.
058029,000189:    5546           50002                           INDEX    Q                                     #  C(Q) = ADRES L.
058030,000190:    5547           60000                           AD       0                                     #  ADRES (L + N - 1).
058031,000191:    5550           50000                           INDEX    A                                     
058032,000192:    5551           30000                           CA       0                                     #  C(ABOVE).
058033,000193:    5552           54001                           TS       L                                     #  SAVE DATA.
058034,000194:    5553           30061                           CA       ITEMP1                                
058035,000195:    5554           50002                           INDEX    Q                                     
058036,000196:    5555           60001                           AD       1                                     #  ADRES (M + N - 1).
058037,000197:    5556           50000                           INDEX    A                                     
058038,000198:    5557           22000                           LXCH     0                                     #  STUFF IT.
058039,000199:    5560           10061                           CCS      ITEMP1                                #  LOOP UNTIL N-1 = 0.
058040,000200:    5561           15545                           TCF      GENTRAN    +1                         
058041,000201:    5562           16741                           TCF      Q+2                                   #  RETURN TO CALLER.
058042,000202: 

Page 1380

058044,000204:                                                                                                  #  B5OFF         ZERO BIT 5 OF EXTVBACT, WHICH IS SET BY TESTXACT.
058045,000205:                                                                                                  #  MAY BE USED AS NEEDED BY ANY EXTENDED VERB WHICH HAS DONE TESTXACT
058046,000206: 
058047,000207:    5563                                           COUNT*   $$/EXTVB                              
058048,000208: 
058049,000209:    5563           44747        B5OFF              CS       BIT5                                  
058050,000210:    5564           71044                           MASK     EXTVBACT                              
058051,000211:    5565           55044                           TS       EXTVBACT                              
058052,000212:    5566           05155                           TC       ENDOFJOB                              
058053,000213: 
058054,000214: 
058055,000215: 

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