home *** CD-ROM | disk | FTP | other *** search
/ Transactor / Transactor_13_1986_Transactor_Publishing.d64 / move.pal (.txt) < prev    next >
Commodore BASIC  |  2023-02-26  |  1KB  |  33 lines

  1. 900 sys 700 ;activate pal 64 assembler
  2. 1000 *=828
  3. 1010 ;
  4. 1020 srce    =25             ;parameter - location of srce address
  5. 1030 dest    =27             ;parameter - location of dest address
  6. 1040 nbytes  =29             ;parameter - location of number of bytes
  7. 1050 ;
  8. 1060 nblks   =nbytes+1       ;number of full blocks to move
  9. 1070 ;
  10. 1080 move    lda  nblks      ;get number of full blocks to move
  11. 1090 beq  donebl     ;if none then test for partial block
  12. 1100 lda  #0         ;set comparison value for transfer
  13. 1110 start   sta  remain     ;256 byte blocks (0=256)
  14. 1120 ldy  #0         ;set index to point to first byte of block
  15. 1130 ;
  16. 1140 nxtbyt  lda  (srce),y   ;get next source byte
  17. 1150 sta  (dest),y   ;store at next destination slot
  18. 1160 iny             ;set index to point to next byte
  19. 1170 cpy  remain     ;compare to remaining bytes value
  20. 1180 bne  nxtbyt     ;if not all moved then do next byte
  21. 1190 ;
  22. 1200 inc  srce+1     ;increment srce address by one block
  23. 1210 inc  dest+1     ;increment dest address by one block
  24. 1220 dec  nblks      ;decrement number of full blocks to move
  25. 1230 bmi  done       ;if minus then we are done all bytes
  26. 1240 bne  nxtbyt     ;if positive we have more blocks to do
  27. 1250 ;
  28. 1260 donebl  lda  nbytes     ;do we have a partial block
  29. 1270 bne  start      ;if yes then move it
  30. 1280 done    rts             ;return to calling routine
  31. 1290 ;
  32. 1300 remain  *=*+1           ;number of bytes to move in current block
  33.