??? 08/07/05 22:28 Read: times |
#98970 - it's perfectly safe... Responding to: ???'s previous message |
... to use this kind of stack manipulation, even if an interrupt breaks in. Think of it - you should be able to do what you want under current sp, as no other routine including interrupts should corrupt that area. This fact is heavily used on processors with not so restricted stack as the '51, where high level compilers place local variables onto stack and mannipulate them happily... That its limited to a single register bank (not necessarily 0) was indirectly mentioned by Oleg and I think is no drawback in majority o programs. I have mentioned this saying already (and I will be happy if somebody will tell me it's english equivalent, if there is any) - who's afraid of wolves should not go to forest. If one doesn't feel cofident enough shall not use this kind of constructions and stick down to "safe methods" - but in extreme siuations it's sometimes good to have some small "tricks" around, carefully crafted and used... Personally, I consider these as small pieces of art and enjoy them. Jan Waclawek |