6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Mar 28, 2024 7:56 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Reasons to R/W to Stack?
PostPosted: Wed Mar 10, 2004 4:02 pm 
Offline

Joined: Tue Aug 26, 2003 6:57 pm
Posts: 4
:oops:
:?:
I am just about done rewriting original 6502 code over onto another processor. Part of the dissasembly of the original code (source code not available) has several (4 or 5) reads and / or writes directly to specific, fixed stack memory locations (between $120 and $140).

My question, does anyone know a reason a program would do this?

PS this is not:
TAS

It is:
LDA $0132


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 10, 2004 4:24 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1668
Location: Sacramento, CA
Since the 6502 starts the stack at $01FF and builds it down as needed, its possible that your program was using the space below the expected maximum size the system needed for stack use. This could be especially true if the original hardware had limited RAM. On my system, my OS only uses about 16 bytes of the stack.

This is just one possibility.

Another possible answer (slight as it may be), is that some sort of I/O device might have been mapped to the lower portion of the stack space as well.

Daryl


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 10, 2004 6:39 pm 
Offline

Joined: Tue Aug 26, 2003 6:57 pm
Posts: 4
:D
Thanks Daryl.

I think you hit the nail on the head. The original design had 00-FF only for RAM. It did have 3 PIAs at 200, 280 and 300H that did have some RAM; However, they were only used for I/O.

Thanks again. Guess I'll just move them up to upper RAM.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Mar 10, 2004 7:10 pm 
Offline
User avatar

Joined: Fri Aug 30, 2002 9:02 pm
Posts: 1668
Location: Sacramento, CA
I'm glad to help!

:D


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] 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: