In keil uvision51 IDE how we will set the starting stackpointer? Is it possible to set it on target settings? If so how?
C or asm? why?
Erik
As Erik points out, your question is not complete. The device hardware will initialize the stack pointer to the last byte of the Register Bank 0. If you invoke any Register bank usage, Keil's startup code will advance the stack pointer to the last byte of last register bank. Then if you define any Bdata useage, Keil will adjust the stack pointer to skip over the Bdata area. So you see we have no real answer to your question unless we know what problem you have. Please remember the C51 stack is NOT a PC stack. Keil mainly uses the stack to pass a limit number of arguments and housekeeping for interrupt handling and function calls. Bradford
No, that is wrong!
Keil C51 never passes any arguments on the stack!
See: http://www.keil.com/appnotes/docs/apnt_129.asp and: http://www.keil.com/support/man/docs/bl51/bl51_ol_fp.htm
etc, ...
Andy; You are absolutly right. My bad. I must of had my head in a dark place when I wrote that. Args are passed/returned via registers where possible and absolute memory locations if args greater than Regs 4 thru 7 can hold. It was not typing errors, just a short between the ears :-( Thanks for the correction. Bradford
I still have it wrong! Args are passed via Reg 2 thru Reg 7. Bradford