Advertisement
Guest User

Untitled

a guest
Jan 25th, 2024
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         lea sincos_1024,a0
  2.  
  3.         lea 512(a0),a0          ; a0 = 2nd Quadrant Start
  4.         lea 2(a0),a1            ; a1 = 1st Quadrant End + 2
  5.         moveq   #11,d0              ; d0.l = x = 11
  6.         moveq   #1,d1
  7.         ror.w   #2,d1               ; d1.l = y = 16384
  8.         move.w  #163,d2             ; d2 = Q = magic division value = 512/PI (162.97466)
  9.         move.w  #256-1,d7           ; 256 values in quadrant
  10. .loop: 
  11.         move.l  d1,d3  
  12.         divu    d2,d3
  13.         add.w   d3,d0               ; x = x + (y / Q)
  14.         move.l  d0,d3
  15.         divu    d2,d3
  16.         sub.w   d3,d1               ; y = y - (x / Q)
  17.         move.w  d1,d3
  18.         neg.w   d3
  19.         move.w  d3,1024(a0)         ; write 4th Quadrant
  20.         move.w  d3,1022(a1)         ; write 3rd Quadrant
  21.         move.w  d1,(a0)+            ; Write 2nd Quadrant
  22.         move.w  d1,-(a1)            ; Write 1st Quadrant
  23.         dbra    d7,.loop
  24.  
  25.         clr.w   -(a1)               ; Set SinTable index 0 to 0
  26.         clr.w   (a0)                ; Set SinTable index 512 to 0
  27.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement