Overclockers Australia Forums
OCAU News - Wiki - QuickLinks - Pix - Sponsors  

Go Back   Overclockers Australia Forums > Specific Hardware Topics > Retro & Arcade

Notices


Sign up for a free OCAU account and this ad will go away!
Search our forums with Google:
Reply
 
Thread Tools
Old 5th August 2012, 11:48 PM   #1
callan Thread Starter
Member
 
callan's Avatar
 
Join Date: Aug 2001
Location: melbourne
Posts: 2,724
Default Atari 2600 stack question

I've been mystified for some time by the architecture of the Atari 2600.

It's using a 6507 processor, which is a 6502, with some address lines, IRQ, NMI, SO and a few other pins sawn off - giving it 8K address space. a 6532 RIOT chip provides IO and 128 bytes of RAM, from $0080 through 00ff (the lower 128 bytes is where the TIO (Video chip) registers reside.

Now, on a 6502, the stack is stored in page 1 of memory ($0100-$01FF) - so by all rights there is no stack present for JSR, or other operands that use the stack (like PHP)

This contradicts with my citing of 2600 code, which (naturally) needs JSR to call subroutines. Therefore there must be a stack - HOW??

The only way I can think that the processor can have it's stack in page 1 is if the RAM in the RIOT chip is not properly decoded, and is imaged at $0180-$01FF.

Does anyone here know if this is the case? - or am I barking up the wrong tree?

Callan
__________________
Wanted: Commodore 1571, and/or 1541/II disk drives
callan is offline   Reply With Quote

Join OCAU to remove this ad!
Old 6th August 2012, 11:43 AM   #2
InsaneFurball
Member
 
Join Date: Sep 2005
Location: Launceston TAS
Posts: 551
Default

I.... I.... wut?!

*Leaves thread*
__________________
Intel i5 2500k @ 4ghz || NZXT Havik 140 || Asrock z68 Entreme3 Gen 3 || Leadtek 3gb GTX580 || 8GB G.Skill Ripjaws
WD 1TB SATA || WD 300GB SATA || Thermaltake HX750watt || Coolermaster HAF 922

InsaneFurball is offline   Reply With Quote
Old 6th August 2012, 11:45 AM   #3
power
Member
 
power's Avatar
 
Join Date: Apr 2002
Location: brisbane
Posts: 27,114
Default

you're overthinking it - Atari 2600 = Space Invaders and River Raid.

yeah no idea, maybe ask those programming types in the programming section.
__________________
this is who we are.
power is offline   Reply With Quote
Old 6th August 2012, 12:28 PM   #4
spondy
Member
 
spondy's Avatar
 
Join Date: Jan 2008
Location: Ballajura, WA, 6066
Posts: 196
Default

I think they'd stack quite well once you remove the cartridges.
__________________
Successful Trades:
Statts, solid.egg, Comma, murcielago, TX3, mindstormr, scodye, MetalPhreak, snoopy, gs.mrwolf, downforce, kemitri, mcfee03, OZeight, Scum, terrastrife, 123realtalk, Fedevor
spondy is offline   Reply With Quote
Old 6th August 2012, 1:03 PM   #5
flugle
Member
 
flugle's Avatar
 
Join Date: Jun 2001
Location: Newcastle, NSW
Posts: 795
Default

Mate I'd head over to AtariAge and ask there, there's some incredibly knowledgeable people over there.
flugle is offline   Reply With Quote
Old 8th August 2012, 6:26 PM   #6
callan Thread Starter
Member
 
callan's Avatar
 
Join Date: Aug 2001
Location: melbourne
Posts: 2,724
Default

Quote:
Originally Posted by flugle View Post
Mate I'd head over to AtariAge and ask there, there's some incredibly knowledgeable people over there.
I registered there the other day.
Actually, I'm getting close to working it out. It has to do with the RAM not being "ram" as we know it, but as part of a 6532 RIOT chip (Ram/IO) chip - and how it has some "kinda" chip-select pins that do double-duty as address lines. There is some cross-wiring between the 6507 and 6532 address lines, and these pins, that probably do the trick. I suspect it was a not uncommon trick for using the 6532, but haven't found out any examples in old MOS documentation.

Good suggestion, tho - if I can't nut it out, I'll drop a question there.

Callan
__________________
Wanted: Commodore 1571, and/or 1541/II disk drives
callan is offline   Reply With Quote
Old 19th August 2012, 6:45 PM   #7
dingaling
Member
 
Join Date: Mar 2006
Location: Launceston
Posts: 13
Default

Good on ya Callan, your the da man! we need more ppl like you!

atari 2600 my first console growing up, fond memories!
dingaling is offline   Reply With Quote
Old 22nd August 2012, 10:19 AM   #8
Heywood
Member
 
Join Date: Dec 2001
Posts: 443
Default

Callan,

Did you resolve how this works? I was under the impression that the RIOT memory was seen as both Page 0 and Page 1 to the 6507

Since the stackpointer starts at 7F and decrements as stuff gets shoved onto the stack, as long as you don't push too much* on the stack, you shouldn't be clobbering your real data.

*Too much in the scheme of 128 bytes is actually quite small

Last edited by Heywood; 22nd August 2012 at 3:57 PM. Reason: Originally had FF instead of 7F - It may be the same thing is the the MSB of the address byte is ignored...
Heywood is offline   Reply With Quote
Reply

Bookmarks

Sign up for a free OCAU account and this ad will go away!

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +10. The time now is 7:03 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd. -
OCAU is not responsible for the content of individual messages posted by others.
Other content copyright Overclockers Australia.
OCAU is hosted by Internode!