Guest User

Untitled

a guest
Nov 12th, 2015
146
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ******************************************
  2. * Naively divides CC:D by Y
  3. * Returns D:division, X:remainder
  4. ******************************************
  5. div    pshs   d,y
  6.        ldx    #-1
  7.        bcc    loop1
  8.        bsr    loop2
  9.        andcc  #254
  10. loop1  bsr    loop2
  11.        addd   2,s
  12.        std    2,s
  13.        stx    ,s
  14.        puls   d,x,pc
  15. loop2  leax   1,x
  16.        subd   4,s
  17.        bcc    loop2
  18.        rts
RAW Paste Data