Thread: Recursion?
View Single Post
  #15   Spotlight this post!  
Unread 13-12-2003, 22:57
Jay Lundy Jay Lundy is offline
Programmer/Driver 2001-2004
FRC #0254 (The Cheesy Poofs)
Team Role: Alumni
 
Join Date: Jun 2001
Rookie Year: 2001
Location: Berkeley, CA
Posts: 320
Jay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to allJay Lundy is a name known to all
Re: Recursion?

I bet you could simulate a stack on RAM and get one with more size. It would take some work, and you would need to know some asm to do it, but I think it's entirely possible. Rather than using call to jump to the function, which pushes the PC onto the stack, you could just use goto, which just jumps striaght there. Storing variables gets harder though.

I doubt it's worth the effort. Just watch STKPTR<4:0> and make sure your recursive function stops recursing if it sees the stack is near full.