Source Code

These source-code files derive from a printout of Luminary 210 (Apollo 15-17 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Jim Lawton, and transcribed to source code by a team of volunteers. This colorized, syntax-highlighted form was created by assembling that transcribed source code. Note that the full page images are available on the Virtual AGC project page at archive.org, while reduced-size images are presented at the VirtualAGC project website. Report or fix any transcription errors at the Virtual AGC project code repository.

Notations on the program listing read, in part:

	GAP: ASSEMBLE REVISION 210 OF AGC PROGRAM LUMINARY 
	BY NASA 2021112-161 17:11 MAR. 19,1971
Note that the date is the date of the printout, not the date of the program revision.

016675,000002:                                                                                                  ## Copyright:   Public domain.
016676,000003:                                                                                                  ## Filename:    SYSTEM_TEST_STANDARD_LEAD_INS.agc
016677,000004:                                                                                                  ## Purpose:     A section of Luminary revision 210.
016678,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
016679,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 15-17.
016680,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
016681,000008:                                                                                                  ##              that the code format has been changed to conform to the
016682,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
016683,000010:                                                                                                  ##              original YUL assembler.
016684,000011:                                                                                                  ## Reference:   pp. 382-384
016685,000012:                                                                                                  ## Assembler:   yaYUL
016686,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
016687,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
016688,000015:                                                                                                  ## Mod history: 2016-11-17 JL   Created from Luminary131 version.
016689,000016:                                                                                                  ##              2016-11-25 HG   Transcribed
016690,000017:                                                                                                  ##              2016-12-23 RSB  Proofed comment text with octopus/ProoferComments
016691,000018:                                                                                                  ##                              and fixed all errors found.
016692,000019: 

Page 382

016694,000021: 22,3242  E5,1642                                  EBANK=   XSM                                   
016695,000022: 
016696,000023: 33,2113                                           BANK     33                                    
016697,000024: 04,2000                                           SETLOC   E/PROG                                
016698,000025: 04,2000                                           BANK                                           
016699,000026: 
016700,000027: 04,2617                                           COUNT*   $$/P07                                
016701,000028: 
016702,000029:                                                                                                  #           SPECIAL PROGRAMS TO EASE THE PANGS OF ERASABLE MEMORY PROGRAMS.
016703,000030: 
016704,000031:                                                                                                  #  E/BKCALL   FOR DOING BANKCALLS FROM AND RETURNING TO ERASABLE.
016705,000032: 
016706,000033:                                                                                                  #           THIS ROUTINE IS CALLABLE FROM ERASABLE OR FIXED.  LIKE BANKCALL, HOWEVER, SWITCHING BETWEEN S3 AND S4
016707,000034:                                                                                                  #  IS NOT POSSIBLE.
016708,000035: 
016709,000036:                                                                                                  #           THE CALLING SEQUENCE IS:
016710,000037: 
016711,000038:                                                                                                  #                                                   TC     BANKCALL
016712,000039:                                                                                                  #                                                   CADR   E/BKCALL
016713,000040:                                                                                                  #                                                   CADR   ROUTINE         WHERE YOU WANT TO GO IN FIXED.
016714,000041:                                                                                                  #                                                   RETURN HERE FROM DISPLAY TERMINATE, BAD STALL OR TC Q.
016715,000042:                                                                                                  #                                                   RETURN HERE FROM DISPLAY PROCEED OR GOOD RETURN FROM STALL.
016716,000043:                                                                                                  #                                                   RETURN HERE FROM DISPLAY ENTER OR RECYCLE.
016717,000044: 
016718,000045:                                                                                                  #           THIS ROUTINE REQUIRES TWO ERASABLES (EBUF2, +1) IN UNSWITCHED WHICH ARE UNSHARED BY INTERRUPTS AND
016719,000046:                                                                                                  #  OTHER EMEMORY PROGRAMS.
016720,000047: 
016721,000048:                                                                                                  #           A + L ARE PRESERVED THROUGH BANKCALL AND E/BKCALL.
016722,000049: 
016723,000050: 04,2617           52134        E/BKCALL           DXCH     BUF2                                  #  SAVE A,L AND GET DP RETURN.
016724,000051: 04,2620           53167                           DXCH     EBUF2                                 #  SAVE DP RETURN.
016725,000052: 04,2621           25166                           INCR     EBUF2                                 #  RETURN +1 BECAUSE DOUBLE CADR.
016726,000053: 04,2622           30006                           CA       BBANK                                 
016727,000054: 04,2623           75003                           MASK     LOW10                                 #  GET CURRENT EBANK.  (SBANK SOMEDAY)
016728,000055: 04,2624           27167                           ADS      EBUF2      +1                         #  FORM BBCON.  (WAS FBANK)
016729,000056: 04,2625           51166                           NDX      EBUF2                                 
016730,000057: 04,2626           27777                           CA       0          -1                         #  GET CADR OF ROUTINE.
016731,000058: 04,2627           04613                           TC       SWCALL                                #  GO TO ROUTINE, SETTING Q TO SWRETURN
016732,000059:                                                                                                  #  AND RESTORING A + L.
016733,000060: 04,2630           02634                           TC       +4                                    #  TX Q, V34, OR BAD STALL RETURN.
016734,000061: 04,2631           02633                           TC       +2                                    #  PROCEED OR GOOD STALL RETURN.
016735,000062: 04,2632           25166                           INCR     EBUF2                                 #  ENTER OR RECYCLE RETURN.
016736,000063: 04,2633           25166                           INCR     EBUF2                                 
016737,000064: 04,2634           53167        E/SWITCH           DXCH     EBUF2                                 
016738,000065: 04,2635           52006                           DTCB                                           
016739,000066: 

Page 383

016741,000068:                                                                                                  #  E/CALL          FOR CALLING A FIXED MEMORY INTERPRETIVE SUBROUTINE FROM ERASABLE AND RETURNING TO ERASABLE.
016742,000069: 
016743,000070:                                                                                                  #           THE CALLING SEQUENCE IS...
016744,000071: 
016745,000072:                                                                                                  #                                                   RTB
016746,000073:                                                                                                  #                                                          E/CALL
016747,000074:                                                                                                  #                                                   CADR   ROUTINE            THE INTERPRETIVE SUBROUTINE YOU WANT.
016748,000075:                                                                                                  #                                                                             RETURNS HERE IN INTERPRETIVE.
016749,000076: 
016750,000077: 04,2636           22164        E/CALL             LXCH     LOC                                   #  ADRES -1 OF CADR.
016751,000078: 04,2637           50001                           INDEX    L                                     
016752,000079: 04,2640           30001                           CA       L                                     #  CADR IN A.
016753,000080: 04,2641           24001                           INCR     L                                     
016754,000081: 04,2642           24001                           INCR     L                                     #  RETURN ADRES IN L.
016755,000082: 04,2643           53167                           DXCH     EBUF2                                 #  STORE CADR AND RETURN.
016756,000083: 04,2644           06060                           TC       INTPRET                               
016757,000084: 04,2645           77624                           CALL                                           
016758,000085: 04,2646           01166                                    EBUF2                                 #  INDIRECTLY EXECUTE ROUTINE.  IT MUST
016759,000086: 04,2647           77776                           EXIT                                           #  LEAVE VIA RVQ OR EQUIVALENT.
016760,000087: 04,2650           23167                           LXCH     EBUF2      +1                         #  PICK UP RETURN.
016761,000088: 04,2651           16062                           TCF      INTPRET    +2                         #  SET LOC AND RETURN TO CALLER.
016762,000089: 

Page 384

016764,000091:                                                                                                  #  E/JOBWAK        FOR WAKING UP ERASABLE MEMORY JOBS.
016765,000092: 
016766,000093:                                                                                                  #           THIS ROUTINE MUST BE CALLED IN INTERRUPT OR WITH INTERRUPTS INHIBITED.
016767,000094: 
016768,000095:                                                                                                  #           THE CALLING SEQUENCE IS:
016769,000096: 
016770,000097:                                                                                                  #                                                      INHINT
016771,000098:                                                                                                  #                                                        .
016772,000099:                                                                                                  #                                                        .
016773,000100:                                                                                                  #                                                      CA      WAKEADR         ADDRESS OF SLEEPING JOB
016774,000101:                                                                                                  #                                                      TC      IBNKCALL
016775,000102:                                                                                                  #                                                      CADR    E/JOBWAK
016776,000103:                                                                                                  #                                                        .                     RETURNS HERE
016777,000104:                                                                                                  #                                                        .
016778,000105:                                                                                                  #                                                        .
016779,000106:                                                                                                  #                                                      RELINT                  IF YOU DID AN INHINT.
016780,000107: 
016781,000108: 33,2113                                           BANK     33                                    
016782,000109: 04,2000                                           SETLOC   E/PROG                                
016783,000110: 04,2000                                           BANK                                           
016784,000111: 
016785,000112: 04,2652                                           COUNT*   $$/P07                                
016786,000113: 
016787,000114: 04,2652           05130        E/JOBWAK           TC       JOBWAKE                               #  ARRIVE IWTH ADRES IN A.
016788,000115: 04,2653           44732                           CS       BIT11                                 
016789,000116: 04,2654           50064                           NDX      LOCCTR                                
016790,000117: 04,2655           26164                           ADS      LOC                                   #  KNOCK FIXED MEMORY BIT OUT OF ADRES.
016791,000118: 04,2656           00072                           TC       RUPTREG3                              #  RETURN
016792,000119: 

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