6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 15, 2024 10:25 pm

All times are UTC




Post new topic Reply to topic  [ 6 posts ] 
Author Message
PostPosted: Fri May 21, 2004 5:31 pm 
Offline

Joined: Fri May 21, 2004 5:23 pm
Posts: 17
Location: Burlington, ON
I came across the chart below in a 6502 manual for the Indirect Addressing mode (JMP instruction).

The problem with the chart is that it does not specify where the data goes. For example, on cycle 2, where does it put the AAL so that it doesn't get overwritten by the AAH on cycle 3?

Please help.

Andrew :roll:

--- CHART ---

CYCLE # | ADDRESS BUS | DATA BUS
1 | PC | OpCode
2 | PC + 1 | AAL
3 | PC + 2 | AAH
4 | PC + 2 | AAH
5 | 0,AA | New PCL
6 | 0,AA | New PCH

PC = Program Counter
AA = Absolute Address
AAL = Low-byte of Absolute Address
AAH = High-byte of Absolute Address
PCL = Low-byte of Program Counter
PCH = High-byte of Program Counter


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri May 21, 2004 5:51 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
WDC's simplified internal architecture block diagram just calls it an "input data latch" (DL register).

For future reference, in order to avoid losing the extra spaces in your diagram so you can preserve the vertical alignment, uncheck the "Disable BBCode in this post" box under the window where you're writing, and mark the block and click "Code" above the window. You can still go back and edit your post later too.


Top
 Profile  
Reply with quote  
PostPosted: Fri May 21, 2004 7:51 pm 
Offline

Joined: Fri May 21, 2004 5:23 pm
Posts: 17
Location: Burlington, ON
GARTHWILSON wrote:
WDC's simplified internal architecture block diagram just calls it an "input data latch" (DL register).


So does this mean that on cycle 3, the Address Bus contains AAH and the Input Data Latch contains the AAL?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri May 21, 2004 8:04 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
On the third cycle, the address bus has the address of the third byte of the 3-byte JMP instruction.

The diagram shows this DL with connections to both the internal ADL and the internal ADH, so it probably has two 8-bit halves. From a programming standpoint, what matters is what each instruction does and how many clocks it takes-- not necessarily how it does it internally. Some of the internal pipelining is interesting to see how the processor can do several operations in one clock so each instruction takes very few clocks; but that information is not essential to doing a good job of programming. It would be more useful if you're trying to write VHDL or Verilog code to make your own processor with an FPGA.


Top
 Profile  
Reply with quote  
PostPosted: Fri May 21, 2004 8:16 pm 
Offline

Joined: Fri May 21, 2004 5:23 pm
Posts: 17
Location: Burlington, ON
I'm asking because I'm working on an 6502 emulator and you're right that although I don't need to know what the chip's doing with the byte that's on the Data Bus (I can store it in a variable), I am interested in understanding what the chip itself does with the previous byte on the Data Bus - I mean it must store it somewhere? Otherwise how can it join the AAH and AAL together to create the resulting 16-bit address?

Andrew :?:


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri May 21, 2004 8:48 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
You would do well to get WDC's programming manual. It's kind of expensive at $60 or so, but indispensable for anyone serious at this game. Their data sheets also give some cycle-by-cycle information. If you make your buses reflect the same thing as the actual processor's buses, I suppose how you do it internally wouldn't matter much although it would probably end up being similar to how Bill Mench (the designer) did it. WDC's website is www.westerndesigncenter.com .


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

All times are UTC


Who is online

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