Is there some way to copy the stack to an array, then restore it later on a PIC18? I see that we have access to TOS, the stack pointer, and have push and pop instructions. I'd kinda expect pop to then place the contents of the current stack location in a register, then decrement the stack pointer. Instead, the POP discards the data and decrements the stack pointer. I'd expect PUSH to increment the stack pointer, then put the contents of a register on the stack. It sort of does that, but the register it puts on the stack is the PC. Is there any way to put user data on the stack and recover it? I'd like to have an array of arrays, each holding a set of stack contents. I could then multitask by copying the contents of the stack to an array, then loading the stack with the stack contents for another task, then return. Everything would be as it was when we left that task. I almost thought I could do this with the 18 series, but as I look closer, I'm thinking not. Is there a way to copy data on and off the stack? THANKS! Harold -- FCC Rules Updated Daily at http://www.hallikainen.com - Advertising opportunities available! -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist