8 / VERSION 5A 4-26-77 (MH)
12 0 /WORKING SPACE FOR EXPONENT DIDDLE.
26 JA ALGRTN /RETURN NOW.
41 13 /CORRECT EXPONENT DIDDLER.
96 FLDA% BPALOG,1 /ADDR OF X
100 JEQ ALOG0 /IF =0 THEN ERROR
101 JLT ALOGM1 /IF<0 THEN ERROR
102 LDX -1,0 /IF >0 THEN START DOING
103 FSTA ALOG1 /SAVE IN A TEMP.
104 FSUB F1ALOG /KNOCK OFF ONE.
105 JEQ ALGRTN /IF ZERO EXIT. LOG(1)=0
106 JGE ALOGST /IF POSITIVE LOG>0
107 FLDA F1ALOG /NEGITE. INVERT IT.
108 FDIV ALOG1 /BY DIVIDING INTO ONE.
110 LDX 0,0 /RESET SIGN TO NEGATIVE.
111 JA .+3 /AVOID USELESS LOAD INSTRUCTION.
113 ALOGST, FLDA ALOG1 /RECALL NUMBER.
114 FDIV F2ALOG /CUT IN HALF.
115 FSTA ALOGTM /PREPARE FOR EXPONENT DIDDLE.
116 FLDA ALOGMG /SET THE EXPONENT OF THE EXPONENT TO 13.
117 FSTA ALOGTM-3 /SO THAT NORMALIZE WILL DO JOB.
118 FSTA ALOGTM+1 /AND ALSO ZERO OUT LOW ORDER POART OF EX. MANT.
119 FLDA ALOGTM-1 /RECALL THE NUMBER
121 FMUL ALOGE2 /NOW MULITPLY EXPONENT BY LOG E 2
122 FSTA ALOG2 /AND SAVE IT FOR A SECOND.
123 FLDA ALOG1 /RECALL THE NUMBER AGAIN.
124 FSTA ALOGTM /STORE IN THE TEMPORARY WORKER.
125 FLDA FPI2-2 /RECALL WORD WITH LOW ORDER ONE.
126 FSTA ALOGTM-2 /STORE AWAY.
127 FLDA ALOGTM /RECALL NUMBER WITH AN EXPONENT OF 1
128 FSUB F1ALOG /SUBTRACT AWAY.
129 FSTA ALOG1 /AND STORE
130 FMUL ALOGL8 /MULTIPLY BY THE CONSTANT.
133 FADD ALOGL6 /AND SO ON DOWN THE LINE.
145 FADD ALOG2 /CORRECT NOW.ADD IN EXPONENT.
146 JXN ALGRTN,0 /EXIT IF SIGN IS OK.
147 FNEG /ELSE NEGATE IT.