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.

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

Page 382

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

Page 383

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

Page 384

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

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