Bryan Parkoff wrote:
I talk about 65816 microprocessor. ASL, LSR, ROL, ROR, INC, and DEC do not have long absolute addressing. Can you please provide me an example of your code how they can use 24 bits address bus instead of 16 bits address bus. The only alternative option is to load data bank value into accumulator before accumulator is pushed into stack and then pull it out of stack into data bank register. This will add more code length taking more memory space than four bytes on long absolute addressing.
Bryan
Hi Bryan,
Would this work for you?
Code:
lda [dp] ;7 cycles, 2 bytes
asl a ;2 cycles, 1 byte
sta [dp] ;7 cycles, 2 bytes
You're looking at a cost of 16 cycles and 5 bytes in a 16-bit environment, assuming your Direct Page ptr (and data width) is set up ahead of time. The nice thing in this case is that you will not have to worry about data bank manipulation. You can also index with .Y for no extra charge.
Outside of that, your choice is probably limited to pushing/pulling a new data bank (as you suggest), but performing shifts/rotates on data in memory is
really cycle/memory-intensive, regardless of where or how it's done. An
ASL absolute will consume 8 cycles and 3 bytes all by itself, and that's in the same bank, so it's easy to see the advantage of using the accumulator for these types of things.