FAQ  •  Register  •  Login

Stack

<<

na_th_an

Posts: 73

Joined: Fri May 07, 2010 7:34 am

Post Fri Feb 08, 2013 10:35 am

Stack

Maybe this has been solved before, but I can't search for "stack" in the forum 'cause the search engine tells me it's a very common word so it won't be included in the search XD

Were the stack is located? Can I control where it is located without messing things up?

I'm asking this 'cause I'll be trying using extra RAM pages in 128K models for storage.
<<

boriel

Site Admin

Posts: 1463

Joined: Wed Nov 01, 2006 6:18 pm

Location: Santa Cruz de Tenerife, Spain

Post Fri Feb 08, 2013 10:44 am

Re: Stack

Stack is leave untouched, so it's below the RAMTOP (it's set with the CLEAR command in the loader). Basically, it's below your ORG address. So setting ORG at 32767 for example, will enlarge your available stack (at expenses of shrinking the program memory).

Update: Stack is only used for function calls (parameters, return address, etc). So it's possible (with some caution) to change the SP register before calling a function, call it, and restore the SP register upon return, for example. I guess you could use a switched memory bank as a temporary stack. 8)

Return to How-To & Tutorials

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by Vjacheslav Trushkin for Free Forums/DivisionCore.

phpBB SEO