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.
I looked, is there a _push_(U8 var) to use in C without reverting to inline asm, there is the _nop_() in intrins.h there should be a _push_() and _pop_() as well.
I have ZERO interest in using inlime assembler which I know would solve this. I want to see the C source in the emulator.
Erik
push IE clear EA .... // How can you be sure the compiler doesn't PUSH something here...?? .... pop IE
good point - especially re portability. The one Keil 'trap' I can see is if you are one of those that pass umpteen parametres to a function.
Oh, well, nice thought - bubble burested
Another interesting thing with push/pop in C/C++ code (where the caller is responsible for popping any parameters after a call) is that a compiler can make many function calls before finally shrinking the stack. Such code would not like an intrinsic push/pop directly used by the user code.
This isn't of course not too common in the embedded world, because a lot of hw doesn't the required stack space.