6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Mon May 20, 2024 1:24 am

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Sun Jun 20, 2021 1:59 pm 
Offline

Joined: Sun Jun 20, 2021 12:21 pm
Posts: 6
Hi i am working on remaking 65c02
https://eater.net/datasheets/w65c02s.pdf
And i cant understand the addressing modes and what they do
Can anyone please explain them to me?


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 20, 2021 2:36 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3354
Location: Ontario, Canada
Welcome!

Chuck Peddle and his team did a terrific job of explaining them in MOS MCS6500 Family Programming Manual.

A lot of effort went into this and the other manuals -- the story ( here ) is actually somewhat humorous. :)

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 20, 2021 3:15 pm 
Offline

Joined: Sun Jun 20, 2021 12:21 pm
Posts: 6
I may have not explained what i wanted to say well
I mean in addressing modes as for the instructions themselves, not how the CPU addresses the memory
Here are some examples, which i still dont understand, of addressing modes


Attachments:
image_2021-06-20_181433.png
image_2021-06-20_181433.png [ 145.44 KiB | Viewed 876 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 20, 2021 5:30 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10802
Location: England
Hi Radiant
welcome to the forum, and to the 6502!

this is quite a small place, and everyone who is likely to answer one of your queries is likely to be reading every new message. So, please don't start a new thread every time - it will actually help you, and us, to be able to see the continuity as you make your journey.

you have set off on a very ambitious challenge, but yes, it is possible to make a 6502 out of logic, whether in simulation, on breadboard or circuit board, or in FPGA. But it is not easy: there's a lot to do, and some complexity and some subtlety. If you have the energy and enthusiasm and sticking power then it's certainly possible to do it. No-one was born knowing how to build a 6502, but many people have done it, so it's a matter of applying yourself, finding out what you don't know, and then coming to know it.

I would not recommend that you post here with every question which occurs to you. It won't help you learn and it might be counterproductive because it might put off the people who can answer. If you want us to do some work, you will need first to show that you have done some work: that you have looked into the question, found out some things, but still have something puzzling you.

That is, this forum is populated by people, who have some amount of time and energy and interest. People who have in many cases already posted hundreds or even thousands of responses. The forum is not a search engine. But you can search it, and I encourage you to do so.

Good luck with your journey!


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 20, 2021 5:39 pm 
Offline
User avatar

Joined: Fri Dec 11, 2009 3:50 pm
Posts: 3354
Location: Ontario, Canada
What's that image you posted, Radiant? Something from WDC doc? I can see how you might be disappointed in that.

So, I guess you need some material that explains the subject in a different way, and/or simply does a better job -- and there's nothing wrong with that. But ask yourself this. Do you think I or some other poster is going to be a better resource for you than a professional author (other than the WDC folk, I mean)? Again I refer you to the MOS Programmning Manual (which is where I learned about address modes, so I know the info is in there).

Another excellent reference is Programming the 65816 Including the 6502, 65C02 and 65802 -- a pdf which I believe is available on the WDC web site.

I see Ed has posted while I was typing, and my message echoes what he said: "If you want us to do some work, you will need first to show that you have done some work."

If you still have a few specific questions after you've done your homework then c'mon back here and we'll try to help. :)

-- Jeff

_________________
In 1988 my 65C02 got six new registers and 44 new full-speed instructions!
https://laughtonelectronics.com/Arcana/ ... mmary.html


Top
 Profile  
Reply with quote  
PostPosted: Sun Jun 20, 2021 9:02 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8440
Location: Southern California
BigEd wrote:
this is quite a small place, and everyone who is likely to answer one of your queries is likely to be reading every new message. So, please don't start a new thread every time - it will actually help you, and us, to be able to see the continuity as you make your journey.

Yes; also, when you continue the same topic, those who have already replied will get an email notifying them that there's an addition to the topic, whereas that won't happen if you start a new one. It's also ok to continue a topic that appears to have been dormant for years, if you have something relevant to say or ask about it. Keep related stuff together, for less forum clutter and to make it clear what things tie together.

About addressing modes:
  • Think of immediate like "Here, take this," and the person hands it to you. Example: LDA #$41
  • Think of direct as "Go ask Bill for the file." IOW, it tells you where to get it. Example: LDA $43A (with no "#")
  • Think of indirect ask "Go ask Bill where to find that resource." IOW, Bill doesn't have it, but he can tell you where to get it. Example: LDA ($6B)
  • Think of indexing like adding to an address, either with or without indirection, to get the final effective address. If with indirection, it can be before or after the indirection. Imagine you're a new employee, and you've met some of the others but don't know all of them yet. Let's say you know where Bill's cubicle is, and someone tells you, "Take this to Lori. She's in the third cubicle after Bill's." The specified address is "Bill's cubicle," and the index register contains a 3, so now you know where to go. Example: LDA $3A60,X
  • Implied just means the location or target doesn't need to be specified (like SEI, which is the SEt Interrupt-disable bit instruction), or the mnemonic itself tells (like DEX, the DEcrement X), or the processor can get the information off the stack (like RTS, the ReTurn-from-Subroutine instruction), or from the stack pointer (like PLA, the PulL Accumulator instruction which knows where from the stack-pointer register)
  • Absolute means the supplied address is 16-bit. It does not necessarily mean there won't be indirection involved.
  • Instructions referring to ZP (zero page, ie, addresses from 0000 to $00FF) save memory and execution time by not having to specify or load an address high byte, because it is assumed to be 00. ZP instructions offer indirect indexed and indexed indirect combinations that are not available in absolute addressing. Examples: LDA ($4E),Y and LDA ($4E,X)

It's possible to do doubly and triply indirect addressing, but we'll leave it for later as it's more advanced. Hopefully I remembered all the main ones.

Most addresses in the code should be given names that are meaningful to humans. The assembler will substitute-in the numerical addresses. This is true for many constants, too. There should be very few numbers showing up in your programming. I just put number above to emphasize that they are actual addresses, even though in most cases I would have names for them in my code, since "$4E" for example doesn't tell you what $4E is used for.

_________________
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: Mon Jun 21, 2021 5:51 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8190
Location: Midwestern USA
GARTHWILSON wrote:
Yes; also, when you continue the same topic, those who have already replied will get an email notifying them that there's an addition to the topic, whereas that won't happen if you start a new one.

That has never happened for me unless I check the Notify me when a reply is posted box when I post something. It doesn't appear to be an automatic feature of the forum software.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon Jun 21, 2021 6:24 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1930
Location: Sacramento, CA, USA
BigDumbDinosaur wrote:
That has never happened for me unless I check the Notify me when a reply is posted box when I post something. It doesn't appear to be an automatic feature of the forum software.

It should be in your User control panel >> Board preferences >> Edit posting defaults >> Notify me upon replies by default: ... I'll link you without knowing for sure if it'll click through at your end.

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 30, 2021 3:42 am 
Offline

Joined: Wed Jun 17, 2020 10:51 am
Posts: 60
this page can help you probably better than any explanation I can come up with: http://skilldrick.github.io/easy6502/#addressing

_________________
No simulation survives contact with reality!


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

All times are UTC


Who is online

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