1 ;
=========================================================================
2 ;Trig functions for GFX routines Copyright
(c
) 1995 by Mark I Manning IV
3 ;
=========================================================================
5 CosTab equ SinTab+
0800 ;
A Right angle foreward in table
!
7 ;
-------------------------------------------------------------------------
9 ;Return Sin
and Cos of angle AX in variables of same name
12 and ax
,0fff ;
4096 degrees
= 0 degrees
13 mov bx
,ax ;Put into an indexing reg
15 mov ax
,SinTab
[bx
] ;Get Sin
(N
)
16 mov Sin
,ax ;Bah no MOV Sin
,[BX
]... Crap processor!
19 ; Can
NOT use mov ax
,SinTab
[2*ebx
] because in following code BX may go
20 ; negative
and 2* a negative number
= DOUBLY NEGATIVE
!
22 cmp bx
,01800 ;Was Sin
(N
) in last quadrant of circle?
23 if nl
sub bx
,02000 ;Cos
(N
) must
be in first quadrant then
24 mov bx
,CosTab
[bx
] ;Get Cos
(n
)
25 mov Cos
,bx ;Exits with Sin in AX
and Cos in BX too
!
28 ;
=========================================================================