; math_logs.asm ; ; Assembly language source for the ln(x), ; and log(x) functions: include math.inc include aoalib.inc ; LOG(x)- Computes the base 10 logarithm of x. ; Usual range for x (>0). ; ; LOG(x) = lg(x)/lg(10). .code math_log proc fld1 fxch fyl2x ; Compute 1*lg(x). fldl2t ; Load lg(10). fdivp ; Compute lg(x)/lg(10). ret math_log endp ; LN(x)- Computes the base e logarithm of x. ; X must be greater than zero. ; ; ln(x) = lg(x)/lg(e). math_ln proc fld1 fxch fyl2x ; Compute 1*lg(x). fldl2e ; Load lg(e). fdivp ; Compute lg(x)/lg(10). ret math_ln endp end