User Tools

Site Tools


base:swapping_zp_data

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

base:swapping_zp_data [2015-04-17 04:34] (current)
Line 1: Line 1:
 +====== Swapping ZeroPage data ======
  
 +On some occasions you might want to save and restore ZP data. I.e. you have no time to patch a SID player, or the speedup you gain by giving several routines full ZP access is worth it. The small snippet below swaps 10 bytes from $00 on with memory in $10. It clutters X,Y and A though. Enjoy, enthusi.
 +
 +<​code>​
 +   ldx #10 
 +loop 
 +   ldy $00,x 
 +   lda $10,x 
 +   sta $00,x 
 +   sty $10,x 
 +   ​dex ​
 +   bpl loop
 +</​code>​
base/swapping_zp_data.txt ยท Last modified: 2015-04-17 04:34 (external edit)