Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic 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.

Register Log in

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,691
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
 

Gomez

Full Member level 2
Joined
Feb 12, 2002
Messages
125
Helped
10
Reputation
20
Reaction score
3
Trophy points
1,298
Activity points
1,006
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.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top