User Tools

Site Tools


base:advanced_optimizing

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
base:advanced_optimizing [2017-04-05 14:23]
bitbreaker [SHX/SHY]
base:advanced_optimizing [2017-11-20 08:49] (current)
bitbreaker [SHX/SHY]
Line 932: Line 932:
 ===== SHX/SHY ===== ===== SHX/SHY =====
  
-When storing to zeropage you can also store the y- and x-register with an index in a fast and comfortable way. But often you will need the zeropage for other things. Sadly the instruction set of the 6510 is not orthogonal and thus this features are not available for 16 bit addresses. You can however workaround that nuisance by using SHX or SHY, but have to cope with the H component in it, as the stored values are anded with the highbyte of the destination address + 1. So most of the time you might want to store to $fexx to not run into any problems. In case you have to apply an additional static mask, or if you just need certain bits of the stored values, you can of course choose a different address. ​Also, if you can life with an index starting from 1constructions like shy $feff,x (x = 1) are possibleThus values ​will still be anded with $ff but stored ​to $ffxx.+When storing to zeropage you can also store the y- and x-register with an index in a fast and comfortable way. But often you will need the zeropage for other things. Sadly the instruction set of the 6510 is not orthogonal and thus this features are not available for 16 bit addresses. You can however workaround that nuisance by using SHX or SHY, but have to cope with the H component in it, as the stored values are anded with the highbyte of the destination address + 1. So most of the time you might want to store to $fexx to not run into any problems. In case you have to apply an additional static mask, or if you just need certain bits of the stored values, you can of course choose a different address. ​If you start crossing a page with the index, ​the behaviour of this opcode changes radicallyIn those cases the Y-value becomes the highbyte of the address the values ​is stored ​at
  
 Want some example? Want some example?
base/advanced_optimizing.txt ยท Last modified: 2017-11-20 08:49 by bitbreaker