6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 2:11 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Mon May 02, 2022 6:15 pm 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
Okay. Deep breath - and preparing to be embarrassed :-)

Garth Wilson has a LOT of extremely useful stuff on here. if you are reading this Garth - THANK YOU!

However. I am somewhat lost with one small part of Garth's address decoding primer - http://wilsonminesco.com/6502primer/addr_decoding.html

Quote:
Garth has this table:
RAM $0000-3FFF (only 1/2 of 32KB available. Writing to I/O also writes to the upper half of RAM, but
you can't read it back since it would interfere with I/O.)
ROM $8000-FFFF (all 32KB available)
VIA1 $6000-600F
VIA2 $5000-500F
VIA3 $4800-480F
ACIA1 $4400-4403
ACIA2 $4200, 4204, 4208, 420C
ACIA3 $4100, 4104, 4108, 410C
(and up to four more I/O ICs could be added)


I am fine with the RAM and ROM and with VIA1, 2 and 3
When it comes to the ACIAs, I am fine with ACIA1 but I don't see the need to use the addresses 4204, 4208 and 420C. They will work, but what's wrong with 4200, 4201, 4202 and 4203?
Similarly for ACIA3 - the addresses show will work but what's wrong with 4100, 1, 2 & 3?

A little further on Garth has this table, where he talks about unique addresses:

Quote:
62256 SRAM: $0000-3FFF (binary 00xxxxxxxxxxxxxx) (There are no 16Kx8 SRAMs, so here we use half of a 32Kx8.)
6522 VIA1: $4010-401F (binary 010000000001xxxx)
6522 VIA2: $4020-402F (binary 010000000010xxxx)
6522 VIA3: $4040-404F (binary 010000000100xxxx)
6551 ACIA1: $4080-4083 (binary 010000001000xxxx)
6551 ACIA2: $4100-4103 (binary 010000010000xxxx)
6551 ACIA3: $4200-4203 (binary 010000100000xxxx)
27256 ROM: $8000-FFFF (binary 1xxxxxxxxxxxxxxx)


again, I understand the RAM and ROM but the VIAs and ACIAs don't match up with the previous table. I would have expected them to be address subsets of entries in the previous table.

for example, for
VIA1, which I calculate to be selected anywhere from $6000 - $7FFF, its unique range (i.e. when it is selected but nothing else, is $6000 - $60FF - so, I would use $6000-$600F in my programs.
VIA2, which I calculate to be selected anywhere from $5000 - $5FFF AND $7000-$7FFF, its unique range (i.e. when it is selected but nothing else, is $5000 - $50FF - so, I would use $5000-$500F in my programs.
(I similarly don't understand VAI3 or the ACIAS)

I am loath to think Garth has made a mistake, its highly likely it's me. Can someone put me right please!


Top
 Profile  
Reply with quote  
PostPosted: Mon May 02, 2022 8:46 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
The reason I did it that way was to even-out the loads on the address lines a bit, rather than loading A0 and A1 so much.  A2 and A3 go to RS0 and RS1 of ACIA2 and ACIA 3.  This is something you probably wouldn't want to do for the VIAs though, because in a higher-level language, or with the '816, it will sometimes be convenient to do two-byte operations, like reading T1CL and T1CH in a single instruction, something you won't be doing on an ACIA.

I'll look at the page again and see if that fact was omitted.  If it is, then yes, that could lead to confusion.  A few people have wanted to make an eBook out of the 6502 primer, but I heavily discourage that because I'm always making improvements and updates, something which would not get carried through to their eBook.  I have tabs open to a couple of the pages right now to remind me to make some desired improvements.

_________________
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 May 02, 2022 9:10 pm 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
Thanks for the reply Garth. I didn't spot A2 and A3 going to RS0 and RS1 of ACIAs 2 & 3.

Could you help me out with my second query - I don't understand the second table where (for example) it says
Quote:
6522 VIA1: $4010-401F (binary 010000000001xxxx)

but those addresses are not in the range $6000-$7FFF which is where VIA1 is selected.


Top
 Profile  
Reply with quote  
PostPosted: Mon May 02, 2022 9:48 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Oh wow— It just goes to show, yet again, that no matter how care you are, and how many times you proofread, a mistake gets through.  I think I was mixing up different connection ideas here; but I wrote that part so long ago I don't remember for sure.  I'm fixing it now.  There's another reason not to make a .pdf book, just direct readers to the site for all the latest corrections and updates.  (Some have worried that if I disappear, the site will be lost.  I keep the DNS and the service paid years in advance though, and if that's not enough, there's always archive.org that makes frequent backups.)

Thankyou, adrianhudson.

_________________
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 May 02, 2022 10:06 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8546
Location: Southern California
Ok, see if you find anything wrong with what's there now.  Thanks again.

_________________
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: Tue May 03, 2022 2:33 pm 
Offline

Joined: Sat Apr 30, 2022 7:13 pm
Posts: 159
Location: Devon. UK
Thanks Garth, I understand it all now. Looks great.

me <== happy

For anyone else, like me, who likes to see all this stuff visually, here is a diagram (of the whole memory map) I made so I could visualise what was going on. The coloured blocks are the addresses of the devices that are selected. The red entries are the ones that only have one device selected.


Attachments:
m-map.png
m-map.png [ 130.64 KiB | Viewed 17180 times ]
Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 22, 2023 6:21 pm 
Offline

Joined: Sat Jul 31, 2021 4:57 am
Posts: 14
adrianhudson wrote:
For anyone else, like me, who likes to see all this stuff visually, here is a diagram (of the whole memory map) I made so I could visualise what was going on. The coloured blocks are the addresses of the devices that are selected. The red entries are the ones that only have one device selected.


Thanks for this visual representation! This is what my brain needed.


Top
 Profile  
Reply with quote  
PostPosted: Sun Oct 22, 2023 9:53 pm 
Offline
User avatar

Joined: Wed Feb 13, 2013 1:38 pm
Posts: 589
Location: Michigan, USA
I'm a visual person, too. Here's a diagram I made for myself long ago;

Cheerful regards.


Attachments:
Addressing.png
Addressing.png [ 188.82 KiB | Viewed 16688 times ]
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

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