Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top