Here is how a task's stack looks like when the scheduler activates :

First part (top 8 registers in the diagram) is automatically saved by the interrupt handler, the remaining 8 registers are saved by the following code :
stmia r1!,{r4-r7} // store r4-r7 and increment r1 for each one
mov r2,r8 // r2, r3, r4 and r5 are already saved
mov r3,r9 // so we can use them as intermediary regs
mov r4,r10
mov r5,r11
stmia r1!,{r2-r5} // registers are in order on stack r4...r11
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.