This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more infromation.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

RE: Problem with the stack on m68k


> -----Original Message-----
> From: Noah Aklilu [mailto:naklilu@ualberta.ca]
> Sent: Wednesday, May 17, 2000 11:47 AM
> To: crossgcc@sourceware.cygnus.com
> Subject: Problem with the stack on m68k
> 
> 
> 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.

The m68k stack grows from high memory to low memory.
You control the size of the stack by allocating as much
space as you want and putting the high address in the
%sp.


------
Want more information?  See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]