The ISR source code is given below. The comments have been removed to ease reading, but can be viewed on a previous page.
portSAVE_CONTEXT() pushes the entire AVR execution context onto the stack of TaskA, resulting in the stack illustrated below. The stack pointer for TaskA now points to the top of its own context. portSAVE_CONTEXT() completes by storing a copy of the stack pointer. The real time kernel already has copy of the TaskB stack pointer - taken the last time TaskB was suspended.
Next: RTOS Implementation - Detailed Example Step 4