This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

does KEIL compiler make out stack overflow?

hi all,
pls let me know if there is any provision in KEIL A51 compiler to sport a message if there's a stack over flow in the codes. i.e. if the stack size assigned is small & the codes overtly push & pop.
thanx in advance,
regards,
Bala

Parents
  • I don't see an option for the compiler to insert stack checks on functions calls.

    It's perhaps worth pointing out that stack usage for 8051s in general and Keil in particular is somewhat unusual. The hardware stack is so small that little use is made of it in most cases. Function parameters, locals, and the like are assigned addresses at compile time based on the call tree of the program. A "stack overflow" is really more like a linker error message telling you that your data segments don't all fit.

    Reentrant functions use a stack maintained by software. And the hardware stack does see some use, mostly for function return addresses (though those can be moved to the software stack if desired) and the rare bit of temporary storage.

Reply
  • I don't see an option for the compiler to insert stack checks on functions calls.

    It's perhaps worth pointing out that stack usage for 8051s in general and Keil in particular is somewhat unusual. The hardware stack is so small that little use is made of it in most cases. Function parameters, locals, and the like are assigned addresses at compile time based on the call tree of the program. A "stack overflow" is really more like a linker error message telling you that your data segments don't all fit.

    Reentrant functions use a stack maintained by software. And the hardware stack does see some use, mostly for function return addresses (though those can be moved to the software stack if desired) and the rare bit of temporary storage.

Children
No data