Surprisingly Useful PIC18F Discovery

view story

http://forum.allaboutcircuits.com – 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 (Embedded)