6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Mar 28, 2024 1:36 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Page Boundaries
PostPosted: Tue Jun 01, 2004 2:23 pm 
Offline

Joined: Fri May 21, 2004 5:23 pm
Posts: 17
Location: Burlington, ON
Good Day,

I have a question... :?

Assume that an Op Code is being executed under the Absolute X addressing mode. The Op Code itself is on a memory page.

According to the docs I have, the Op Code is followed by two bytes that form a 16-bit address and are added to the X register to form an effective addressing.

When determining if a page boundary is crossed, what is compared?

[a] the Op Code memory page and the effective address memory page (two bytes + X).

OR

[b] the two bytes following the Op Code AND the effective address (two bytes + X)

Some code snipets I found from other developers suggest [b], but I can't find any documentation on this, so of course, I'm questioning whether it's correct.

Thanks for your help in advance,

Andrew


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue Jun 01, 2004 4:02 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8412
Location: Southern California
It doesn't matter where the actual instruction is. When they say an extra clock is taken when you cross a page boundary, that has to do with the indexing itself-- whether the effective address and the address pointed to by the op code are in different pages.

For example, in the instruction LDA 1234,X, where the value in the X register is added to address 1234 to get the effective address to load the accumulator from, the operand's low byte is fetched before the high byte, so the processor can start adding the X register's value before it has the high byte. If there is no carry operation, the entire indexed operation takes only four clocks, which is one microsecond at 4MHz. (I don't think there are any 65c02's being made today that won't do at least 4MHz.) If there is a carry requiring the high byte to be incremented, it takes one additional clock.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 7 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: