Source Code

This source code is very close to the Apollo Guidance Computer software for the Apollo 13 Lunar module. This revision of the Luminary 131 program is from December of 1969, whereas there was a later revision in January of 1970, and still another revision in February, which is the code that flew on the mission. As far as this transcription is concerned, it was originally from a copy made in 1991 of a printout from the collection of AGC developer Don Eyles for collector David Craig. It was subsequently scanned by Gary Neff, reprocessed for online presentation at the now-discontinued History of Recent Science and Technology (HRST) website of MIT's Dibner Institute (the full-quality scans being discarded in the process), and finally transcribed by Ron Burkey for the Virtual AGC Project. Although a high-quality replacement scan for a completely illegible page was later provided by Gary Neff, the reduced legibility of the reprocessed HRST posting nevertheless caused many errors to be introduced into the transcription. Accordingly, a second scan of the same physical printout was made in 2017 for the Virtual AGC Project's collection at the Internet Archive, and used to correct the transcription errors. All of the scanned materials mentioned, as well as other Luminary 131 related material, are available online. Don Eyles apprently made additional hand-written notes in printout between 1991 and 2017, so the two scans are not identical in that respect. The page-headings in the printout read, in part:
	GAP:  ASSEMBLE REVISION 131 OF AGC PROGRAM LUMINARY BY NASA 2021112-091
	17:53 DEC. 19, 1969
Note that the date is the date the printout was made, not the date on which the program revision was released, although these happen to be very close together.

061596,000002:                                                                                                  ## Copyright:   Public domain.
061597,000003:                                                                                                  ## Filename:    TJET_LAW.agc
061598,000004:                                                                                                  ## Purpose:     A section of Luminary 1C, revision 131.
061599,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
061600,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 13.
061601,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
061602,000008:                                                                                                  ##              that the code format has been changed to conform to the
061603,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
061604,000010:                                                                                                  ##              original YUL assembler.
061605,000011:                                                                                                  ## Reference:   pp. 1452-1461
061606,000012:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
061607,000013:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
061608,000014:                                                                                                  ## Mod history: 06/08/03 RSB.   Began transcribing.
061609,000015:                                                                                                  ##              05/14/05 RSB    Corrected website reference above.
061610,000016:                                                                                                  ##              2010-10-25 JL   Indentation fixes.
061611,000017:                                                                                                  ##              2017-01-06 RSB  Page numbers now agree with those on the
061612,000018:                                                                                                  ##                              original hardcopy, as opposed to the PDF page
061613,000019:                                                                                                  ##                              numbers in 1701.pdf.
061614,000020:                                                                                                  ##              2017-02-28 RSB  Proofed comment text using octopus/ProoferComments.
061615,000021:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
061616,000022:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
061617,000023: 

Page 1452

061619,000025:                                                                                                  #  PROGRAM DESCRIPTION
061620,000026:                                                                                                  #  DESIGNED BY:  R. D. GOSS AND P. S. WEISSMAN
061621,000027:                                                                                                  #  CODED BY:  P. S. WEISSMAN 28 FEBRUARY 1968
061622,000028: 
061623,000029:                                                                                                  #  TJETLAW IS CALLED AS A SUBROUTINE WHEN THE LEM IS NOT DOCKED AND THE AUTOPILOT IS IN THE AUTOMATIC OR
061624,000030:                                                                                                  #  ATTITUDE-HOLD MODE TO CALCULATE THE JET-FIRING-TIME (TJET) REQUIRED FOR THE AXIS INDICATED BY AXISCTR:
061625,000031:                                                                                                  #        -1      INDICATES THE P-AXIS
061626,000032:                                                                                                  #        +0      INDICATES THE U-AXIS
061627,000033:                                                                                                  #        +1      INDICATES THE V-AXIS.
061628,000034:                                                                                                  #  THE REGISTERS E AND EDOT CONTAIN THE APPROPRIATE ATTITUDE ERROR AND ERROR RATE AND SENSETYP SHOWS WHETHER
061629,000035:                                                                                                  #  UNBALANCED COUPLES ARE PREFERRED.  TJETLAW ALSO USES VARIOUS FUNCTIONS OF ACCELERATION AND DEADBAND WHICH ARE
061630,000036:                                                                                                  #  COMPUTED IN THE 1/ACCONT SECTION OF 1/ACCS AND ARE STORED IN SUCH AN ORDER THAT THEY CAN BE CONVENIENTLY
061631,000037:                                                                                                  #  ACCESSED BY INDEXING.
061632,000038: 
061633,000039:                                                                                                  #  THE SIGN OF THE REQUIRED ROTATION IS CARRIED THROUGH TJETLAW AS ROTSENSE AND IS FINALLY APPLIED TO TJET JUST
061634,000040:                                                                                                  #  PREVIOUS TO ITS STORAGE IN THE LOCATION CORRESPONDING TO THE AXIS (TJP, TJU OR TJV).  THE NUMBER OF JETS THAT
061635,000041:                                                                                                  #  TJETLAW ASSUMES WILL BE USED IS INDICATED BY THE SETTING OF NUMBERT FOR THE U- OR V-AXIS.  TWO JETS ARE ALWAYS
061636,000042:                                                                                                  #  ASSUMED FOR THE P-AXIS ALTHOUGH FOUR JETS WILL BE FIRED WHEN FIREFCT IS MORE NEGATIVE THAN -4.0 DEGREES
061637,000043:                                                                                                  #  (FIREFCT IS THE DISTANCE TO A SWITCH CURVE IN THE PHASE PLANE) AND A LONG FIRING IS CALLED FOR.
061638,000044: 
061639,000045:                                                                                                  #  IN ORDER TO AVOID SCALING DIFFICULTIES, SIMPLE ALGORITHMS TAGGED RUFLAW1, -2 AND -3 ARE RESORTED TO WHEN THE
061640,000046:                                                                                                  #  ERROR AND/OR ERROR RATE ARE LARGE.
061641,000047: 
061642,000048:                                                                                                  #  CALLING SEQUENCE:
061643,000049:                                                                                                  #                TC      TJETLAW         (MUST BE IN JASK)
061644,000050:                                                                                                  #        OR
061645,000051:                                                                                                  #                INHINT                  (MUST BE IN JASK)
061646,000052:                                                                                                  #                TC      IBNKCALL
061647,000053:                                                                                                  #                CADR    TJETLAW
061648,000054:                                                                                                  #                RELINT
061649,000055: 
061650,000056:                                                                                                  #  EXIT:         RETURN TO Q.
061651,000057: 
061652,000058:                                                                                                  #  INPUT:
061653,000059:                                                                                                  #        FROM THE CALLER:  E, EDOT, AXISCTR, SENSETYP, TJP, -U, -V.
061654,000060:                                                                                                  #        FROM 1/ACCONT:  48 ERASABLES BEGINNING AT BLOCKTOP (INCLUDING FLAT, ZONE3LIM AND ACCSWU, -V).
061655,000061: 
061656,000062:                                                                                                  #  OUTPUT:
061657,000063:                                                                                                  #        TJP, -U OR -V, NUMBERT (DAPTEMP5), FIREFCT (DAPTEMP3).
061658,000064: 
061659,000065:                                                                                                  #  DEBRIS:
061660,000066:                                                                                                  #        A, L, Q, E, EDOT, DAPTEMP1-6, DAPTREG1-4.
061661,000067: 
061662,000068:                                                                                                  #  ALARM:  NONE
061663,000069: 
061664,000070: 17,3304                                           BANK     17                                    
061665,000071: 17,2000                                           SETLOC   DAPS2                                 
061666,000072: 17,2000                                           BANK                                           
061667,000073: 17,3304  E6,1524                                  EBANK=   TJP                                   

Page 1453

061669,000075: 17,3304                                           COUNT*   $$/DAPTJ                              
061670,000076: 
061671,000077: 17,3304           00006        TJETLAW            EXTEND                                         #  SAVE Q FOR RETURN.
061672,000078: 17,3305           23744                           QXCH     HOLDQ                                 
061673,000079: 
061674,000080:                                                                                                  #  SET INDEXERS TO CORRESPOND TO THE AXIS AND TO THE SIGN OF EDOT
061675,000081: 
061676,000082: 17,3306           51505                           INDEX    AXISCTR                               #  AXISDIFF(-1)=NO OF LOCATIONS BER P AND U
061677,000083: 17,3307           33755                           CAF      AXISDIFF                              #  AXISDIFF(0)=0
061678,000084: 17,3310           55745                           TS       ADRSDIF1                              #  AXISDIFF(+1)=NO OF LOCATIONS BET V AND U
061679,000085: 
061680,000086: 17,3311           31427                           CAE      EDOT                                  #  IF EDOT NEGATIVE, PICK UP SET OF VALUES
061681,000087: 17,3312           00006                           EXTEND                                         #        THAT ALLOW USE OF SAME CODING AS FOR
061682,000088: 17,3313           63320                           BZMF     NEGEDOT                               #        POSITIVE EDOT.
061683,000089: 17,3314           31745                           CAE      ADRSDIF1                              #  SET A SECOND INDEXER WHICH MAY BE
061684,000090: 17,3315           55743                           TS       ADRSDIF2                              #        MODIFIED BY A DECISION FOR MAX JETS.
061685,000091: 17,3316           33757                           CAF      SENSOR                                #  FOR POSITIVE EDOT, ROTSENSE IS
061686,000092: 17,3317           13330                           TCF      SETSENSE                              #        INITIALIZED POSITIVE.
061687,000093: 
061688,000094: 17,3320           41751        NEGEDOT            CS       E                                     #  IN ORDER FOR NEG EDOT CASE TO USE CODING
061689,000095: 17,3321           55751                           TS       E                                     #        OF POS EDOT, MUST MODIFY AS FOLLOWS:
061690,000096: 17,3322           41427                           CS       EDOT                                  #        1. COMPLEMENT E AND EDOT.
061691,000097: 17,3323           55427                           TS       EDOT                                  #        2. SET SENSE OF ROTATION TO NEGATIVE
061692,000098: 17,3324           34753                           CAF      BIT1                                  #           (REVERSED LATER IF NECESSARY).
061693,000099: 17,3325           27745                           ADS      ADRSDIF1                              #        3. INCREMENT INDEXERS BY ONE SO THAT
061694,000100: 17,3326           55743                           TS       ADRSDIF2                              #           THE PROPER PARAMETERS ARE ACCESSED.
061695,000101: 17,3327           43757                           CS       SENSOR                                
061696,000102: 17,3330           55737        SETSENSE           TS       ROTSENSE                              
061697,000103: 
061698,000104:                                                                                                  #  TEST MAGNITUDE OF E (ATTITUDE ERROR, SINGLE-PRECISION, SCALED AT PI RADIANS):
061699,000105:                                                                                                  #        IF GREATER THAN (OR EQUAL TO) PI/16 RADIANS, GO TO THE SIMPLIFIED TJET ROUTINE.
061700,000106:                                                                                                  #        IF LESS THAN PI/16 RADIANS, RESCALE TO PI/4.
061701,000107: 
061702,000108: 17,3331           31751                           CAE      E                                     #  PICK UP ATTITUDE ERROR FOR THIS AXIS
061703,000109: 17,3332           00006                           EXTEND                                         
061704,000110: 17,3333           74747                           MP       BIT5                                  #  SHIFT RIGHT TEN BITS:  IF A-REGISTER IS
061705,000111: 17,3334           10000                           CCS      A                                     #        ZERO, RESCALE AND TEST EDOT.
061706,000112: 17,3335           13717                           TCF      RUFLAW2                               
061707,000113: 17,3336           13340                           TCF      SCALEE                                
061708,000114: 17,3337           13663                           TCF      RUFLAW1                               
061709,000115: 17,3340           34737        SCALEE             CAF      BIT13                                 #  ERROR IS IN L SCALED AT PI/16.  RESCALE
061710,000116: 17,3341           00006                           EXTEND                                         #        IT TO PI/4 AND SAVE IT.
061711,000117: 17,3342           70001                           MP       L                                     
061712,000118: 17,3343           55751                           TS       E                                     
061713,000119: 
061714,000120:                                                                                                  #  TEST MAGNITUDE OF EDOT (ERROR RATE SCALED AT PI/4 RADIANS/SECOND)
061715,000121:                                                                                                  #        IF GREATER THAN (OR EQUAL TO) PI/32 RADIANS/SECOND, GO TO THE SIMPLIFIED TJET ROUTINE.
061716,000122:                                                                                                  #        IF LESS THAN PI/32 RADIANS/SECOND, THEN RESCALE TO PI/32 RADIANS/SECOND.
061717,000123: 
061718,000124: 17,3344           31427                           CAE      EDOT                                  #  PICK UP SINGLE-PRECISION ERROR-RATE

Page 1454

061720,000126: 17,3345           00006                           EXTEND                                         #  FOR THIS AXIS=
061721,000127: 17,3346           74750                           MP       BIT4                                  #  SHIFT RIGHT ELEVEN BITS, IF THE A-REG IS
061722,000128: 17,3347           00006                           EXTEND                                         #  ZERO, THEN RESCALE AND USE FINELAW.
061723,000129: 17,3350           13352                           BZF      SCALEDOT                              
061724,000130: 17,3351           13725                           TCF      RUFLAW3                               
061725,000131: 
061726,000132:                                                                                                  #  *** FINELAW STARTS HERE ***
061727,000133: 
061728,000134: 17,3352           23427        SCALEDOT           LXCH     EDOT                                  #  EDOT IS SCALED AT PI/32 RADIANS/SECOND.
061729,000135: 
061730,000136: 17,3353           31427                           CAE      EDOT                                  #  COMPUTE (EDOT)(EDOT)
061731,000137: 17,3354           00006                           EXTEND                                         
061732,000138: 17,3355           70000                           SQUARE                                         #  PRODUCT SCALED AT PI(2)/2(10) RAD/SEC.
061733,000139: 17,3356           00006                           EXTEND                                         
061734,000140: 17,3357           74737                           MP       BIT13                                 #  SHIFT RIGHT TWO BITS TO RESCALE EDOTSQ
061735,000141: 17,3360           55736                           TS       EDOTSQ                                #        TO PI(2)/2(8) RAD(2)/SEC(2).
061736,000142: 
061737,000143: 17,3361           11751        ERRTEST            CCS      E                                     #  DOES BIG ERROR (THREE DEG BEYOND THE
061738,000144: 17,3362           13365                           TCF      +3                                    #  DEADBAND) REQUIRE MAXIMUM JETS?
061739,000145: 17,3363           13365                           TCF      +2                                    
061740,000146: 17,3364           13365                           TCF      +1                                    
061741,000147: 17,3365           63760                           AD       -3DEG                                 
061742,000148: 17,3366           00006                           EXTEND                                         
061743,000149: 17,3367           51745                           INDEX    ADRSDIF1                              
061744,000150: 17,3370           61600                           SU       FIREDB                                
061745,000151: 17,3371           00006                           EXTEND                                         
061746,000152: 17,3372           63377                           BZMF     SENSTEST                              #  IF NOT:  ARE UNBALANCED JETS PREFERRED|
061747,000153: 17,3373           34752        MAXJETS            CAF      TWO                                   #  IF YES:  INCREMENT ADDRESS LOCATOR AND
061748,000154: 17,3374           27743                           ADS      ADRSDIF2                              #           SET SWITCH FOR JET SELECT LOGIC TO 4.
061749,000155: 17,3375           34751                           CAF      FOUR                                  #           (ALWAYS DO THIS FOR P-AXIS)
061750,000156: 17,3376           13402                           TCF      TJCALC                                
061751,000157: 17,3377           11500        SENSTEST           CCS      SENSETYP                              #  DOES TRANSLATION PREFER MIN JETS.
061752,000158: 17,3400           13402                           TCF      TJCALC                                #  YES.  USE MIN-JET PARAMETERS.
061753,000159: 17,3401           13373                           TCF      MAXJETS                               #  NO.  GET MAX-JET PARAMETERS.
061754,000160: 17,3402           55742        TJCALC             TS       NUMBERT                               #  SET TO +0,1,4 FOR (U,V-AXES) JET SELECT.
061755,000161: 
061756,000162:                                                                                                  #  BEGINNING OF TJET CALCULATIONS:
061757,000163: 
061758,000164: 17,3403           41736                           CS       EDOTSQ                                #  SCALED AT PI(2)/2(8).
061759,000165: 17,3404           00006                           EXTEND                                         
061760,000166: 17,3405           51743                           INDEX    ADRSDIF2                              
061761,000167: 17,3406           71566                           MP       1/ANET1                               #  .5/ACC SCALED AT 2(6)/PI SEC(2)/RADIAN.
061762,000168: 17,3407           51745                           INDEX    ADRSDIF1                              
061763,000169: 17,3410           61600                           AD       FIREDB                                #  DEADBAND SCALED AT PI/4 RADIAN.
061764,000170: 17,3411           00006                           EXTEND                                         
061765,000171: 17,3412           61751                           SU       E                                     #  ATTITUDE ERROR SCALED AT PI/4 RADIAN.
061766,000172: 17,3413           55740                           TS       FIREFCT                               #  -E-.5(EDOTSQ)/ACC-DB AT PI/4 RADIAN.
061767,000173: 17,3414           00006                           EXTEND                                         
061768,000174: 17,3415           63575                           BZMF     ZON1,2,3                              
061769,000175: 
061770,000176: 17,3416           51745        ZONE4,4            INDEX    ADRSDIF1                              

Page 1455

061772,000178: 17,3417           31572                           CAE      1/ACOAST                              #  .5/ACC SCALED AT 2(6)/PI WHERE
061773,000179: 17,3420           00006                           EXTEND                                         #  ACC = MAX(AMIN, AOS-).
061774,000180: 17,3421           71736                           MP       EDOTSQ                                #  SCALED AT PI/2(8).
061775,000181: 17,3422           61751                           AD       E                                     #  SCALED AT PI/4
061776,000182: 17,3423           51745                           INDEX    ADRSDIF1                              
061777,000183: 17,3424           61602                           AD       COASTDB                               #  SCALED AT PI/4 POS. FOR NEG. INTERCEPT.
061778,000184: 17,3425           00006                           EXTEND                                         #  TEST E+.5(EDOTSQ)/ACC+DB AT PI/4 RADIAN.
061779,000185: 17,3426           63461                           BZMF     ZONE5                                 #  IF FUNCTION NEGATIVE, FIND TJET.
061780,000186:                                                                                                  #  IF FUNCTION POSITIVE, IN ZONE 4.
061781,000187: 
061782,000188:                                                                                                  #  ZONE 4 IS THE COAST REGION.  HOWEVER, IF THE JETS ARE ON AND DRIVING TOWARD
061783,000189:                                                                                                  #        A. THE AXIS WITHIN + OR - (DB + FLAT) FOR DRIFTING FLIGHT, OR
061784,000190:                                                                                                  #        B. THE USUAL TARGET PARABOLA FOR POWERED FLIGHT
061785,000191:                                                                                                  #  THEN THE THRUSTERS ARE KEPT ON.
061786,000192: 
061787,000193: 17,3427           51505        ZONE4              INDEX    AXISCTR                               #  IS THE CURRENT VALUE IN TJET NON-ZERO
061788,000194: 17,3430           41525                           CS       TJETU                                 #        WITH SENSE OPPOSITE TO EDOT,
061789,000195: 17,3431           00006                           EXTEND                                         #        (I.E., ARE JETS ON AND FIRING TOWARD
061790,000196: 17,3432           71737                           MP       ROTSENSE                              #        THE DESIRABLE STATE).
061791,000197: 17,3433           00006                           EXTEND                                         
061792,000198: 17,3434           63455                           BZMF     COASTTJ                               #  NO.  COAST.
061793,000199: 
061794,000200: 17,3435           11554        JETSON             CCS      FLAT                                  #  YES.  IS THIS DRIFTING OR POWERED FLIGHT|
061795,000201: 17,3436           13447                           TCF      DRIFT/ON                              #  DRIFTING.  GO MAKE FURTHER TEST.
061796,000202: 
061797,000203: 17,3437           41740                           CS       FIREFCT                               #  POWERED (OR ULLAGE).  CAN TARGET PARABOLA
061798,000204: 17,3440           51745                           INDEX    ADRSDIF1                              #        BE REACHED FROM THIS POINT IN THE
061799,000205: 17,3441           61604                           AD       AXISDIST                              #        PHASE PLANE|
061800,000206: 17,3442           00006                           EXTEND                                         
061801,000207: 17,3443           63455                           BZMF     COASTTJ                               #  NO. SET TJET = 0.
061802,000208: 17,3444           03561                           TC       Z123COMP                              #  YES.  CALCULATE TJET AS THOUGH IN ZONE 1
061803,000209: 17,3445           31740                           CAE      FIREFCT                               #        AFTER COMPUTING THE REQUIRED
061804,000210: 17,3446           13615                           TCF      ZONE1                                 #        PARAMETERS.
061805,000211: 
061806,000212: 17,3447           51745        DRIFT/ON           INDEX    ADRSDIF1                              #  CAN TARGET STRIP OF AXIS BE REACHED FROM
061807,000213: 17,3450           41600                           CS       FIREDB                                #        THIS POINT IN THE PHASE PLANE|
061808,000214: 17,3451           60000                           DOUBLE                                         
061809,000215: 17,3452           61740                           AD       FIREFCT                               
061810,000216: 17,3453           00006                           EXTEND                                         
061811,000217: 17,3454           63457                           BZMF     +3                                    
061812,000218: 17,3455           34755        COASTTJ            CAF      ZERO                                  #  NO.  SET TJET = 0.
061813,000219: 17,3456           13521                           TCF      RETURNTJ                              
061814,000220: 
061815,000221: 17,3457           03561                           TC       Z123COMP                              #  YES. CALCULATE TJET AS THOUGH IN ZONE 2
061816,000222: 17,3460           13602                           TCF      ZONE2,3                               #        OR 3 AFTER COMPUTING REQUIRED VALUES.
061817,000223: 
061818,000224: 17,3461           54001        ZONE5              TS       L                                     #  TEMPORARILY STORE FUNCTION IN L.
061819,000225: 17,3462           11737                           CCS      ROTSENSE                              #  MODIFY ADRSDIF2 FOR ACCESSING 1/ANET2
061820,000226: 17,3463           13467                           TCF      +4                                    #  AND ACCFCTZ5, WHICH MUST BE PICKED UP
061821,000227: 17,3464           05675                           TC       CCSHOLE                               #  FROM THE NEXT LOWER REGISTER IF THE

Page 1456

061823,000229: 17,3465           44752                           CS       TWO                                   #  (ACTUAL) ERROR RATE IS NEGATIVE.
061824,000230: 17,3466           27743                           ADS      ADRSDIF2                              
061825,000231: 
061826,000232: 17,3467           30001                 +4        CAE      L                                     
061827,000233: 17,3470           00006                           EXTEND                                         
061828,000234: 17,3471           51743                           INDEX    ADRSDIF2                              #  TTOAXIS AND HH ARE THE PARAMETERS UPON
061829,000235: 17,3472           71575                           MP       ACCFCTZ5                              #        WHICH THE APPROXIMATIONS TO TJET ARE
061830,000236: 17,3473           20001                           DDOUBL                                         #        BASED.
061831,000237: 17,3474           20001                           DDOUBL                                         
061832,000238: 17,3475           53747                           DXCH     HH                                    #  DOUBLE PRECISION H SCALED AT 8 SEC(2).
061833,000239: 17,3476           51743                           INDEX    ADRSDIF2                              
061834,000240: 17,3477           31567                           CAE      1/ANET2                               #  SCALED AT 2(7)/PI SEC(2)/RAD.
061835,000241: 17,3500           00006                           EXTEND                                         
061836,000242: 17,3501           71427                           MP       EDOT                                  #  SCALED AT PI/2(5)
061837,000243: 17,3502           55741                           TS       TTOAXIS                               #  SCALED AT 4 SEC.
061838,000244: 
061839,000245:                                                                                                  #  TEST WHETHER TJET GREATER THAN 50 MSEC.
061840,000246: 
061841,000247: 17,3503           00006                           EXTEND                                         
061842,000248: 17,3504           73767                           MP       -.05AT2                               #  H - .05 TTOAXIS - .00125 G.T. ZERO
061843,000249: 17,3505           61746                           AD       HH                                    #        (SCALED AT 8 SEC(2) ).
061844,000250: 17,3506           67751                           AD       NEG2                                  
061845,000251: 17,3507           00006                           EXTEND                                         
061846,000252: 17,3510           63536                           BZMF     FORMULA1                              
061847,000253: 
061848,000254:                                                                                                  #  TEST WHETHER TJET GREATER THAN 150 MSEC.
061849,000255: 
061850,000256: 17,3511           31741                           CAE      TTOAXIS                               
061851,000257: 17,3512           00006                           EXTEND                                         
061852,000258: 17,3513           73770                           MP       -.15AT2                               #  H - .15 TTOAXIS - .01125 G.T. ZERO
061853,000259: 17,3514           61746                           AD       HH                                    #        (SCALED AT 8 SEC(2) )
061854,000260: 17,3515           63761                           AD       -.0112A8                              
061855,000261: 17,3516           00006                           EXTEND                                         
061856,000262: 17,3517           63546                           BZMF     FORMULA2                              
061857,000263: 
061858,000264:                                                                                                  #  IF TJET GREATER THAN 150 MSEC, ASSIGN IT VALUE OF 250 MSEC, SINCE THIS
061859,000265:                                                                                                  #  IS ENOUGH TO ASSURE NO SKIP NEXT CSP (100 MSEC).
061860,000266: 
061861,000267: 17,3520           34741        FULLTIME           CAF      BIT11                                 #  250 MSEC SCALED AT 4 SEC.
061862,000268: 
061863,000269:                                                                                                  #  RETURN TO CALLING PROGRAM WITH JET TIME SCALED AS TIME6 AND SIGNED.
061864,000270: 
061865,000271: 17,3521           00006        RETURNTJ           EXTEND                                         #  ALL BRANCHES TERMINATE HERE WITH TJET
061866,000272: 17,3522           71737                           MP       ROTSENSE                              #        (SCALED AT 4 SEC) IN THE ACCUMULATOR.
061867,000273: 17,3523           51505                           INDEX    AXISCTR                               #  ROTSENSE APPLIES SIGN AND CHANGES SCALE.
061868,000274: 17,3524           55525                           TS       TJETU                                 
061869,000275: 17,3525           00006                           EXTEND                                         
061870,000276: 17,3526           51505                           INDEX    AXISCTR                               
061871,000277: 17,3527           71546                           MP       ACCSWU                                #  SET SWITCH FOR JET SELECT IF ROTATION IS
061872,000278: 17,3530           30001                           CAE      L                                     
061873,000279: 17,3531           00006                           EXTEND                                         #        IN A SENSE FOR WHICH 1/ACCS HAS FORCED
061874,000280: 17,3532           63535                           BZMF     +3                                    #        A MAX-JET CALCULATION.

Page 1457

061876,000282: 17,3533           34751                           CAF      FOUR                                  
061877,000283: 17,3534           55742                           TS       NUMBERT                               
061878,000284: 17,3535           01744                           TC       HOLDQ                                 #  RETURN VIA SAVED Q.
061879,000285: 
061880,000286:                                                                                                  #  TJET = H/(.025 + TTOAXIS)     FOR TJET LESS THAN 50 MSEC.
061881,000287: 
061882,000288: 17,3536           43766        FORMULA1           CS       -.025AT4                              #  .025 SEC SCALED AT 4.
061883,000289: 17,3537           61741                           AD       TTOAXIS                               #  SCALED AT 4 SECONDS.
061884,000290: 17,3540           53747                           DXCH     HH                                    #  STORE DENOMINATOR IN FIRST WORD OF H,
061885,000291: 17,3541           00006                           EXTEND                                         #        WHICH NEED NOT BE PRESERVED.  PICK UP
061886,000292: 17,3542           11746                           DV       HH                                    #        DP H AND DIVIDE BY DENOMINATOR.
061887,000293: 17,3543           00006                           EXTEND                                         
061888,000294: 17,3544           74736                           MP       BIT14                                 #  RESCALE TJET FROM 2 TO USUAL 4 SEC.
061889,000295: 17,3545           13656                           TCF      CHKMINTJ                              #  CHECK THAT TJET IS NOT LESS THAN MINIMUM
061890,000296: 
061891,000297:                                                                                                  #  TJET = (H + .00375)/(0.1 + TTOAXIS)   FOR TJET GREATER THAN 50 MSEC.
061892,000298: 
061893,000299: 17,3546           00006        FORMULA2           EXTEND                                         
061894,000300: 17,3547           33772                           DCA      .00375A8                              #  .00375 SEC(2) SCALED AT 8.
061895,000301: 17,3550           21747                           DAS      HH                                    #  STORE NUMERATOR IN DP H, WHICH NEED NOT
061896,000302:                                                                                                  #        BE PRESERVED.
061897,000303: 17,3551           31741                           CAE      TTOAXIS                               #  SCALED AT 4 SEC.
061898,000304: 17,3552           63762                           AD       .1AT4                                 #  0.1 SEC SCALED AT 4.
061899,000305: 17,3553           53747                           DXCH     HH                                    #  STORE DENOMINATOR IN FIRST WORD OF H,
061900,000306: 17,3554           00006                           EXTEND                                         #        WHICH NEED NOT BE PRESERVED.  PICK UP
061901,000307: 17,3555           11746                           DV       HH                                    #        DP NUMERATOR AND DIVIDE BY DENOMINATOR
061902,000308: 17,3556           00006                           EXTEND                                         
061903,000309: 17,3557           74736                           MP       BIT14                                 #  RESCALE TJET FROM 2 TO USUAL 4 SEC.
061904,000310: 17,3560           13521                           TCF      RETURNTJ                              #  END SUBROUTINE.
061905,000311: 
061906,000312:                                                                                                  #  SUBROUTINIZED COMPUTATIONS REQUIRED FOR ALL ENTRIES INTO CODING FOR ZONES 1, 2, AND 3.
061907,000313:                                                                                                  #  REACHED BY TC FROM 3 POINTS IN TJETLAW.
061908,000314: 
061909,000315: 17,3561           41737        Z123COMP           CS       ROTSENSE                              #  USED IN RETURNTJ SECTION TO RESCALE TJET
061910,000316: 17,3562           55737                           TS       ROTSENSE                              #        AS TIME6 AND GIVE IT PROPER SIGN.
061911,000317: 17,3563           31427                           CAE      EDOT                                  #  SCALED AT PI/2(5) RAD/SEC.
061912,000318: 17,3564           00006                           EXTEND                                         
061913,000319: 17,3565           51743                           INDEX    ADRSDIF2                              
061914,000320: 17,3566           71566                           MP       1/ANET1                               #  SCALED AT 2(7)/PI SEC(2)/RAD.
061915,000321: 17,3567           55741                           TS       TTOAXIS                               #  STORE TIME-TO-AXIS SCALED AT 4 SECONDS.
061916,000322: 17,3570           63773                           AD       -TJMAX                                
061917,000323: 17,3571           00006                           EXTEND                                         #  IS TIME TO AXIS LESS THAN 150 MSEC.
061918,000324: 17,3572           63574                           BZMF     +2                                    
061919,000325: 17,3573           13520                           TCF      FULLTIME                              #  NO. FIRE JETS, DO NOT CALCULATE TJET.
061920,000326: 17,3574           00002                           RETURN                                         #  YES.  GO ON TO FIND TJET
061921,000327: 
061922,000328: 17,3575           03561        ZON1,2,3           TC       Z123COMP                              #  SUBROUTINIZED PREPARATION FOR ZONE1,2,3.
061923,000329: 
061924,000330:                                                                                                  #  IF THE (NEG) DISTANCE BEYOND PARABOLA IS LESS THAN FLAT, USE SPECIAL

Page 1458

061926,000332:                                                                                                  #  LOGIC TO ACQUIRE MINIMUM IMPULSE LIMIT CYCLE.  DURING POWERED FLIGHT
061927,000333:                                                                                                  #  OR ULLAGE, FLAT = 0
061928,000334: 
061929,000335: 17,3576           31740                           CAE      FIREFCT                               #  SCALED AT PI/4 RAD.
061930,000336: 17,3577           61554                           AD       FLAT                                  
061931,000337: 17,3600           00006                           EXTEND                                         
061932,000338: 17,3601           63615                           BZMF     ZONE1                                 #  NOT IN SPECIAL ZONES.
061933,000339: 
061934,000340:                                                                                                  #  FIRE FOR AXIS OR, IF CLOSE, FIRE MINIMUM IMPULSE.  IF ON AXIS, COAST.
061935,000341: 
061936,000342: 17,3602           41555        ZONE2,3            CS       ZONE3LIM                              #  HEIGHT OF MIN-IMPULSE ZONE SET BY 1/ACCS
061937,000343: 17,3603           61741                           AD       TTOAXIS                               #        35 MSEC IN DRIFTING FLIGHT
061938,000344: 17,3604           00006                           EXTEND                                         #        ZERO WHEN TRYING TO ENTER GTS CONTROL.
061939,000345: 17,3605           63610                           BZMF     ZONE3                                 
061940,000346: 17,3606           31741        ZONE2              CAE      TTOAXIS                               #  FIRE TO AXIS.
061941,000347: 17,3607           13521                           TCF      RETURNTJ                              
061942,000348: 17,3610           11427        ZONE3              CCS      EDOT                                  #  CHECK IF EDOT IS ZERO.
061943,000349: 17,3611           34746                           CAF      BIT6                                  #  FIRE A ONE-JET MINIMUM IMPULSE.
061944,000350: 17,3612           13521                           TCF      RETURNTJ                              #  TJET = +0.
061945,000351: 17,3613           05675                           TC       CCSHOLE                               #  CANNOT BE BECAUSE NEG EDOT COMPLEMENTED.
061946,000352: 17,3614           13521                           TCF      RETURNTJ                              #  TJET = +0.
061947,000353: 
061948,000354: 17,3615           00006        ZONE1              EXTEND                                         
061949,000355: 17,3616           51745                           INDEX    ADRSDIF1                              
061950,000356: 17,3617           61604                           SU       AXISDIST                              #  SCALED AT PI/4 RAD.
061951,000357: 17,3620           00006                           EXTEND                                         
061952,000358: 17,3621           51743                           INDEX    ADRSDIF2                              
061953,000359: 17,3622           71574                           MP       ACCFCTZ1                              #  SCALED AT 2(7)/PI SEC(2)/RAD.
061954,000360: 17,3623           20001                           DDOUBL                                         
061955,000361: 17,3624           20001                           DDOUBL                                         
061956,000362: 17,3625           53747                           DXCH     HH                                    #  DOUBLE PRECISION H SCALED AT 8 SEC(2).
061957,000363: 
061958,000364:                                                                                                  #  TEST WHETHER TOTAL TIME REQUIRED GREATER THAN 150 MSEC:
061959,000365:                                                                                                  #                             2                                   2
061960,000366:                                                                                                  #        IS .5(.150 - TTOAXIS)  - H  NEGATIVE (SCALED AT 8 SECONDS )
061961,000367: 
061962,000368: 17,3626           31741                           CAE      TTOAXIS                               #  TTOAXIS SCALED AT 4 SECONDS.
061963,000369: 17,3627           63773                           AD       -TJMAX                                #  -.150 SECOND SCALED AT 4.
061964,000370: 17,3630           00006                           EXTEND                                         
061965,000371: 17,3631           70000                           SQUARE                                         
061966,000372: 17,3632           00006                           EXTEND                                         
061967,000373: 17,3633           61746                           SU       HH                                    #  HIGH WORD OF H SCALED AT 8 SEC(2).
061968,000374: 17,3634           00006                           EXTEND                                         
061969,000375: 17,3635           63520                           BZMF     FULLTIME                              #  YES.  NEED NOT CALCULATE TJET.
061970,000376: 
061971,000377:                                                                                                  #  TEST WHETHER TIME BEYOND AXIS GREATER THAN 50 MSEC TO DETERMINE WHICH APPROXIMATION TO USE.
061972,000378: 
061973,000379: 17,3636           31746                           CAE      HH                                    
061974,000380: 17,3637           67751                           AD       NEG2                                  
061975,000381: 17,3640           00006                           EXTEND                                         

Page 1459

061977,000383: 17,3641           63651                           BZMF     FORMULA3                              
061978,000384: 
061979,000385:                                                                                                  #  TJET = H/0.1 + TTOAXIS + .0375        FOR APPROXIMATION OVER MORE THAN 50 MSEC.
061980,000386: 
061981,000387: 17,3642           33763                           CAF      .1AT2                                 #  STORE .1 SEC SCALED AT 2 FOR DIVISION.
061982,000388: 17,3643           53747                           DXCH     HH                                    #  DP H SCALED AT 8 SEC(2) NEED NOT BE
061983,000389: 17,3644           00006                           EXTEND                                         #        PRESERVED.
061984,000390: 17,3645           11746                           DV       HH                                    #  QUOTIENT SCALED AT 4 SECONDS.
061985,000391: 17,3646           61741                           AD       TTOAXIS                               #  SCALED AT 4 SEC.
061986,000392: 17,3647           63764                           AD       .0375AT4                              #  .0375 SEC SCALED AT 4.
061987,000393: 17,3650           13521                           TCF      RETURNTJ                              #  END COMPUTATION.
061988,000394: 
061989,000395:                                                                                                  #  TJET = H/.O25 + TTOAXIS       FOR APPROXIMATION OVER LESS THAN 50 MSEC.
061990,000396: 
061991,000397: 17,3651           43765        FORMULA3           CS       -.025AT2                              #  STORE +.025 SEC SCALED AT 2 FOR DIVISION
061992,000398: 17,3652           53747                           DXCH     HH                                    #  PICK UP DP H AT 8, WHICH NEED NOT BE
061993,000399: 17,3653           00006                           EXTEND                                         #        PRESERVED.
061994,000400: 17,3654           11746                           DV       HH                                    #  QUOTIENT SCALED AT 4 SECONDS.
061995,000401: 17,3655           61741                           AD       TTOAXIS                               #  SCALED AT 4 SEC.
061996,000402: 
061997,000403:                                                                                                  #  IF COMPUTED JET TIME IS LESS THAN TJMIN, TJET IS SET TO ZERO.
061998,000404:                                                                                                  #  MINIMUM IMPULSES REQUIRED IN ZONE 3 ARE NOT SUBJECT TO THIS CONSTRAINT, NATURALLY.
061999,000405: 
062000,000406: 17,3656           63775        CHKMINTJ           AD       -TJMIN                                #  IS COMPUTED TIME LESS THAN THE MINIMUM.
062001,000407: 17,3657           00006                           EXTEND                                         
062002,000408: 17,3660           63455                           BZMF     COASTTJ                               #  YES, SET TIME TO ZERO.
062003,000409: 17,3661           63774                           AD       TJMIN                                 #  NO, RESTORE COMPUTED TIME.
062004,000410: 17,3662           13521                           TCF      RETURNTJ                              #  END COMPUTATION.
062005,000411: 

Page 1460

062007,000413:                                                                                                  #  *** ROUGHLAW ***
062008,000414: 
062009,000415:                                                                                                  #  BEFORE ENTRY TO RUFLAW:
062010,000416:                                                                                                  #        1. INDEXERS ADRSDIF1 AND ADRSDIF2 ARE SET ON BASIS OF AXIS, AND SIGN OF EDOT.
062011,000417:                                                                                                  #        2. IF EDOT WAS NEGATIVE, E AND EDOT ARE ROTATED INTO UPPER HALF-PLANE AND ROTSENSE IS MADE NEGATIVE.
062012,000418:                                                                                                  #        3. E IS SCALED AT PI RADIANS AND EDOT AT PI/4 RAD/SEC.
062013,000419:                                                                                                  #           (EXCEPT THE RUFLAW3 ENTRY WHEN E IS AT PI/4)
062014,000420: 
062015,000421:                                                                                                  #  RUFLAW1:      ERROR MORE NEGATIVE THAN PI/16 RAD.  FIRE TO A RATE OF 6.5 DEG/SEC (IF JET TIME EXCEEDS 20 MSEC.).
062016,000422:                                                                                                  #  RUFLAW2:      ERROR MORE POSITIVE THAN PI/16 RAD.  FIRE TO AN OPPOSING RATE OF 6.5 DEG/SEC.
062017,000423:                                                                                                  #  RUFLAW3:      ERROR RATE GREATER THAN PI/32 RAD/SEC AND ERROR WITHIN BOUNDS.  COAST IF BELOW FIREFCT, FIRE IF ABOVE
062018,000424: 
062019,000425: 17,3663           43776        RUFLAW1            CS       RUFRATE                               #  DECREMENT EDOT BY .1444 RAD/SEC AT PI/4
062020,000426: 17,3664           27427                           ADS      EDOT                                  #        WHICH IS THE TARGET RATE
062021,000427: 17,3665           00006                           EXTEND                                         
062022,000428: 17,3666           63707                           BZMF     SMALRATE                              #  BRANCH IF RATE LESS THAN TARGET.
062023,000429: 17,3667           03745                           TC       RUFSETUP                              #  REVERSE ROTSENSE AND INDICATE MAX JETS.
062024,000430: 17,3670           31427                           CAE      EDOT                                  #  PICK UP DESIRED RATE CHANGE.
062025,000431: 
062026,000432: 17,3671           00006        RUFLAW12           EXTEND                                         #  COMPUTE TJET
062027,000433: 17,3672           51743                           INDEX    ADRSDIF2                              #        = (DESIRED RATE CHANGE)/(2-JET ACCEL.)
062028,000434: 17,3673           71570                           MP       1/ANET1    +2                         
062029,000435: 17,3674           67744                           AD       -1/8                                  #  IF TJET, SCALED AT 32 SEC, EXCEEDS
062030,000436: 17,3675           00006                           EXTEND                                         #        4 SECONDS, SET TJET TO TJMAX.
062031,000437: 17,3676           63700                           BZMF     +2                                    
062032,000438: 17,3677           13520                           TCF      FULLTIME                              
062033,000439: 17,3700           00006                           EXTEND                                         
062034,000440: 17,3701           13520                           BZF      FULLTIME                              
062035,000441: 17,3702           64740                           AD       BIT12                                 #  RESTORE COMPUTED TJET TO ACCUMULATOR.
062036,000442: 17,3703           20001                           DAS      A                                     
062037,000443: 17,3704           20001                           DAS      A                                     
062038,000444: 17,3705           20001                           DAS      A                                     #  RESCALED TJET AT 4 SECONDS.
062039,000445: 17,3706           13656                           TCF      CHKMINTJ                              #  RETURN AS FROM FINELAW.
062040,000446: 
062041,000447: 17,3707           03747        SMALRATE           TC       RUFSETUP   +2                         #  SET NUMBERT AND FIREFCT FOR MAXIMUM JETS
062042,000448: 17,3710           11737                           CCS      ROTSENSE                              
062043,000449: 17,3711           34753                           CAF      ONE                                   #  MODIFY INDEXER TO POINT TO 1/ANET
062044,000450: 17,3712           13714                           TCF      +2                                    #        CORRESPONDING TO THE PROPER SENSE.
062045,000451: 17,3713           37752                           CAF      NEGONE                                
062046,000452: 17,3714           27743                           ADS      ADRSDIF2                              
062047,000453: 
062048,000454: 17,3715           41427                           CS       EDOT                                  #  (.144 AT PI/4 - EDOT) = DESIRED RATE CHNG.
062049,000455: 17,3716           13671                           TCF      RUFLAW12                              
062050,000456: 
062051,000457: 17,3717           03745        RUFLAW2            TC       RUFSETUP                              #  REVERSE ROTSENSE AND INDICATE MAX JETS.
062052,000458: 17,3720           33776                           CAF      RUFRATE                               
062053,000459: 17,3721           61427                           AD       EDOT                                  #  (.144 AT PI/4 + EDOT) = DESIRED RATE CHNG.
062054,000460: 17,3722           54000                           TS       A                                     #  IF OVERFLOW SKIP, FIRE FOR FULL TIME.
062055,000461: 17,3723           13671                           TCF      RUFLAW12                              #   OTHERWISE, COMPUTE JET TIME.
062056,000462: 17,3724           13520                           TCF      FULLTIME                              
062057,000463: 

Page 1461

062059,000465: 17,3725           03745        RUFLAW3            TC       RUFSETUP                              #  EXECUTE COMMON RUFLAW SUBROUTINE.
062060,000466: 17,3726           51745                           INDEX    ADRSDIF1                              
062061,000467: 17,3727           41600                           CS       FIREDB                                #  CALCULATE DISTANCE FROM SWITCH CURVE
062062,000468: 17,3730           61751                           AD       E                                     #        1/ANET1*EDOT*EDOT +E - FIREDB = 0
062063,000469: 17,3731           00006                           EXTEND                                         #                SCALED AT 4 PI RADIANS
062064,000470: 17,3732           74741                           MP       BIT11                                 
062065,000471: 17,3733           57427                           XCH      EDOT                                  
062066,000472: 17,3734           00006                           EXTEND                                         
062067,000473: 17,3735           70000                           SQUARE                                         
062068,000474: 17,3736           00006                           EXTEND                                         
062069,000475: 17,3737           51745                           INDEX    ADRSDIF1                              
062070,000476: 17,3740           71570                           MP       1/ANET1    +2                         
062071,000477: 17,3741           61427                           AD       EDOT                                  
062072,000478: 17,3742           00006                           EXTEND                                         
062073,000479: 17,3743           63455                           BZMF     COASTTJ                               #  COAST IF BELOW IT.
062074,000480: 17,3744           13520                           TCF      FULLTIME                              #  FIRE FOR FULL PERIOD IF ABOVE IT.
062075,000481: 
062076,000482:                                                                                                  #  SUBROUTINE USED IN ALL ENTRIES TO ROUGHLAW.
062077,000483: 
062078,000484: 17,3745           41737        RUFSETUP           CS       ROTSENSE                              #  REVERSE ROTSENSE WHEN ENTER HERE.
062079,000485: 17,3746           55737                           TS       ROTSENSE                              
062080,000486: 17,3747           34751                 +2        CAF      FOUR                                  #  REQUIRE MAXIMUM (2) JETS IN U,V-AXES.
062081,000487: 17,3750           55742                           TS       NUMBERT                               
062082,000488: 17,3751           34735                           CAF      NEGMAX                                #  SUGGEST MAXIMUM (4) JETS IN P-AXIS.
062083,000489: 17,3752           55740                           TS       FIREFCT                               
062084,000490: 17,3753           00002                           TC       Q                                     
062085,000491: 
062086,000492:                                                                                                  #  CONSTANTS FOR TJETLAW
062087,000493: 
062088,000494: 17,3754           77757                           DEC      -16        B-14                       #  AXISDIFF(INDEX) = NUMBER OF REGISTERS
062089,000495: 17,3755           00000        AXISDIFF           DEC      +0         B-14                       #        BETWEEN STORED 1/ACCS PARAMETERS FOR
062090,000496: 17,3756           00020                           DEC      16         B-14                       #        THE INDEXED AXIS AND THE U-AXIS.
062091,000497: 17,3757           14400        SENSOR             OCT      14400                                 #  RATIO OF TJET SCALING WITHIN TJETLAW
062092,000498:                                                                                                  #        (4 SEC) TO SCALING FOR T6 (10.24 SEC).
062093,000499: 17,3760           75673        -3DEG              DEC      -.06667                               #  -3.0 DEGREES SCALED AT 45.
062094,000500: 17,3761           77750        -.0112A8           DEC      -.00141                               #  -.01125 SEC(2) SCALED AT 8.
062095,000501: 17,3762           00632        .1AT4              DEC      .025                                  #  0.1 SECOND SCALED AT 4.
062096,000502: 17,3763           01463        .1AT2              DEC      .05                                   #  0.1 SEC SCALED AT 2.
062097,000503: 17,3764           00232        .0375AT4           DEC      .00938                                #  .0375 SEC SCALED AT 4.
062098,000504: 17,3765           77462        -.025AT2           DEC      -.0125                                #  -.025 SEC SCALED AT 2.
062099,000505: 17,3766           77631        -.025AT4           DEC      -.00625                               
062100,000506: 17,3767           77145        -.05AT2            DEC      -.025                                 
062101,000507: 17,3770           75462        -.15AT2            DEC      -.075                                 
062102,000508: 17,3771           00007 25605  .00375A8           2DEC     .00375     B-3                        
062103,000509: 
062104,000510: 17,3773           76631        -TJMAX             DEC      -.0375                                #  LARGEST CALCULATED TIME.  .150 SEC AT 4.
062105,000511: 17,3774           00122        TJMIN              DEC      .005                                  #  SMALLEST ALLOWABLE TIME.  .020 SEC AT 4.
062106,000512: 17,3775           77655        -TJMIN             DEC      -.005                                 
062107,000513: 17,3776           04476        RUFRATE            DEC      .1444                                 #  CORRESPONDS TO TARGET RATE OF 6.5 DEG/S.

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