Context switch for AT89C51

Status
Not open for further replies.

Maverickmax

Advanced Member level 1
Joined
Dec 6, 2004
Messages
404
Helped
8
Reputation
16
Reaction score
3
Trophy points
1,298
Activity points
3,689
Hi

I have been trying to develop code to implement context switch but I am not entirely sure how to start at the moment. Would you please kindly tell me where to start and how to use it

Maverick Max
 

1. Disable all interrupts.
2. Push the old program counter on the stack.
3. Push all register on the stack
!!! The stack for each context must be an own array. !!!
4. Set the stackpointer on the stack(array) for the new(next) context.
5. Pop the register from this stack.
6. Enable interrupts.
7. Make an 'ret' instruction.

anything forgotten??

Gomez
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…