|
发表于 2013-12-4 16:32:18
|
显示全部楼层
本帖最后由 crazydtone 于 2013-12-4 16:34 编辑
Return Stack Size-
the compiler uses two stacks, one for the return
addresses for the function calls and interrupt handler (known as the hardware stack), and one for parameter passing and local storage (known as the software stack). This option allows you to control the size of the return stack. The size of the software stack does not need to be specified. See Stacks.Each function call or interrupt handler uses two bytes of the return stack and 3 bytes if the CPU is a M256x. Therefore, you need to estimate the deepest level of your call trees (i.e. the maximum number of nested routines your program may call, possibly any interrupts), and enter the appropriate size here. Programs using floating points or longs should specify a hardware stack size of at least 30 bytes. However, in most cases, a hardware stack size of maximum 50 bytes should be sufficient. Since the hardware stack uses SRAM, if you specify a stack that is too large, the stack may overflow into the global variables or the software stack and Bad Things Can Happen.
From ICCAVR.pdf (help documentation) |
|