Post Reply 
Both WP 31S and WP 34S manuals now available for individual POD
02-22-2015, 01:44 PM (This post was last modified: 02-22-2015 02:04 PM by walter b.)
Post: #40
Programmed summation preserving the stack
(02-22-2015 10:33 AM)Marcus von Cube Wrote:  Local registers don't increase the amount of available memory they just make a different use of it.

Know that, been there. Nevertheless, assume a function 'Σa' looking like this for a stack depth of 8 levels:
Code:
LBL 'Σa'
LocR 9
STOS .1
Σ 'S'
STO .0
RCLS .0
RTN
So 'Σa' would do the same as Σ and save the stack. The only problem to be solved is the transfer of the address of the routine containing the function to be summed up (here 'S'). See what I mean? And if 'Σa' would call itself again recursively, everything will be fine until we run out of memory - just the way it should work.

d:-)
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Programmed summation preserving the stack - walter b - 02-22-2015 01:44 PM



User(s) browsing this thread: 2 Guest(s)