6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 23, 2024 4:59 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Apr 17, 2015 2:05 am 
Offline

Joined: Tue Dec 25, 2007 4:57 am
Posts: 109
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


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 17, 2015 3:37 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8545
Location: Southern California
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).

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Fri Apr 17, 2015 4:25 am 
Offline
User avatar

Joined: Thu Nov 27, 2014 7:07 pm
Posts: 47
Location: Ocala, Fl, USA
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 13 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: