I am looking to create a stripped out operating system kind of thing for a PIC, this is mostly just to further my knowledge of micro-controllers, the plan is for there to be three tasks running at once, each one appearing transparent to the other tasks.
As I understand it there are two types of stacks in a PIC18, the hardware stack and the software stack, the hardware stack is used for storing program counter return addresses from functions and the software stack is used for storing non-static variables used by functions.
I have written some assembly code using the FSRs to transfer the hardware stack into memory which works fine, I have also copied the working / status registers to memory along with a load of other registers that will be unique to the task, such as the math.h variables.
Basically, I figured it would be faster for me to just change the pointer to the start of the software stack and the software stack frame pointer rather than to copy all of the data out of the software stack into temporary memory and then load the other tasks software stack out of temporary memory.
I understand the concept of how to do this but I cannot find anything in the datasheet that even hints as to the name of the software stack pointers or any registers that can be used to change their values.
Any help is greatly appreciated!
Thanks,
Pheetuz