Category : OS/2 Files
Archive   : EMXLIB8F.ZIP
Filename : SINH.S

 
Output of file : SINH.S contained in archive : EMXLIB8F.ZIP
/ sinh.s (emx+gcc) -- Copyright (c) 1992-1993 by Eberhard Mattes

#include

.globl _sinh

.text

.align 2, 0x90

/ double sinh (double x)

#define cw1 0(%esp)
#define cw2 2(%esp)
/define ret_addr 4(%esp)
#define x 8(%esp)

/ sinh(x) = 0.5 * (exp(x) - exp(-x)) = 0.5 * (exp(x) - 1/exp(-x))

_sinh:
subl $4, %esp / space for control words
fldl x / x
fldl2e / log2 (e)
fmulp / y := x * log2 (e)
fstcww cw1
movw cw1, %ax
andw $0xf3ff, %ax
orw $0x0400, %ax / round down towards -inf
movw %ax, cw2
fldcww cw2
fldl %st / y, y
frndint / int (y), y
fldcww cw1
fxch %st(1) / y, int (y)
fsub %st(1), %st / frac (y), int (y)
f2xm1 / 2 ^ frac (y) - 1, int (y)
faddl __const_ONE / 2 ^ frac (y), int (y)
fscale / 2 ^ frac (y) * 2 ^ int (y), int (y)
fst %st(1) / exp(x), exp(x)
fdivrl __const_ONE / exp(-x), exp(x)
fsubrp / exp(x) - exp(-x)
fmull __const_HALF / 0.5 * (exp(x) - exp(-x))
fstpl x / convert to double
fldl x
addl $4, %esp / Remove control words
_xam
j_inf 1f
ret

.align 2, 0x90
1: SETERRNO($ERANGE)
ret


  3 Responses to “Category : OS/2 Files
Archive   : EMXLIB8F.ZIP
Filename : SINH.S

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/