6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 17, 2024 3:41 pm

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Sat Aug 20, 2005 5:55 pm 
Offline

Joined: Sat Aug 20, 2005 5:52 pm
Posts: 2
Hello! Can anyone analyze in machine cycles the command:

1234 JSR $1000


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 20, 2005 9:03 pm 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
nickgram wrote:
Hello! Can anyone analyze in machine cycles the command:

1234 JSR $1000


I don't understand what you're asking. According to the documentation, that instruction will take 6 cycles. Three are used for fetching the full instruction, two are used for pushing the return address on the stack, and one is a CPU-internal cycle that does nothing visible on the external bus.


Top
 Profile  
Reply with quote  
PostPosted: Sat Aug 20, 2005 10:43 pm 
Offline

Joined: Sat Aug 20, 2005 5:52 pm
Posts: 2
kc5tja wrote:
I don't understand what you're asking. According to the documentation, that instruction will take 6 cycles. Three are used for fetching the full instruction, two are used for pushing the return address on the stack, and one is a CPU-internal cycle that does nothing visible on the external bus.


First of all, thanx a lot for your time. I hope the next example will help you understand what I want.

For example, if we had

100 LDA $1234

than the answer would be:

Phase AB DB Internal operation

1. 0100 LDA PC<-(PC)+1, therefore (PC)=101
2. 0101 34 PC<-(PC)+1, therefore (PC)=102
decoding of LDA
3. 0102 12 PC<-(PC)+1, therefore (PC)=103
4. 1234 (1234) MDR<-(1234)
5. 0103 next opcode PC<-(PC)+1, therefore (PC)=104
ACC<-(MDR)


Top
 Profile  
Reply with quote  
PostPosted: Sun Aug 21, 2005 4:23 am 
Offline

Joined: Sat Jan 04, 2003 10:03 pm
Posts: 1706
nickgram wrote:
First of all, thanx a lot for your time. I hope the next example will help you understand what I want.


Oh, I see. There is a breakdown of the cycles in WDC's 65816 book, which applies also to their 6502. I don't know if it matches 100% with the original NMOS 6502 though.

I don't have the book in front of me at the moment (I'm at work), but if I remember, I'll post the details of JSR for you. I do recommend grabbing their copy though -- it's available here:

http://westerndesigncenter.com/wdc/data ... manual.pdf

IIRC, that book includes a 65816 datasheet in it which has the cycle breakdown. Otherwise, you might want to check here: http://www.6502.org/documents/datasheet ... b_2004.pdf

Thanks.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Aug 22, 2005 2:13 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1748
Location: Sacramento, CA
The WDC 65C02 datasheet also has a cycle breakdown, starting on page 32. (Feb 2004 version).

Daryl


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

All times are UTC


Who is online

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