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)
|