Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lea sincos_1024,a0
- lea 512(a0),a0 ; a0 = 2nd Quadrant Start
- lea 2(a0),a1 ; a1 = 1st Quadrant End + 2
- moveq #11,d0 ; d0.l = x = 11
- moveq #1,d1
- ror.w #2,d1 ; d1.l = y = 16384
- move.w #163,d2 ; d2 = Q = magic division value = 512/PI (162.97466)
- move.w #256-1,d7 ; 256 values in quadrant
- .loop:
- move.l d1,d3
- divu d2,d3
- add.w d3,d0 ; x = x + (y / Q)
- move.l d0,d3
- divu d2,d3
- sub.w d3,d1 ; y = y - (x / Q)
- move.w d1,d3
- neg.w d3
- move.w d3,1024(a0) ; write 4th Quadrant
- move.w d3,1022(a1) ; write 3rd Quadrant
- move.w d1,(a0)+ ; Write 2nd Quadrant
- move.w d1,-(a1) ; Write 1st Quadrant
- dbra d7,.loop
- clr.w -(a1) ; Set SinTable index 0 to 0
- clr.w (a0) ; Set SinTable index 512 to 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement