ASM1130 CROSS ASSEMBLER V1.22 -- V2M12 -- Sun Nov 1 19:25:08 2020 Source File: \s2eln.asm 1 | *************************************************** S2E00010 2 | * * S2E00020 3 | * SUBROUTINE NAME- * S2E00030 4 | * FULL NAME- EXTENDED PRECISION NATURAL * S2E00040 5 | * LOGARITHM FUNCTION. * S2E00050 6 | * CODE NAME-ELN/EALOG * S2E00060 7 | * PURPOSE- THIS SUBROUTINE COMPUTES THE NATURAL * S2E00070 8 | * LOGARITHM OF AN EXTENDED PRECISION FLOATING* S2E00080 9 | * POINT NUMBER. * S2E00090 10 | * METHOD-SEE IBM 1130 SUBROUTINE LIBRARY MANUAL.* S2E00100 11 | * CAPABILITIES AND LIMITATIONS- SEE IBM 1130 * S2E00110 12 | * SUBROUTINE LIBRARY MANUAL. * S2E00120 13 | * SPECIAL FEATURES- N/A * S2E00130 14 | * ADDITIONAL INFORMATION- * S2E00140 15 | * ESTIMATED EXECUTION TIME- SEE IBM 1130 * S2E00150 16 | * SUBROUTINE LIBRARY MANUAL * S2E00160 17 | * OTHER- A PERIOD FOLLOWED BY B, APPEARING TO* S2E00170 18 | * THE RIGHT OF COMMENT, INDICATES THAT THE* S2E00180 19 | * NUMBER FOLLOWING IS THE BINARY POINT OF * S2E00190 20 | * THE NUMBER PRESENTLY IN THE ACCUMULATOR.* S2E00200 21 | * LET C REFER TO THE TRUE EXPONENT OF THE * S2E00210 22 | * INPUT ARGUMENT. * S2E00220 23 | * * S2E00230 24 | *************************************************** S2E00240 CALL ELN -V1. 26 | EPR S2E00260 27 | ENT ELN S2E00270 28 | ENT EALOG ASA STD. FORTRAN NAME. S2E00280 0000 0000 29 | EALOG DC 0 FORTRAN ENTRY S2E00290 0001 051C*58D7 30 | LIBF EGETP GET PARAMETER S2E00300 0002 0000 31 | ELN DC 0 USER ENTRY S2E00310 0003 285F 32 | STS STAT SAVE STATUS S2E00320 0004 C37D 33 | LD 3 125 GET INPUT EXPONENT S2E00330 0005 9069 34 | S K1 SUB 128 AND S2E00340 0006 D069 35 | STO K SAVE TRUE EXPONENT S2E00350 0007 C067 36 | LD K1 GIVE FAC AN EFFECTIVE S2E00360 0008 D37D 37 | STO 3 125 EXPONENT OF 0(128) S2E00370 0009 CB7E 38 | LDD 3 126 LD MANTISSA TO TEST S2E00380 000A 4C18 0066R 39 | BSC L LNZER,+- BR IF ZERO S2E00390 000C 4C10 0014R 40 | BSC L MNABS,- BR IF PTV S2E00400 000E C062 41 | LD LNEBT IF ARGUMENT NEGATIVE, S2E00410 000F EB7C 42 | OR 3 124 TURN ON LN ERROR PROGRAM S2E00420 0010 D37C 43 | STO 3 124 INDICATOR. USE ABSOLUTE S2E00430 0011 10A0 44 | SLT 32 VALUE OF ARGUMENT. S2E00440 0012 9B7E 45 | SD 3 126 S2E00450 0013 DB7E 46 | STD 3 126 STORE ABS VALUE IN S2E00460 0014 D86D 47 | MNABS STD FM1 FAC AND IN FM1 S2E00470 48 | * S2E00480 49 | *GET RANGE OF NO. INPUT TO COMPUTE POLYNOMIAL INPUT S2E00490 50 | * S2E00500 0015 906A 51 | S SQRH SUB (SQRT(2))/2 S2E00510 0016 4C10 0020R 52 | BSC L LN1,- BR IF NON-NEG S2E00520 0018 C069 53 | LD FM1 IF NEG,MPY FM1 BY 2 S2E00530 0019 1081 54 | SLT 1 AND STORE IN FM1 AGAIN S2E00540 001A D867 55 | STD FM1 .B1 S2E00550 001B C072 56 | LD C129 GET PROPER EXPONENT S2E00560 001C D37D 57 | STO 3 125 AND STORE IN FAC S2E00570 001D C052 58 | LD K DECR ORIGINAL EXPONENT BY S2E00580 001E 905E 59 | S ONE+1 ONE S2E00590 001F D050 60 | STO K S2E00600 61 | * S2E00610 62 | *COMPUTE THE INPUT TO THE POLYNOMIAL S2E00620 63 | * S2E00630 0020 C861 64 | LN1 LDD FM1 GET F=INPUT MANTISSA S2E00640 0021 F06B 65 | EOR C8000 COMPUTE F-1 .B-1 S2E00650 0022 D85F 66 | STD FM1 S2E00660 0023 0504*4100 67 | LIBF EADD COMPUTE F+1 S2E00670 0024 0084R 68 | DC FONE S2E00680 0025 C37D 69 | LD 3 125 STORE EXPONENT AND S2E00690 0026 D060 70 | STO FP1 MANTISSA OF F+1 IN FP1 S2E00700 0027 CB7E 71 | LDD 3 126 S2E00710 0028 D85F 72 | STD FP1+1 S2E00720 0029 C045 73 | LD K1 SET FAC EXPONENT TO S2E00730 002A D37D 74 | STO 3 125 EFFECTIVE ZERO(128) S2E00740 002B C856 75 | LDD FM1 PUT F-1 IN FAC .B0 S2E00750 002C DB7E 76 | STD 3 126 S2E00760 002D 1559*9500 77 | LIBF NORM NORMALIZE S2E00770 002E 0510*9940 78 | LIBF EDIV COMPUTE (F-1)/(F+1) S2E00780 002F 0087R 79 | DC FP1 S2E00790 0030 C37D 80 | LD 3 125 STORE EXPONENT AND S2E00800 0031 D055 81 | STO Z MANTISSA IN Z S2E00810 0032 CB7E 82 | LDD 3 126 S2E00820 0033 D854 83 | STD Z+1 S2E00830 0034 C05E 84 | LD CSRT GENERATE A SHIFT CON FOR S2E00840 0035 9051 85 | S Z ARGUMENT EXPONENT. S2E00850 0036 D008 86 | STO SRT -C-2+/1880 S2E00860 0037 905A 87 | S CSRTR CHK IF SHIFT LTE 16 S2E00870 0038 4C08 003CR 88 | BSC L *+2,+ BR IF SHIFT IS LTE 16 S2E00880 003A C839 89 | LDD A0 OTHERWISE,DO NOT COMPUTE S2E00890 003B 7014 90 | MDX EPOL HI-ORDER TERMS. .B2 S2E00900 003C CB7E 91 | LDD 3 126 GET Z .B0+C S2E00910 003D 4828 92 | BSC +Z BR IF NOT NEG S2E00920 003E 983D 93 | SD ONE IF NEG,SUB 1 S2E00930 003F 1880 94 | SRT SRT *-* SHIFT FOR EXPONENT .B-2 S2E00940 0040 4828 95 | BSC +Z BR IF NOT NEG S2E00950 0041 883A 96 | AD ONE IF NEG,RESTORE 1 S2E00960 97 | * S2E00970 98 | *CALCULATE POLYNOMIAL RESULT S2E00980 99 | * S2E00990 0042 DB7E 100 | STD 3 126 STORE Z IN FAC .B-2 S2E01000 0043 2750*4000 101 | LIBF XMD COMPUTE Z**2 .B-4 S2E01010 0044 DB7E 102 | STD 3 126 STORE Z**2 IN FAC .B-4 S2E01020 0045 1885 103 | SRT 5 SHIFT TO GET .25*Z**2 .B-1 S2E01030 0046 8833 104 | AD A6 AND ADD A6 .B-1 S2E01040 0047 2750*4000 105 | LIBF XMD (Z**2)*(A6+A8*(Z**2)) .B-5 S2E01050 0048 1884 106 | SRT 4 SHIFT TO ADD A4 .B-1 S2E01060 0049 882E 107 | AD A4 .B-1 S2E01070 004A 2750*4000 108 | LIBF XMD COMPUTE NEXT TERM .B-5 S2E01080 004B 1885 109 | SRT 5 SHIFT TO ADD A2 .B0 S2E01090 004C 8829 110 | AD A2 .B0 S2E01100 004D 2750*4000 111 | LIBF XMD COMPUTE NEXT TERM .B-4 S2E01110 004E 1886 112 | SRT 6 SHIFT TO ADD A0 .B2 S2E01120 004F 8024 113 | A A0 WE NOW HAVE G(Z) .B2 S2E01130 0050 DB7E 114 | EPOL STD 3 126 STORE IN FAC .B2 S2E01140 0051 C03E 115 | LD C12P2 SET FAC TO CORRECT S2E01150 0052 D37D 116 | STO 3 125 EXPONENT=128+2 S2E01160 0053 0551*7A00 117 | LIBF EMPY COMPUTE F1(Z)=Z*(G(Z)) S2E01170 0054 0087R 118 | DC Z F1(Z)=Z*(POLY) S2E01180 0055 C37D 119 | LD 3 125 STORE EXPONENT AND S2E01190 0056 D030 120 | STO Z MANTISSA OF F1(Z) IN FAC S2E01200 0057 CB7E 121 | LDD 3 126 S2E01210 0058 D82F 122 | STD Z+1 S2E01220 123 | * S2E01230 124 | *COMPUTE AND ADD K*LN(2) TO Z*G(Z) TO GET LN(X) S2E01240 125 | * S2E01250 0059 1090 126 | SLT 16 CLEAR EXTENSION S2E01260 005A C015 127 | LD K S2E01270 005B DB7E 128 | STD 3 126 PUT K MANTISSA IN FAC S2E01280 005C C034 129 | LD C1P15 MAKE INTEGER INTO FRACTION S2E01290 005D D37D 130 | STO 3 125 PUT IN FAC S2E01300 005E 1559*9500 131 | LIBF NORM NORMALIZE TO MPY S2E01310 005F 0551*7A00 132 | LIBF EMPY COMPUTE K.LN(2) S2E01320 0060 008AR 133 | DC LN2 S2E01330 0061 0504*4100 134 | LIBF EADD ADD LN(F)=F1(Z) S2E01340 0062 0087R 135 | DC Z WE HAVE LN(X) S2E01350 0063 2000 136 | STAT LDS *-* RESTORE STATUS S2E01360 0064 4C80 0002R 137 | BSC I ELN S2E01370 0066 C00A 138 | LNZER LD LNEBT IF ARGUMENT ZERO, S2E01380 0067 EB7C 139 | OR 3 124 TURN ON LN ERROR PROGRAM S2E01390 0068 D37C 140 | STO 3 124 INDICATOR AND RETURN S2E01400 0069 C004 141 | LD MXNEC LARGEST NEGATIVE NUMBER. S2E01410 006A D37D 142 | STO 3 125 S2E01420 006B C806 143 | LDD MXNEM S2E01430 006C DB7E 144 | STD 3 126 S2E01440 006D 70F5 145 | MDX STAT S2E01450 146 | * S2E01460 147 | *CONSTANTS AREA S2E01470 148 | * S2E01480 006E 00FF 149 | MXNEC DC 255 LARGEST EXPONENT S2E01490 006F 0080 150 | K1 DC 128 CON TO SCALE EXPONENT S2E01500 0070 0000 151 | K DC 0 STORE INPUT EXPONENT S2E01510 0071 0001 152 | LNEBT DC /1 BIT 15--LN ERROR. S2E01520 0072 8000 0001 153 | MXNEM DEC -0.9999999999B0 LARGEST NEG NO. S2E01530 0074 4000 0000 154 | A0 DEC 2.0B2 COEFFICIENTS S2E01540 0076 5555 5479 155 | A2 DEC 0.666666564181B0 OF S2E01550 0078 6667 A27E 156 | A4 DEC 0.400018840613B-1 APPROXIMATING S2E01560 007A 48D7 5558 157 | A6 DEC 0.284535726600B-1 POLYNOMIAL S2E01570 007C 0000 0001 158 | ONE DEC 1 FLT PT ONE S2E01580 007E 0000 0000 159 | N1 DEC 0 FLT PT ZERO S2E01590 0080 5A82 7B6F 160 | SQRH DEC 1.414214B1 STORE INPUT MANTISSA S2E01600 0082 0000 0000 161 | FM1 DEC 0 STORE NON-ZERO ABS VALUE S2E01610 0084 0080 0000 0000 162 | FONE XFLC 0.9999999999 FLT PT ONE S2E01620 0087 0000 0000 0000 163 | FP1 XFLC 0.0 STORE F+1 S2E01630 008A 0080 58B9 0BFC 164 | LN2 XFLC 0.6931471806599452 EXTENDED PREC LN2 S2E01640 0087R 165 | Z EQU FP1 STORE EXTENDED PREC NO. S2E01650 008D 8000 166 | C8000 DC /8000 CON USED TO SUB 1 S2E01660 008E 0081 167 | C129 DC 129 EXPONENT OF +1 S2E01670 008F 007E 168 | C12M2 DC 128-2 EXPONENT OF -2 S2E01680 0090 0082 169 | C12P2 DC 128+2 EXPONENT OF +2 S2E01690 0091 008F 170 | C1P15 DC 128+15 EXPONENT OF +15 S2E01700 0092 1890 171 | CSRTR DC 16+/1880 SHIFT RT 16 CON S2E01710 0093 18FE 172 | CSRT DC 128-2+/1880 EXPONENT SHIFT RT CORR S2E01720 0094 173 | END S2E01730 There were no errors in this assembly === CROSS REFERENCES ========================================================== Name Val Defd Referenced A0 0074R 154 89 113 A2 0076R 155 110 A4 0078R 156 107 A6 007AR 157 104 C129 008ER 167 56 C12M2 008FR 168 C12P2 0090R 169 115 C1P15 0091R 170 129 C8000 008DR 166 65 CSRT 0093R 172 84 CSRTR 0092R 171 87 EALOG 0000R 29 ELN 0002R 31 137 EPOL 0050R 114 90 FM1 0082R 161 47 53 55 64 66 75 FONE 0084R 162 68 FP1 0087R 163 70 72 79 165 K 0070R 151 35 58 60 127 K1 006FR 150 34 36 73 LN1 0020R 64 52 LN2 008AR 164 133 LNEBT 0071R 152 41 138 LNZER 0066R 138 39 MNABS 0014R 47 40 MXNEC 006ER 149 141 MXNEM 0072R 153 143 N1 007ER 159 ONE 007CR 158 59 93 96 SQRH 0080R 160 51 SRT 003FR 94 86 STAT 0063R 136 32 145 Z 0087R 165 81 83 85 118 120 122 135