Post Reply 
Both WP 31S and WP 34S manuals now available for individual POD
02-22-2015, 04:23 PM
Post: #41
RE: Both WP 31S and WP 34S manuals now available for individual POD
(02-22-2015 01:44 PM)walter b Wrote:  
(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:-)

This should be best done right in the functions that destroy the stack. In case you're interested, I have an unpublished and unfinished patch that starts like this:
Code:
// Control if higher order functions (solve, integrate, sum, product, f', f'')
// save the stack:
//      0 or undefined: stack isn't saved
//      1:              stack is saved only if called directly from keyboard
//      2:              stack is always saved (may use a lot of memory)
#define HIGHER_ORDER_FUNCTIONS_SAVE_STACK 1
I've only implemented it for f', f'', Σ and Π so far, solve and integrate are still missing. I haven't yet tested it a lot, but the procedure of adding such a feature is relatively straightforward. Because of possible nesting, as Marcus pointed out, option 2 would probably not be very useful.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Both WP 31S and WP 34S manuals now available for individual POD - Bit - 02-22-2015 04:23 PM



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