TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: BRIAN MCCLOUD
from: DORAN MOPPERT
date: 1997-04-09 12:33:00
subject: Transcendental Functions

 Here's a snippet I chewed out of a newsgroup ages ago .... to generate a 
sine table in 41 bytes. I don't quite follow the properties it is based on, 
as my attempts to generate sinetables always result in me going round in 
circles differentiating sine =P.
;#############################################################
;MakeSinTable creates a 0-1023 integer sine table
;(c) 1993 by Mikko Reinikainen
;#############################################################
MakeSinTable:
    push ds
    pop es
    mov di,offset SinTable
    mov si,offset SinTable+2*256
    push di
    push si
    mov cx,129
    sub ax,ax
L1:
    mov [si],ax
    dec si
    dec si
    stosw
    mov dx,cx
    shl dx,1
    add ax,dx
    Loop L1
 
    pop di
    pop si
    mov cx,256
L2:
    lodsw
    neg ax
    stosw
    Loop L2
    ret
Sintable:
... :  /\__  _)  grooven^designs - grooviest coders this side of the bong!
--- FMail/386 1.0g
---------------
* Origin: Comms Barrier BBS +61.3.9585.1112, +61.3.9583.6119 (3:632/533)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.