Olin Lathrop wrote: > > sergio masci wrote: >> You're assuming that you MUST use the hardware stack to >> call a function, > > On a PIC that is the case if you use the native instructions for that > purpose. You can simulate a call in software, but it will take a > significant number of additional instructions and the return address still > has to be saved somewhere. Also the subroutine has to be written to > support > this since the mechanisms for returning would be different. That's the approach taken by the C compilers for the baseline PICs (which have only a 2-level hardware stack). It's messy, and uses up data memory (to save return address), but works. Ok for very small programs (which may as well have been written in assembler anyway, but that's another discussion...). David Meiklejohn www.gooligum.com.au -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist