home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 90 / 090.d81 / lab.asmm < prev    next >
Encoding:
Text File  |  1991-01-01  |  863 b   |  56 lines

  1.   .title Memory Move Routine
  2.  
  3. *=$c000
  4.  
  5. start= $fb
  6. end= $fd
  7. dest    = $03
  8. temp= $02
  9.  
  10.  
  11. ;to use this from BASIC
  12.         ;poke 251,start low
  13. ;poke 252,start high
  14.         ;poke 253,end low
  15.         ;poke 254,end high
  16.         ;poke 3,destination low
  17.         ;poke 4,destination high
  18.     ;sys 49152
  19.  
  20.  
  21. entry:ldx#0;init. index
  22. loop:lda (start,x);get byte
  23. sta (dest,x);store it
  24.  
  25. ;now inc start address
  26.  
  27. incstart;inc start lo
  28. bneskip1;go if not 0
  29. incstart+1;inc hi byte
  30.  
  31. ;increment the destination
  32.  
  33. skip1:incdest;inc dest lo
  34. bneskip2;go if not 0
  35. incdest+1;inc hi byte
  36.  
  37. ;now, see if all bytes
  38. ;have been moved.
  39.  
  40. skip2:sec;perform a 16
  41. ldastart;bit compare
  42. sbcend
  43. statemp
  44. ldastart+1
  45. sbcend+1
  46. oratemp
  47. beqloop;go if equal
  48. bccloop;and if less
  49.  
  50. ;all done!
  51.  
  52. rts;return
  53.  
  54. .end
  55.  
  56.