2010-12-19 02:33 PM
Operations during PUSH and POP
2011-05-17 05:18 AM
PUSH and POP *instructions* can handle one or multiple registers, depending on what you define in the operand.
For stacking of interrupts, the processors pushes R0,R1,R2,R3,R12,LR, PC and PSR onto the stack. When tail chaining these are not popped back until the last interrupt completes. As I recall the value you see in LR during the interrupt is a magic value that defines the processor state/stack from which to return. Google ''cortex-m3 interrupt stack frame'', and review Joseph Yiu's book.2011-05-17 05:18 AM
2011-05-17 05:18 AM
''I want to totally control what is stacked or not, I don't want it to be compiler-dependent, or what so ever.''
In that case, youmust
use assembler! The whole point of a High-Level Language (HLL) - any HLL - is that you choose to delegate this stuff to the compiler. If you cannot accept that delegation, then you cannot use a HLL - or, at least, not for that part of the code.''is there any (hopefully portable) way to force IAR (hopefully as most compilers as possible) to push the registers I want to push'' No.2011-05-17 05:18 AM
''I want to totally control what is stacked or not''
Why do you want to do this?2011-05-17 05:18 AM