We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi ALL, I using STARTUP.A51 in my C51 Project,It will be start the sp at 0x07, becuase I define many idata in my program.When Call a function in C program, The idata overlap the push value make program counter jmup to error address when in debug mode. Why the compilier don't auto setting stack ? Thanks.
"Why the compilier don't auto setting stack ?" Because it doesn't have enough info to do so! The Compiler sees only one source file at a time; it does not know how many other modules may (or may not) be included in your project and, therefore, has no idea what else might be using IDATA!
Thanks a lot. So, How to avoide the event appear when idata overlap stack value.I try to modify the sp, but it seem not good solution for the problem.
Hi Free, How about modifing the following code in startup.a51:
?STACK SEGMENT IDATA RSEG ?STACK DS 64 MOV SP,#?STACK-1