On Jun 23, 2011, at 8:29 PM, Harold Hallikainen wrote: > Is it possible to read the current stack pointer in C? > If so, what would the instruction be? Exactly or approximately? void *returnsp() { int a; return &a; } Should be pretty close (on almost any processor that uses stack frames =20 for local variables.) Otherwise you get to look at inline assembler and/or assembler =20 subroutines. Don't forget that the MIPS architecture doesn't have an explicit stack =20 (PUSH, POP, CALL, RETURN instructions) (too CISCy, I guess.) So =20 you're at the mercy of everyone following the same subroutine linkage =20 and local variable conventions. BillW --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .