Having used the 18F series Microchips only for several years, I know I don't know a tenth of what they can do...
I just learned something I'd never noticed before: The CALL and RETURN instructions have an extra argument 's'.
According to the datasheet, if the 's' argument is 1, then WREG, STATUS, and BSR are pushed onto the "fast return stack" for a CALL and popped off the stack for a RETURN.
Neat, I thought...I could find some use for this.
Now you need be careful when playing around as these use the "fast return stack" and that is the same fast return stack that is used for interrupts, regardless if RETFIE FAST instruction is used or not.
So, basically, if you are not using interrupt at all you can grab the benefit of a super fast call and return for that one precious routine you need damn fast. Or multiple routines if you are damn careful not to call one from another.
Leave it Microchip to leave no trick unused and make available some hardware where you just may need it.
It's all well documented in the data sheet between the "INSTRUCTION SET SUMMARY" section 24.0 and section 9.9 "Context Saving During Interrupts."
Just thought I'd bring this up for those who might be interested.
I just learned something I'd never noticed before: The CALL and RETURN instructions have an extra argument 's'.
According to the datasheet, if the 's' argument is 1, then WREG, STATUS, and BSR are pushed onto the "fast return stack" for a CALL and popped off the stack for a RETURN.
Neat, I thought...I could find some use for this.
Now you need be careful when playing around as these use the "fast return stack" and that is the same fast return stack that is used for interrupts, regardless if RETFIE FAST instruction is used or not.
So, basically, if you are not using interrupt at all you can grab the benefit of a super fast call and return for that one precious routine you need damn fast. Or multiple routines if you are damn careful not to call one from another.
Leave it Microchip to leave no trick unused and make available some hardware where you just may need it.
It's all well documented in the data sheet between the "INSTRUCTION SET SUMMARY" section 24.0 and section 9.9 "Context Saving During Interrupts."
Just thought I'd bring this up for those who might be interested.