Problem with the stack on m68k
Noah Aklilu
naklilu@ualberta.ca
Wed May 17 10:45:00 GMT 2000
Hi
I writing code for a 68306 board using m68k cross compiler,
and I was getting bus and address errors from my code, not always
in the same location. It seems to be related to problems with the
stack, I have noticed that the compiler allocates portions of the
stack using "link" (e.g. link a6,#$FFEF) to create space for
variables. How does one control the maximum stack size?
Some of the errors seem to be related to corrupt files being
read back from the variable spaced allocated with "link". I
have tested my memory to make sure it is fine.
Having written a few perl programs lately, my main function
ended up being a little large (about 200 lines). As a result it seems
to allocate a large chunk of (about 0xffff) of the stack as variable
space. I have another
program that I tested and it is much smaller (about 20 lines)
and it runs to finish without any problems.
I want to check another thing. When calling assembly routines
from c code, my routine assumes the first value it pops from the
stack is the return address, and the next two values, its input
parameters. So I pop off the return address, save it in a0 (which I
believe I can use as scratch space), and push it back onto the
stack before returning using rts.
Noah Aklilu
MSc Graduate Student
Dept of Electrical and Computer Engineering
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
More information about the crossgcc
mailing list