home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 69 / 069.d81 / copy.pal (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  1KB  |  46 lines

  1. 100 open2,8,1,"0:copy"
  2. 110 sys700
  3. 120 ;
  4. 130 .opt o2
  5. 140 ;
  6. 150 xsad8a =$ad8a
  7. 160 xsaefd =$aefd 
  8. 170 xsb7f7 =$b7f7 
  9. 180 ;
  10. 190 jsr xsaefd ; fetch comma
  11. 200 jsr xsad8a ; get source in fac
  12. 210 jsr xsb7f7 ; convert to integer
  13. 220 sty $b0    ; ($b0) => source addr
  14. 230 sta $b1    ;
  15. 240 jsr xsaefd ; fetch comma
  16. 250 jsr xsad8a ; get dest in fac
  17. 260 jsr xsb7f7 ; convert to integer
  18. 270 sty $b2    ; ($b2) => dest addr
  19. 280 sta $b3    ;
  20. 290 jsr xsaefd ; fetch comma
  21. 300 jsr xsad8a ; get byte count in fac
  22. 310 jsr xsb7f7 ; convert to integer
  23. 320 eor #$ff   ; one's comp of msb
  24. 330 sta $b5    ;  store it away
  25. 340 tya        ;
  26. 350 eor #$ff   ; one's comp of lsb
  27. 360 sta $b4    ;  store it away
  28. 370 inc $b4    ; generate two's compl.
  29. 380 bne dni    ;  of the byte count
  30. 390 inc $b5    ;
  31. 400 ;
  32. 410 dni ldy #0 ; init index register
  33. 420 j37a3 lda ($b0),y ; fetch a byte
  34. 430 sta ($b2),y ; store a byte
  35. 440 iny         ; update index reg
  36. 450 bne dip     ;
  37. 460 inc $b1     ; update pntr msb's
  38. 470 inc $b3     ;  only when necessary
  39. 480 ;
  40. 490 dip inc $b4 ; increment two's comp
  41. 500 bne j37a3   ;  of the byte count
  42. 510 inc $b5     ; loop back while the
  43. 520 bne j37a3   ;  count is negative
  44. 530 rts         ; get back to basic
  45.