Hello all, In my application I need to access to the value that Stack is initialized, in general C51 does it in the startup code: MOV SP,#?STACK-1 What I need is to be able to use later on in my code the value "?STACK-1" and copy it to other variable. Thanks for your help in advance! Alfredo M.
"For example is sp is initialized to 0x42 (in startup routine) after power up, I need to put this value (0x42) in some variables later on in my proyect." Yep, I'm with you so far (although I have no idea why one would want to do this). What I told you before still stands. main() is LJMP'ed to by my runtime startup (maybe yours doesnt'), so this works:
sp = SP;
sp = SP - 2;