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 revisionPrevious revision
Next revisionBoth sides next revision
base:advanced_optimizing [2017-03-04 22:25] – [DCP/ISC] monte_carlosbase:advanced_optimizing [2017-04-05 14:23] – [SHX/SHY] bitbreaker
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 teh stored values, you can of course choose a different address.+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 1, constructions like shy $feff,x (x = 1) are possible. Thus values will still be anded with $ff but stored to $ffxx.
  
 Want some example? Want some example?
base/advanced_optimizing.txt · Last modified: 2024-03-03 11:06 by bitbreaker