rilo

6510 Copy data

Feb 20th, 2018
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Simply copy routine by Scan
  2. //
  3. // Copies every 16th byte from $1000-$2000 to $2000-
  4. // Uses the undocumented opcodes AXS and ISC
  5. // Reference: No More Secrets http://csdb.dk/release/?id=161035
  6. // Copy routine to zero page for less cycle consumption
  7. .const ENDPAGE = $20
  8.  
  9. BasicUpstart2(main)
  10.  
  11. main:   ldy #$00
  12.         ldx #$00
  13. .label xhi= *+2
  14. repeat: lda $1000,x
  15. .label yhi= *+2
  16.         sta $2000,y
  17.         txa
  18.         axs #$f0        // X= A&X-#imm, adds #$10, carry is always clear before operation
  19.         bcc !+          // carry set if overflow
  20.         lda #ENDPAGE
  21.         sec
  22.         isc xhi
  23.         beq done
  24. !:      iny
  25.         bne repeat
  26.         inc yhi
  27.         bcc repeat
  28. done:   rts
  29.  
  30. .pc = $1000
  31. .fill $1000,i
Add Comment
Please, Sign In to add comment