Source Code

These source-code files derive from a printout of Luminary 116 (the Apollo 12 Lunar Module guidance computer program), from the personal library of original AGC developer Don Eyles, digitally photographed at archive.org, financially sponsored by Ron Burkey, 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 116 OF AGC PROGRAM LUMINARY BY NASA 2021112-071
	19:09 AUG. 11,1969
Note that the date is the date of the printout, not the date of the program revision.

061970,000002:                                                                                                  ## Copyright:   Public domain.
061971,000003:                                                                                                  ## Filename:    TJET_LAW.agc
061972,000004:                                                                                                  ## Purpose:     A section of Luminary revision 116.
061973,000005:                                                                                                  ##              It is part of the source code for the Lunar Module's (LM)
061974,000006:                                                                                                  ##              Apollo Guidance Computer (AGC) for Apollo 12.
061975,000007:                                                                                                  ##              This file is intended to be a faithful transcription, except
061976,000008:                                                                                                  ##              that the code format has been changed to conform to the
061977,000009:                                                                                                  ##              requirements of the yaYUL assembler rather than the
061978,000010:                                                                                                  ##              original YUL assembler.
061979,000011:                                                                                                  ## Reference:   pp. 1450-1459
061980,000012:                                                                                                  ## Assembler:   yaYUL
061981,000013:                                                                                                  ## Contact:     Ron Burkey <info@sandroid.org>.
061982,000014:                                                                                                  ## Website:     www.ibiblio.org/apollo/index.html
061983,000015:                                                                                                  ## Mod history: 2017-01-22 MAS  Created from Luminary 99.
061984,000016:                                                                                                  ##              2017-01-26 RRB  Updated for Luminary 116.
061985,000017:                                                                                                  ##              2017-03-14 RSB  Proofed comment text via 3-way diff vs
061986,000018:                                                                                                  ##                              Luminary 99 and 131.
061987,000019:                                                                                                  ##              2017-03-16 RSB  Comment-text fixes identified in 5-way
061988,000020:                                                                                                  ##                              side-by-side diff of Luminary 69/99/116/131/210.
061989,000021:                                                                                                  ##              2017-03-19 HG   Fix statement AD -3DEG --> TCF +3
061990,000022:                                                                                                  ##                              Add missing statement TCF +1
061991,000023:                                                                                                  ##              2021-05-30 ABS  Fixed a page number to match scans.
061992,000024: 

Page 1450

061994,000026:                                                                                                  #  PROGRAM DESCRIPTION
061995,000027: 
061996,000028:                                                                                                  #  DESIGNED BY:  R. D. GOSS AND P. S. WEISSMAN
061997,000029: 
061998,000030:                                                                                                  #  CODED BY:  P. S. WEISSMAN 28 FEBRUARY 1968
061999,000031: 
062000,000032:                                                                                                  #      TJETLAW IS CALLED AS A SUBROUTINE WHEN THE LEM IS NOT DOCKED AND THE AUTOPILOT IS IN THE AUTOMATIC OR
062001,000033:                                                                                                  #  ATTITUDE-HOLD MODE TO CALCULATE THE JET-FIRING-TIME (TJET) REQUIRED FOR THE AXIS INDICATED BY AXISCTR:
062002,000034:                                                                                                  #                    -1      INDICATES THE P-AXIS
062003,000035:                                                                                                  #                    +0      INDICATES THE U-AXIS
062004,000036:                                                                                                  #                    +1      INDICATES THE V-AXIS.
062005,000037:                                                                                                  #  THE REGISTERS E AND EDOT CONTAIN THE APPROPRIATE ATTITUDE ERROR AND ERROR RATE AND SENSETYP SHOWS WHETHER
062006,000038:                                                                                                  #  UNBALANCED COUPLES ARE PREFERRED.  TJETLAW ALSO USES VARIOUS FUNCTIONS OF ACCELERATION AND DEADBAND WHICH ARE
062007,000039:                                                                                                  #  COMPUTED IN THE 1/ACCONT SECTION OF 1/ACCS AND ARE STORED IN SUCH AN ORDER THAT THEY CAN BE CONVENIENTLY
062008,000040:                                                                                                  #  ACCESSED BY INDEXING.
062009,000041:                                                                                                  #       THE SIGN OF THE REQUIRED ROTATION IS CARRIED THROUGH TJETLAW AS ROTSENSE AND IS FINALLY APPLIED TO TJET JUST
062010,000042:                                                                                                  #  PREVIOUS TO ITS STORAGE IN THE LOCATION CORRESPONDING TO THE AXIS (TJP, TJU OR TJV).  THE NUMBER OF JETS THAT
062011,000043:                                                                                                  #  TJETLAW ASSUMES WILL BE USED IS INDICATED BY THE SETTING OF NUMBERT FOR THE U- OR V-AXIS.  TWO JETS ARE ALWAYS
062012,000044:                                                                                                  #  ASSUMED FOR THE P-AXIS ALTHOUGH FOUR JETS WILL BE FIRED WHEN FIREFCT IS MORE NEGATIVE THAN -4.0 DEGREES
062013,000045:                                                                                                  #  (FIREFCT IS THE DISTANCE TO A SWITCH CURVE IN THE PHASE PLANE) AND A LONG FIRING IS CALLED FOR.
062014,000046:                                                                                                  #      IN ORDER TO AVOID SCALING DIFFICULTIES, SIMPLE ALGORITHMS TAGGED RUFLAW1, -2 AND -3 ARE RESORTED TO WHEN THE
062015,000047:                                                                                                  #  ERROR AND/OR ERROR RATE ARE LARGE.
062016,000048: 
062017,000049:                                                                                                  #  CALLING SEQUENCE:
062018,000050:                                                                                                  #              TC      TJETLAW        (MUST BE IN JASK)
062019,000051:                                                                                                  #    OR
062020,000052:                                                                                                  #              INHINT                 (MUST BE IN JASK)
062021,000053:                                                                                                  #              TC      IBNKCALL
062022,000054:                                                                                                  #              CADR    TJETLAW
062023,000055:                                                                                                  #              RELINT
062024,000056: 
062025,000057:                                                                                                  #  EXIT:         RETURN TO Q.
062026,000058: 
062027,000059:                                                                                                  #  INPUT:
062028,000060:                                                                                                  #     FROM THE CALLER: E, EDOT, AXISCTR, SENSETYP, TJP, -U, -V.
062029,000061:                                                                                                  #     FROM 1/ACCONT: 48 ERASABLES BEGINNING AT BLOCKTOP (INCLUDING FLAT, ZONE3LIM AND ACCSWU, -V).
062030,000062: 
062031,000063:                                                                                                  #  OUTPUT:
062032,000064:                                                                                                  #     TJP,-U OR -V, NUMBERT (DAPTEMP5), FIREFCT (DAPTEMP3).
062033,000065: 
062034,000066:                                                                                                  #  DEBRIS:
062035,000067:                                                                                                  #        A, L, Q, E, EDOT, DAPTEMP1-6, DAPTREG1-4.
062036,000068: 
062037,000069:                                                                                                  #  ALARM:  NONE
062038,000070: 
062039,000071: 17,3304                                           BANK     17                                    
062040,000072: 17,2000                                           SETLOC   DAPS2                                 
062041,000073: 17,2000                                           BANK                                           
062042,000074: 17,3304  E6,1524                                  EBANK=   TJP                                   

Page 1451

062044,000076: 17,3304                                           COUNT*   $$/DAPTJ                              
062045,000077: 
062046,000078: 17,3304           00006        TJETLAW            EXTEND                                         #  SAVE Q FOR RETURN.
062047,000079: 17,3305           23745                           QXCH     HOLDQ                                 
062048,000080: 
062049,000081:                                                                                                  #  SET INDEXERS TO CORRESPOND TO THE AXIS AND TO THE SIGN OF EDOT
062050,000082: 
062051,000083: 17,3306           51505                           INDEX    AXISCTR                               #  AXISDIFF(-1)=NO OF LOCATIONS BER P AND U
062052,000084: 17,3307           33755                           CAF      AXISDIFF                              #  AXISDIFF(0) = 0
062053,000085: 17,3310           55746                           TS       ADRSDIF1                              #  AXISDIFF(+1)=NO OF LOCATIONS BET V AND U
062054,000086: 
062055,000087: 17,3311           31427                           CAE      EDOT                                  #  IF EDOT NEGATIVE, PICK UP SET OF VALUES
062056,000088: 17,3312           00006                           EXTEND                                         #    THAT ALLOW USE OF SAME CODING AS FOR
062057,000089: 17,3313           63320                           BZMF     NEGEDOT                               #    POSITIVE EDOT.
062058,000090: 17,3314           31746                           CAE      ADRSDIF1                              #  SET A SECOND INDEXER WHICH MAY BE
062059,000091: 17,3315           55744                           TS       ADRSDIF2                              #    MODIFIED BY A DECISION FOR MAX JETS.
062060,000092: 17,3316           33757                           CAF      SENSOR                                #  FOR POSITIVE EDOT, ROTSENSE IS
062061,000093: 17,3317           13330                           TCF      SETSENSE                              #    INITIALIZED POSITIVE.
062062,000094: 
062063,000095: 17,3320           41752        NEGEDOT            CS       E                                     #  IN ORDER FOR NEG EDOT CASE TO USE CODING
062064,000096: 17,3321           55752                           TS       E                                     #     OF POS EDOT, MUST MODIFY AS FOLLOWS:
062065,000097: 17,3322           41427                           CS       EDOT                                  #     1.COMPLEMENT E AND EDOT.
062066,000098: 17,3323           55427                           TS       EDOT                                  #     2.SET SENSE OF ROTATION TO NEGATIVE
062067,000099: 17,3324           34753                           CAF      BIT1                                  #       (REVERSED LATER IF NECESSARY).
062068,000100: 17,3325           27746                           ADS      ADRSDIF1                              #     3.INCREMENT INDEXERS BY ONE SO THAT
062069,000101: 17,3326           55744                           TS       ADRSDIF2                              #       THE PROPER PARAMETERS ARE ACCESSED.
062070,000102: 17,3327           43757                           CS       SENSOR                                
062071,000103: 17,3330           55740        SETSENSE           TS       ROTSENSE                              
062072,000104: 
062073,000105:                                                                                                  #  TEST MAGNITUDE OF E (ATTITUDE ERROR, SINGLE-PRECISION, SCALED AT PI RADIANS):
062074,000106:                                                                                                  #           IF GREATER THAN (OR EQUAL TO) PI/16 RADIANS, GO TO THE SIMPLIFIED TJET ROUTINE.
062075,000107:                                                                                                  #           IF LESS THAN PI/16 RADIANS, RESCALE TO PI/4.
062076,000108: 
062077,000109: 17,3331           31752                           CAE      E                                     #  PICK UP ATTITUDE ERROR FOR THIS AXIS
062078,000110: 17,3332           00006                           EXTEND                                         
062079,000111: 17,3333           74747                           MP       BIT5                                  #  SHIFT RIGHT TEN BITS:  IF A-REGISTER IS
062080,000112: 17,3334           10000                           CCS      A                                     #    ZERO, RESCALE AND TEST EDOT.
062081,000113: 17,3335           13717                           TCF      RUFLAW2                               
062082,000114: 17,3336           13340                           TCF      SCALEE                                
062083,000115: 17,3337           13663                           TCF      RUFLAW1                               
062084,000116: 17,3340           34737        SCALEE             CAF      BIT13                                 #  ERROR IS IN L SCALED AT PI/16.  RESCALE
062085,000117: 17,3341           00006                           EXTEND                                         #    IT TO PI/4 AND SAVE IT.
062086,000118: 17,3342           70001                           MP       L                                     
062087,000119: 17,3343           55752                           TS       E                                     
062088,000120: 
062089,000121:                                                                                                  #  TEST MAGNITUDE OF EDOT (ERROR RATE SCALED AT PI/4 RADIANS/SECOND)
062090,000122:                                                                                                  #           IF GREATER THAN (OR EQUAL TO) PI/32 RADIANS/SECOND, GO TO THE SIMPLIFIED TJET ROUTINE.
062091,000123:                                                                                                  #           IF LESS THAN PI/32 RADIANS/SECOND, THEN RESCALE TO PI/32 RADIANS/SECOND.
062092,000124: 
062093,000125: 17,3344           31427                           CAE      EDOT                                  #  PICK UP SINGLE-PRECISION ERROR-RATE

Page 1452

062095,000127: 17,3345           00006                           EXTEND                                         #  FOR THIS AXIS=
062096,000128: 17,3346           74750                           MP       BIT4                                  #  SHIFT RIGHT ELEVEN BITS, IF THE A-REG IS
062097,000129: 17,3347           00006                           EXTEND                                         #  ZERO, THEN RESCALE AND USE FINELAW.
062098,000130: 17,3350           13352                           BZF      SCALEDOT                              
062099,000131: 17,3351           13725                           TCF      RUFLAW3                               
062100,000132: 
062101,000133:                                                                                                  #  *** FINELAW STARTS HERE ***
062102,000134: 
062103,000135: 17,3352           23427        SCALEDOT           LXCH     EDOT                                  #  EDOT IS SCALED AT PI/32 RADIANS/SECOND.
062104,000136: 
062105,000137: 17,3353           31427                           CAE      EDOT                                  #  COMPUTE (EDOT)(EDOT)
062106,000138: 17,3354           00006                           EXTEND                                         
062107,000139: 17,3355           70000                           SQUARE                                         #  PRODUCT SCALED AT PI(2)/2(10) RAD/SEC.
062108,000140: 17,3356           00006                           EXTEND                                         
062109,000141: 17,3357           74737                           MP       BIT13                                 #  SHIFT RIGHT TWO BITS TO RESCALE EDOTSQ
062110,000142: 17,3360           55737                           TS       EDOTSQ                                #    TO PI(2)/2(8) RAD(2)/SEC(2).
062111,000143: 
062112,000144: 17,3361           11752        ERRTEST            CCS      E                                     #  DOES BIG ERROR (THREE DEG BEYOND THE
062113,000145: 17,3362           13365                           TCF      +3                                    #  DEADBAND) REQUIRE MAXIMUM JETS?
062114,000146: 17,3363           13365                           TCF      +2                                    
062115,000147: 17,3364           13365                           TCF      +1                                    
062116,000148: 17,3365           63760                           AD       -3DEG                                 
062117,000149: 17,3366           00006                           EXTEND                                         
062118,000150: 17,3367           51746                           INDEX    ADRSDIF1                              
062119,000151: 17,3370           61601                           SU       FIREDB                                
062120,000152: 17,3371           00006                           EXTEND                                         
062121,000153: 17,3372           63377                           BZMF     SENSTEST                              #  IF NOT: ARE UNBALANCED JETS PREFERRED|
062122,000154: 17,3373           34752        MAXJETS            CAF      TWO                                   #  IF YES : INCREMENT ADDRESS LOCATOR AND
062123,000155: 17,3374           27744                           ADS      ADRSDIF2                              #    SET SWITCH FOR JET SELECT LOGIC TO 4.
062124,000156: 17,3375           34751                           CAF      FOUR                                  #    (ALWAYS DO THIS FOR P-AXIS)
062125,000157: 17,3376           13402                           TCF      TJCALC                                
062126,000158: 17,3377           11500        SENSTEST           CCS      SENSETYP                              #  DOES TRANSLATION PREFER MIN JETS.
062127,000159: 17,3400           13402                           TCF      TJCALC                                #  YES.  USE MIN-JET PARAMETERS.
062128,000160: 17,3401           13373                           TCF      MAXJETS                               #  NO.  GET MAX-JET PARAMETERS.
062129,000161: 17,3402           55743        TJCALC             TS       NUMBERT                               #  SET TO +0,1,4 FOR (U,V-AXES) JET SELECT.
062130,000162: 
062131,000163:                                                                                                  #  BEGINNING OF TJET CALCULATIONS:
062132,000164: 
062133,000165: 17,3403           41737                           CS       EDOTSQ                                #  SCALED AT PI(2)/2(8).
062134,000166: 17,3404           00006                           EXTEND                                         
062135,000167: 17,3405           51744                           INDEX    ADRSDIF2                              
062136,000168: 17,3406           71567                           MP       1/ANET1                               #  .5/ACC SCALED AT 2(6)/PI SEC(2)/RADIAN.
062137,000169: 17,3407           51746                           INDEX    ADRSDIF1                              
062138,000170: 17,3410           61601                           AD       FIREDB                                #  DEADBAND SCALED AT PI/4 RADIAN.
062139,000171: 17,3411           00006                           EXTEND                                         
062140,000172: 17,3412           61752                           SU       E                                     #  ATTITUDE ERROR SCALED AT PI/4 RADIAN.
062141,000173: 17,3413           55741                           TS       FIREFCT                               #  -E-.5(EDOTSQ)/ACC-DB AT PI/4 RADIAN.
062142,000174: 17,3414           00006                           EXTEND                                         
062143,000175: 17,3415           63575                           BZMF     ZON1,2,3                              
062144,000176: 
062145,000177: 17,3416           51746        ZONE4,5            INDEX    ADRSDIF1                              

Page 1453

062147,000179: 17,3417           31573                           CAE      1/ACOAST                              #  .5/ACC SCALED AT 2(6)/PI WHERE
062148,000180: 17,3420           00006                           EXTEND                                         #     ACC = MAX(AMIN, AOS-).
062149,000181: 17,3421           71737                           MP       EDOTSQ                                #  SCALED AT PI/2(8).
062150,000182: 17,3422           61752                           AD       E                                     #  SCALED AT PI/4
062151,000183: 17,3423           51746                           INDEX    ADRSDIF1                              
062152,000184: 17,3424           61603                           AD       COASTDB                               #  SCALED AT PI/4 POS. FOR NEG. INTERCEPT.
062153,000185: 17,3425           00006                           EXTEND                                         #  TEST E+.5(EDOTSQ)/ACC+DB AT PI/4 RADIAN.
062154,000186: 17,3426           63461                           BZMF     ZONE5                                 #  IF FUNCTION NEGATIVE, FIND TJET.
062155,000187:                                                                                                  #  IF FUNCTION POSITIVE, IN ZONE 4.
062156,000188: 
062157,000189:                                                                                                  #    ZONE 4 IS THE COAST REGION.  HOWEVER, IF THE JETS ARE ON AND DRIVING TOWARD
062158,000190:                                                                                                  #      A. THE AXIS WITHIN + OR - (DB + FLAT) FOR DRIFTING FLIGHT, OR
062159,000191:                                                                                                  #      B. THE USUAL TARGET PARABOLA FOR POWERED FLIGHT
062160,000192:                                                                                                  #  THEN THE THRUSTERS ARE KEPT ON.
062161,000193: 
062162,000194: 17,3427           51505        ZONE4              INDEX    AXISCTR                               #  IS THE CURRENT VALUE IN TJET NON-ZERO
062163,000195: 17,3430           41525                           CS       TJETU                                 #    WITH SENSE OPPOSITE TO EDOT,
062164,000196: 17,3431           00006                           EXTEND                                         #    (I.E., ARE JETS ON AND FIRING TOWARD
062165,000197: 17,3432           71740                           MP       ROTSENSE                              #    THE DESIRABLE STATE).
062166,000198: 17,3433           00006                           EXTEND                                         
062167,000199: 17,3434           63455                           BZMF     COASTTJ                               #  NO.  COAST.
062168,000200: 
062169,000201: 17,3435           11555        JETSON             CCS      FLAT                                  #  YES.  IS THIS DRIFTING OR POWERED FLIGHT|
062170,000202: 17,3436           13447                           TCF      DRIFT/ON                              #  DRIFTING. GO MAKE FURTHER TEST.
062171,000203: 
062172,000204: 17,3437           41741                           CS       FIREFCT                               #  POWERED (OR ULLAGE). CAN TARGET PARABOLA
062173,000205: 17,3440           51746                           INDEX    ADRSDIF1                              #    BE REACHED FROM THIS POINT IN THE
062174,000206: 17,3441           61605                           AD       AXISDIST                              #    PHASE PLANE|
062175,000207: 17,3442           00006                           EXTEND                                         
062176,000208: 17,3443           63455                           BZMF     COASTTJ                               #  NO. SET TJET = 0.
062177,000209: 17,3444           03561                           TC       Z123COMP                              #  YES. CALCULATE TJET AS THOUGH IN ZONE 1
062178,000210: 17,3445           31741                           CAE      FIREFCT                               #    AFTER COMPUTING THE REQUIRED
062179,000211: 17,3446           13615                           TCF      ZONE1                                 #    PARAMETERS.
062180,000212: 
062181,000213: 17,3447           51746        DRIFT/ON           INDEX    ADRSDIF1                              #  CAN TARGET STRIP OF AXIS BE REACHED FROM
062182,000214: 17,3450           41601                           CS       FIREDB                                #    THIS POINT IN THE PHASE PLANE|
062183,000215: 17,3451           60000                           DOUBLE                                         
062184,000216: 17,3452           61741                           AD       FIREFCT                               
062185,000217: 17,3453           00006                           EXTEND                                         
062186,000218: 17,3454           63457                           BZMF     +3                                    
062187,000219: 17,3455           34755        COASTTJ            CAF      ZERO                                  #  NO.  SET TJET = 0.
062188,000220: 17,3456           13521                           TCF      RETURNTJ                              
062189,000221: 
062190,000222: 17,3457           03561                           TC       Z123COMP                              #  YES. CALCULATE TJET AS THOUGH IN ZONE 2
062191,000223: 17,3460           13602                           TCF      ZONE2,3                               #    OR 3 AFTER COMPUTING REQUIRED VALUES.
062192,000224: 
062193,000225: 17,3461           54001        ZONE5              TS       L                                     #  TEMPORARILY STORE FUNCTION IN L.
062194,000226: 17,3462           11740                           CCS      ROTSENSE                              #  MODIFY ADRSDIF2 FOR ACCESSING 1/ANET2
062195,000227: 17,3463           13467                           TCF      +4                                    #  AND ACCFCTZ5, WHICH MUST BE PICKED UP
062196,000228: 17,3464           05675                           TC       CCSHOLE                               #  FROM THE NEXT LOWER REGISTER IF THE

Page 1454

062198,000230: 17,3465           44752                           CS       TWO                                   #  (ACTUAL) ERROR RATE IS NEGATIVE.
062199,000231: 17,3466           27744                           ADS      ADRSDIF2                              
062200,000232: 
062201,000233: 17,3467           30001                 +4        CAE      L                                     
062202,000234: 17,3470           00006                           EXTEND                                         
062203,000235: 17,3471           51744                           INDEX    ADRSDIF2                              #  TTOAXIS AND HH ARE THE PARAMETERS UPON
062204,000236: 17,3472           71576                           MP       ACCFCTZ5                              #    WHICH THE APPROXIMATIONS TO TJET ARE
062205,000237: 17,3473           20001                           DDOUBL                                         #    BASED.
062206,000238: 17,3474           20001                           DDOUBL                                         
062207,000239: 17,3475           53750                           DXCH     HH                                    #  DOUBLE PRECISION H SCALED AT 8 SEC(2).
062208,000240: 17,3476           51744                           INDEX    ADRSDIF2                              
062209,000241: 17,3477           31570                           CAE      1/ANET2                               #  SCALED AT 2(7)/PI SEC(2)/RAD.
062210,000242: 17,3500           00006                           EXTEND                                         
062211,000243: 17,3501           71427                           MP       EDOT                                  #  SCALED AT PI/2(5)
062212,000244: 17,3502           55742                           TS       TTOAXIS                               #  SCALED AT 4 SEC.
062213,000245: 
062214,000246:                                                                                                  #  TEST WHETHER TJET GREATER THAN 50 MSEC.
062215,000247: 
062216,000248: 17,3503           00006                           EXTEND                                         
062217,000249: 17,3504           73767                           MP       -.05AT2                               #  H - .05 TTOAXIS - .00125 G.T. ZERO
062218,000250: 17,3505           61747                           AD       HH                                    #    (SCALED AT 8 SEC(2) ).
062219,000251: 17,3506           67751                           AD       NEG2                                  
062220,000252: 17,3507           00006                           EXTEND                                         
062221,000253: 17,3510           63536                           BZMF     FORMULA1                              
062222,000254: 
062223,000255:                                                                                                  #  TEST WHETHER TJET GREATER THAN 150 MSEC.
062224,000256: 
062225,000257: 17,3511           31742                           CAE      TTOAXIS                               
062226,000258: 17,3512           00006                           EXTEND                                         
062227,000259: 17,3513           73770                           MP       -.15AT2                               #  H - .15 TTOAXIS - .01125 G.T. ZERO
062228,000260: 17,3514           61747                           AD       HH                                    #    (SCALED AT 8 SEC(2) )
062229,000261: 17,3515           63761                           AD       -.0112A8                              
062230,000262: 17,3516           00006                           EXTEND                                         
062231,000263: 17,3517           63546                           BZMF     FORMULA2                              
062232,000264: 
062233,000265:                                                                                                  #  IF TJET GREATER THAN 150 MSEC, ASSIGN IT VALUE OF 250 MSEC, SINCE THIS
062234,000266:                                                                                                  #  IS ENOUGH TO ASSURE NO SKIP NEXT CSP (100 MSEC).
062235,000267: 
062236,000268: 17,3520           34741        FULLTIME           CAF      BIT11                                 #  250 MSEC SCALED AT 4 SEC.
062237,000269: 
062238,000270:                                                                                                  #  RETURN TO CALLING PROGRAM WITH JET TIME SCALED AS TIME6 AND SIGNED.
062239,000271: 
062240,000272: 17,3521           00006        RETURNTJ           EXTEND                                         #  ALL BRANCHES TERMINATE HERE WITH TJET
062241,000273: 17,3522           71740                           MP       ROTSENSE                              #    (SCALED AT 4 SEC) IN THE ACCUMULATOR.
062242,000274: 17,3523           51505                           INDEX    AXISCTR                               #  ROTSENSE APPLIES SIGN AND CHANGES SCALE.
062243,000275: 17,3524           55525                           TS       TJETU                                 
062244,000276: 17,3525           00006                           EXTEND                                         
062245,000277: 17,3526           51505                           INDEX    AXISCTR                               
062246,000278: 17,3527           71547                           MP       ACCSWU                                #  SET SWITCH FOR JET SELECT IF ROTATION IS
062247,000279: 17,3530           30001                           CAE      L                                     
062248,000280: 17,3531           00006                           EXTEND                                         #    IN A SENSE FOR WHICH 1/ACCS HAS FORCED
062249,000281: 17,3532           63535                           BZMF     +3                                    #    A MAX-JET CALCULATION.

Page 1455

062251,000283: 17,3533           34751                           CAF      FOUR                                  
062252,000284: 17,3534           55743                           TS       NUMBERT                               
062253,000285: 17,3535           01745                           TC       HOLDQ                                 #  RETURN VIA SAVED Q.
062254,000286: 
062255,000287:                                                                                                  #  TJET = H/(.025 + TTOAXIS)     FOR TJET LESS THAN 50 MSEC.
062256,000288: 
062257,000289: 17,3536           43766        FORMULA1           CS       -.025AT4                              #  .025 SEC SCALED AT 4.
062258,000290: 17,3537           61742                           AD       TTOAXIS                               #  SCALED AT 4 SECONDS.
062259,000291: 17,3540           53750                           DXCH     HH                                    #  STORE DENOMINATOR IN FIRST WORD OF H,
062260,000292: 17,3541           00006                           EXTEND                                         #    WHICH NEED NOT BE PRESERVED.  PICK UP
062261,000293: 17,3542           11747                           DV       HH                                    #    DP H AND DIVIDE BY DENOMINATOR.
062262,000294: 17,3543           00006                           EXTEND                                         
062263,000295: 17,3544           74736                           MP       BIT14                                 #  RESCALE TJET FROM 2 TO USUAL 4 SEC.
062264,000296: 17,3545           13656                           TCF      CHKMINTJ                              #  CHECK THAT TJET IS NOT LESS THAN MINIMUM
062265,000297: 
062266,000298:                                                                                                  #  TJET = (H + .00375)/(0.1 + TTOAXIS)   FOR TJET GREATER THAN 50 MSEC.
062267,000299: 
062268,000300: 17,3546           00006        FORMULA2           EXTEND                                         
062269,000301: 17,3547           33772                           DCA      .00375A8                              #  .00375 SEC(2) SCALED AT 8.
062270,000302: 17,3550           21750                           DAS      HH                                    #  STORE NUMERATOR IN DP H, WHICH NEED NOT
062271,000303:                                                                                                  #    BE PRESERVED.
062272,000304: 17,3551           31742                           CAE      TTOAXIS                               #  SCALED AT 4 SEC.
062273,000305: 17,3552           63762                           AD       .1AT4                                 #  0.1 SEC SCALED AT 4.
062274,000306: 17,3553           53750                           DXCH     HH                                    #  STORE DENOMINATOR IN FIRST WORD OF H,
062275,000307: 17,3554           00006                           EXTEND                                         #    WHICH NEED NOT BE PRESERVED.  PICK UP
062276,000308: 17,3555           11747                           DV       HH                                    #    DP NUMERATOR AND DIVIDE BY DENOMINATOR
062277,000309: 17,3556           00006                           EXTEND                                         
062278,000310: 17,3557           74736                           MP       BIT14                                 #  RESCALE TJET FROM 2 TO USUAL 4 SEC.
062279,000311: 17,3560           13521                           TCF      RETURNTJ                              #  END SUBROUTINE.
062280,000312: 
062281,000313:                                                                                                  #  SUBROUTINIZED COMPUTATIONS REQUIRED FOR ALL ENTRIES INTO CODING FOR ZONES 1, 2, AND 3.
062282,000314: 
062283,000315:                                                                                                  #  REACHED BY TC FROM 3 POINTS IN TJETLAW.
062284,000316: 
062285,000317: 17,3561           41740        Z123COMP           CS       ROTSENSE                              #  USED IN RETURNTJ SECTION TO RESCALE TJET
062286,000318: 17,3562           55740                           TS       ROTSENSE                              #    AS TIME6 AND GIVE IT PROPER SIGN.
062287,000319: 17,3563           31427                           CAE      EDOT                                  #  SCALED AT PI/2(5) RAD/SEC.
062288,000320: 17,3564           00006                           EXTEND                                         
062289,000321: 17,3565           51744                           INDEX    ADRSDIF2                              
062290,000322: 17,3566           71567                           MP       1/ANET1                               #  SCALED AT 2(7)/PI SEC(2)/RAD.
062291,000323: 17,3567           55742                           TS       TTOAXIS                               #  STORE TIME-TO-AXIS SCALED AT 4 SECONDS.
062292,000324: 17,3570           63773                           AD       -TJMAX                                
062293,000325: 17,3571           00006                           EXTEND                                         #  IS TIME TO AXIS LESS THAN 150 MSEC.
062294,000326: 17,3572           63574                           BZMF     +2                                    
062295,000327: 17,3573           13520                           TCF      FULLTIME                              #  NO.  FIRE JETS, DO NOT CALCULATE TJET.
062296,000328: 17,3574           00002                           RETURN                                         #  YES.  GO ON TO FIND TJET
062297,000329: 
062298,000330: 17,3575           03561        ZON1,2,3           TC       Z123COMP                              #  SUBROUTINIZED PREPARATION FOR ZONE1,2,3.
062299,000331: 
062300,000332:                                                                                                  #  IF THE (NEG) DISTANCE BEYOND PARABOLA IS LESS THAN FLAT, USE SPECIAL

Page 1456

062302,000334:                                                                                                  #  LOGIC TO ACQUIRE MINIMUM IMPULSE LIMIT CYCLE.  DURING POWERED FLIGHT
062303,000335:                                                                                                  #  OR ULLAGE, FLAT = 0
062304,000336: 
062305,000337: 17,3576           31741                           CAE      FIREFCT                               #  SCALED AT PI/4 RAD.
062306,000338: 17,3577           61555                           AD       FLAT                                  
062307,000339: 17,3600           00006                           EXTEND                                         
062308,000340: 17,3601           63615                           BZMF     ZONE1                                 #  NOT IN SPECIAL ZONES.
062309,000341: 
062310,000342:                                                                                                  #  FIRE FOR AXIS OR, IF CLOSE, FIRE MINIMUM IMPULSE.  IF ON AXIS, COAST.
062311,000343: 
062312,000344: 17,3602           41556        ZONE2,3            CS       ZONE3LIM                              #  HEIGHT OF MIN-IMPULSE ZONE SET BY 1/ACCS
062313,000345: 17,3603           61742                           AD       TTOAXIS                               #    35 MSEC IN DRIFTING FLIGHT
062314,000346: 17,3604           00006                           EXTEND                                         #    ZERO WHEN TRYING TO ENTER GTS CONTROL.
062315,000347: 17,3605           63610                           BZMF     ZONE3                                 
062316,000348: 17,3606           31742        ZONE2              CAE      TTOAXIS                               #  FIRE TO AXIS.
062317,000349: 17,3607           13521                           TCF      RETURNTJ                              
062318,000350: 17,3610           11427        ZONE3              CCS      EDOT                                  #  CHECK IF EDOT IS ZERO.
062319,000351: 17,3611           34746                           CAF      BIT6                                  #  FIRE A ONE-JET MINIMUM IMPULSE.
062320,000352: 17,3612           13521                           TCF      RETURNTJ                              #  TJET = +0.
062321,000353: 17,3613           05675                           TC       CCSHOLE                               #  CANNOT BE BECAUSE NEG EDOT COMPLEMENTED.
062322,000354: 17,3614           13521                           TCF      RETURNTJ                              #  TJET = +0.
062323,000355: 
062324,000356: 17,3615           00006        ZONE1              EXTEND                                         
062325,000357: 17,3616           51746                           INDEX    ADRSDIF1                              
062326,000358: 17,3617           61605                           SU       AXISDIST                              #  SCALED AT PI/4 RAD.
062327,000359: 17,3620           00006                           EXTEND                                         
062328,000360: 17,3621           51744                           INDEX    ADRSDIF2                              
062329,000361: 17,3622           71575                           MP       ACCFCTZ1                              #  SCALED AT 2(7)/PI SEC(2)/RAD.
062330,000362: 17,3623           20001                           DDOUBL                                         
062331,000363: 17,3624           20001                           DDOUBL                                         
062332,000364: 17,3625           53750                           DXCH     HH                                    #  DOUBLE PRECISION H SCALED AT 8 SEC(2).
062333,000365: 
062334,000366:                                                                                                  #  TEST WHETHER TOTAL TIME REQUIRED GREATER THAN 150 MSEC:
062335,000367:                                                                                                  #                         2                                   2
062336,000368:                                                                                                  #    IS .5(.150 - TTOAXIS)  - H  NEGATIVE (SCALED AT 8 SECONDS )
062337,000369: 
062338,000370: 17,3626           31742                           CAE      TTOAXIS                               #  TTOAXIS SCALED AT 4 SECONDS.
062339,000371: 17,3627           63773                           AD       -TJMAX                                #  -.150 SECOND SCALED AT 4.
062340,000372: 17,3630           00006                           EXTEND                                         
062341,000373: 17,3631           70000                           SQUARE                                         
062342,000374: 17,3632           00006                           EXTEND                                         
062343,000375: 17,3633           61747                           SU       HH                                    #  HIGH WORD OF H SCALED AT 8 SEC(2).
062344,000376: 17,3634           00006                           EXTEND                                         
062345,000377: 17,3635           63520                           BZMF     FULLTIME                              #  YES.  NEED NOT CALCULATE TJET.
062346,000378: 
062347,000379:                                                                                                  #  TEST WHETHER TIME BEYOND AXIS GREATER THAN 50 MSEC TO DETERMINE WHICH APPROXIMATION TO USE.
062348,000380: 
062349,000381: 17,3636           31747                           CAE      HH                                    
062350,000382: 17,3637           67751                           AD       NEG2                                  
062351,000383: 17,3640           00006                           EXTEND                                         

Page 1457

062353,000385: 17,3641           63651                           BZMF     FORMULA3                              
062354,000386: 
062355,000387: 
062356,000388:                                                                                                  #  TJET = H/0.1 + TTOAXIS + .0375        FOR APPROXIMATION OVER MORE THAN 50 MSEC.
062357,000389: 
062358,000390: 17,3642           33763                           CAF      .1AT2                                 #  STORE .1 SEC SCALED AT 2 FOR DIVISION.
062359,000391: 17,3643           53750                           DXCH     HH                                    #  DP H SCALED AT 8 SEC(2) NEED NOT BE
062360,000392: 17,3644           00006                           EXTEND                                         #    PRESERVED.
062361,000393: 17,3645           11747                           DV       HH                                    #  QUOTIENT SCALED AT 4 SECONDS.
062362,000394: 17,3646           61742                           AD       TTOAXIS                               #  SCALED AT 4 SEC.
062363,000395: 17,3647           63764                           AD       .0375AT4                              #  .0375 SEC SCALED AT 4.
062364,000396: 17,3650           13521                           TCF      RETURNTJ                              #  END COMPUTATION.
062365,000397: 
062366,000398:                                                                                                  #  TJET = H/.O25 + TTOAXIS       FOR APPROXIMATION OVER LESS THAN 50 MSEC.
062367,000399: 
062368,000400: 17,3651           43765        FORMULA3           CS       -.025AT2                              #  STORE +.025 SEC SCALED AT 2 FOR DIVISION
062369,000401: 17,3652           53750                           DXCH     HH                                    #  PICK UP DP H AT 8, WHICH NEED NOT BE
062370,000402: 17,3653           00006                           EXTEND                                         #    PRESERVED.
062371,000403: 17,3654           11747                           DV       HH                                    #  QUOTIENT SCALED AT 4 SECONDS.
062372,000404: 17,3655           61742                           AD       TTOAXIS                               #  SCALED AT 4 SEC.
062373,000405: 
062374,000406:                                                                                                  #  IF COMPUTED JET TIME IS LESS THAN TJMIN, TJET IS SET TO ZERO.
062375,000407:                                                                                                  #  MINIMUM IMPULSES REQUIRED IN ZONE 3 ARE NOT SUBJECT TO THIS CONSTRAINT, NATURALLY.
062376,000408: 
062377,000409: 17,3656           63775        CHKMINTJ           AD       -TJMIN                                #  IS COMPUTED TIME LESS THAN THE MINIMUM.
062378,000410: 17,3657           00006                           EXTEND                                         
062379,000411: 17,3660           63455                           BZMF     COASTTJ                               #  YES, SET TIME TO ZERO.
062380,000412: 17,3661           63774                           AD       TJMIN                                 #  NO, RESTORE COMPUTED TIME.
062381,000413: 17,3662           13521                           TCF      RETURNTJ                              #  END COMPUTATION.
062382,000414: 

Page 1458

062384,000416:                                                                                                  #  *** ROUGHLAW ***
062385,000417: 
062386,000418:                                                                                                  #    BEFORE ENTRY TO RUFLAW:
062387,000419:                                                                                                  #      1. INDEXERS ADRSDIF1 AND ADRSDIF2 ARE SET ON BASIS OF AXIS, AND SIGN OF EDOT.
062388,000420:                                                                                                  #      2. IF EDOT WAS NEGATIVE, E AND EDOT ARE ROTATED INTO UPPER HALF-PLANE AND ROTSENSE IS MADE NEGATIVE.
062389,000421:                                                                                                  #      3. E IS SCALED AT PI RADIANS AND EDOT AT PI/4 RAD/SEC.
062390,000422:                                                                                                  #           (EXCEPT THE RUFLAW3 ENTRY WHEN E IS AT PI/4)
062391,000423: 
062392,000424:                                                                                                  #    RUFLAW1: ERROR MORE NEGATIVE THAN PI/16 RAD.  FIRE TO A RATE OF 6.5 DEG/SEC (IF JET TIME EXCEEDS 20 MSEC.).
062393,000425:                                                                                                  #    RUFLAW2: ERROR MORE POSITIVE THAN PI/16 RAD.  FIRE TO AN OPPOSING RATE OF 6.5 DEG/SEC.
062394,000426:                                                                                                  #    RUFLAW3: ERROR RATE GREATER THAN PI/32 RAD/SEC AND ERROR WITHIN BOUNDS.  COAST IF BELOW FIREFCT, FIRE IF ABOVE
062395,000427: 
062396,000428: 17,3663           43776        RUFLAW1            CS       RUFRATE                               #  DECREMENT EDOT BY .1444 RAD/SEC AT PI/4
062397,000429: 17,3664           27427                           ADS      EDOT                                  #    WHICH IS THE TARGET RATE
062398,000430: 17,3665           00006                           EXTEND                                         
062399,000431: 17,3666           63707                           BZMF     SMALRATE                              #  BRANCH IF RATE LESS THAN TARGET.
062400,000432: 17,3667           03745                           TC       RUFSETUP                              #  REVERSE ROTSENSE AND INDICATE MAX JETS.
062401,000433: 17,3670           31427                           CAE      EDOT                                  #  PICK UP DESIRED RATE CHANGE.
062402,000434: 
062403,000435: 17,3671           00006        RUFLAW12           EXTEND                                         #  COMPUTE TJET
062404,000436: 17,3672           51744                           INDEX    ADRSDIF2                              #    = (DESIRED RATE CHANGE)/(2-JET ACCEL.)
062405,000437: 17,3673           71571                           MP       1/ANET1    +2                         
062406,000438: 17,3674           67744                           AD       -1/8                                  #  IF TJET, SCALED AT 32 SEC, EXCEEDS
062407,000439: 17,3675           00006                           EXTEND                                         #    4 SECONDS, SET TJET TO TJMAX.
062408,000440: 17,3676           63700                           BZMF     +2                                    
062409,000441: 17,3677           13520                           TCF      FULLTIME                              
062410,000442: 17,3700           00006                           EXTEND                                         
062411,000443: 17,3701           13520                           BZF      FULLTIME                              
062412,000444: 17,3702           64740                           AD       BIT12                                 #  RESTORE COMPUTED TJET TO ACCUMULATOR.
062413,000445: 17,3703           20001                           DAS      A                                     
062414,000446: 17,3704           20001                           DAS      A                                     
062415,000447: 17,3705           20001                           DAS      A                                     #  RESCALED TJET AT 4 SECONDS.
062416,000448: 17,3706           13656                           TCF      CHKMINTJ                              #  RETURN AS FROM FINELAW.
062417,000449: 
062418,000450: 17,3707           03747        SMALRATE           TC       RUFSETUP   +2                         #  SET NUMBERT AND FIREFCT FOR MAXIMUM JETS
062419,000451: 17,3710           11740                           CCS      ROTSENSE                              
062420,000452: 17,3711           34753                           CAF      ONE                                   #  MODIFY INDEXER TO POINT TO 1/ANET
062421,000453: 17,3712           13714                           TCF      +2                                    #    CORRESPONDING TO THE PROPER SENSE.
062422,000454: 17,3713           37752                           CAF      NEGONE                                
062423,000455: 17,3714           27744                           ADS      ADRSDIF2                              
062424,000456: 
062425,000457: 17,3715           41427                           CS       EDOT                                  #  (.144 AT PI/4 - EDOT) = DESIRED RATE CHNG.
062426,000458: 17,3716           13671                           TCF      RUFLAW12                              
062427,000459: 
062428,000460: 17,3717           03745        RUFLAW2            TC       RUFSETUP                              #  REVERSE ROTSENSE AND INDICATE MAX JETS.
062429,000461: 17,3720           33776                           CAF      RUFRATE                               
062430,000462: 17,3721           61427                           AD       EDOT                                  #  (.144 AT PI/4 + EDOT) = DESIRED RATE CHNG.
062431,000463: 17,3722           54000                           TS       A                                     #  IF OVERFLOW SKIP, FIRE FOR FULL TIME.
062432,000464: 17,3723           13671                           TCF      RUFLAW12                              #    OTHERWISE, COMPUTE JET TIME.
062433,000465: 17,3724           13520                           TCF      FULLTIME                              
062434,000466: 

Page 1459

062436,000468: 17,3725           03745        RUFLAW3            TC       RUFSETUP                              #  EXECUTE COMMON RUFLAW SUBROUTINE.
062437,000469: 17,3726           51746                           INDEX    ADRSDIF1                              
062438,000470: 17,3727           41601                           CS       FIREDB                                #  CALCULATE DISTANCE FROM SWITCH CURVE
062439,000471: 17,3730           61752                           AD       E                                     #       1/ANET1*EDOT*EDOT +E - FIREDB = 0
062440,000472: 17,3731           00006                           EXTEND                                         #            SCALED AT 4 PI RADIANS
062441,000473: 17,3732           74741                           MP       BIT11                                 
062442,000474: 17,3733           57427                           XCH      EDOT                                  
062443,000475: 17,3734           00006                           EXTEND                                         
062444,000476: 17,3735           70000                           SQUARE                                         
062445,000477: 17,3736           00006                           EXTEND                                         
062446,000478: 17,3737           51746                           INDEX    ADRSDIF1                              
062447,000479: 17,3740           71571                           MP       1/ANET1    +2                         
062448,000480: 17,3741           61427                           AD       EDOT                                  
062449,000481: 17,3742           00006                           EXTEND                                         
062450,000482: 17,3743           63455                           BZMF     COASTTJ                               #  COAST IF BELOW IT.
062451,000483: 17,3744           13520                           TCF      FULLTIME                              #  FIRE FOR FULL PERIOD IF ABOVE IT.
062452,000484: 
062453,000485:                                                                                                  #  SUBROUTINE USED IN ALL ENTRIES TO ROUGHLAW.
062454,000486: 
062455,000487: 17,3745           41740        RUFSETUP           CS       ROTSENSE                              #  REVERSE ROTSENSE WHEN ENTER HERE.
062456,000488: 17,3746           55740                           TS       ROTSENSE                              
062457,000489: 17,3747           34751                 +2        CAF      FOUR                                  #  REQUIRE MAXIMUM (2) JETS IN U,V-AXES.
062458,000490: 17,3750           55743                           TS       NUMBERT                               
062459,000491: 17,3751           34735                           CAF      NEGMAX                                #  SUGGEST MAXIMUM (4) JETS IN P-AXIS.
062460,000492: 17,3752           55741                           TS       FIREFCT                               
062461,000493: 17,3753           00002                           TC       Q                                     
062462,000494: 
062463,000495:                                                                                                  #  CONSTANTS FOR TJETLAW
062464,000496: 
062465,000497: 17,3754           77757                           DEC      -16        B-14                       #  AXISDIFF(INDEX) = NUMBER OF REGISTERS
062466,000498: 17,3755           00000        AXISDIFF           DEC      +0         B-14                       #    BETWEEN STORED 1/ACCS PARAMETERS FOR
062467,000499: 17,3756           00020                           DEC      16         B-14                       #    THE INDEXED AXIS AND THE U-AXIS.
062468,000500: 17,3757           14400        SENSOR             OCT      14400                                 #  RATIO OF TJET SCALING WITHIN TJETLAW
062469,000501:                                                                                                  #    (4 SEC) TO SCALING FOR T6 (10.24 SEC).
062470,000502: 17,3760           75673        -3DEG              DEC      -.06667                               #  -3.0 DEGREES SCALED AT 45.
062471,000503: 17,3761           77750        -.0112A8           DEC      -.00141                               #  -.01125 SEC(2) SCALED AT 8.
062472,000504: 17,3762           00632        .1AT4              DEC      .025                                  #  0.1 SECOND SCALED AT 4.
062473,000505: 17,3763           01463        .1AT2              DEC      .05                                   #  0.1 SEC SCALED AT 2.
062474,000506: 17,3764           00232        .0375AT4           DEC      .00938                                #  .0375 SEC SCALED AT 4.
062475,000507: 17,3765           77462        -.025AT2           DEC      -.0125                                #  -.025 SEC SCALED AT 2.
062476,000508: 17,3766           77631        -.025AT4           DEC      -.00625                               
062477,000509: 17,3767           77145        -.05AT2            DEC      -.025                                 
062478,000510: 17,3770           75462        -.15AT2            DEC      -.075                                 
062479,000511: 17,3771           00007 25605  .00375A8           2DEC     .00375     B-3                        
062480,000512: 
062481,000513: 17,3773           76631        -TJMAX             DEC      -.0375                                #  LARGEST CALCULATED TIME.  .150 SEC AT 4.
062482,000514: 17,3774           00122        TJMIN              DEC      .005                                  #  SMALLEST ALLOWABLE TIME.  .020 SEC AT 4.
062483,000515: 17,3775           77655        -TJMIN             DEC      -.005                                 
062484,000516: 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