Page 1 of 1
Use all 24 bits address bus on shifts and rotate?
Posted: Fri Apr 17, 2015 2:05 am
by Bryan Parkoff
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
Re: Use all 24 bits address bus on shifts and rotate?
Posted: Fri Apr 17, 2015 3:37 am
by GARTHWILSON
I've only used the '802 version, so I can't speak from experience there; but I think the need to do those things would mostly be in the current data bank, not all over the map requiring constantly changing the data bank register. For the others, you can do for example LDA_long, INA, STA_long, and since they're not needed that often, the penalty isn't much. As kc5tja used to say, you have to make the banking work for you, not against you. He's a forum member but no longer active. He was extremely knowledgeable in programming, and worked as a software engineer at one of the social-media sites (but not facebook, if I understood correctly).
Re: Use all 24 bits address bus on shifts and rotate?
Posted: Fri Apr 17, 2015 4:25 am
by satpro
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: Select all
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.