Post Reply 
WP 34S and 31S bugs and fixes
01-12-2015, 12:48 AM
Post: #99
RE: WP 34S and 31S bugs and fixes
(01-11-2015 09:40 PM)Paul Dale Wrote:  
(01-11-2015 06:51 PM)DMaier Wrote:  I think this is a bug...

They have never preserved the stack -- they've always behaved like solve/integrate and taken over and replaced the stack. A price to pay for calling a users' code basically.


Pauli

This wouldn't be difficult to change if that's desired, see the patch below. Solve and integrate could probably be adapted in a similar way. (STOS/RCLS aren't currently used by any XROM routines so it's safe to change their behavior when called from XROM.)

Code:
diff -ur wp34s_r3723/xeq.c wp34s_sum_prod_save_stack_r3723_20150111/xeq.c
--- wp34s_r3723/xeq.c    2015-01-10 23:35:52.000000000 -0500
+++ wp34s_sum_prod_save_stack_r3723_20150111/xeq.c    2015-01-11 19:44:51.956524634 -0500
@@ -1859,7 +1859,8 @@
 
 /* Save and restore the entire stack to sequential registers */
 static int check_stack_overlap(unsigned int arg) {
-    const int n = stack_size();
+    // Save or restore full user stack even if called from XROM.
+    const int n = (UState.stack_depth ? 8 : 4);
 
     if (arg + n <= global_regs() || arg >= NUMREG) {
         return n;
diff -ur wp34s_r3723/xrom/prodsum.wp34s wp34s_sum_prod_save_stack_r3723_20150111/xrom/prodsum.wp34s
--- wp34s_r3723/xrom/prodsum.wp34s    2014-11-15 13:18:44.000000000 -0500
+++ wp34s_sum_prod_save_stack_r3723_20150111/xrom/prodsum.wp34s    2015-01-11 19:46:48.944521816 -0500
@@ -32,8 +32,8 @@
         XLBL"SIGMA"                /* Entry: SUMMATION */
             INTM?
                 ERR ERR_BAD_MODE
-            LocR 04                /* Registers .00 to .03 */
-            STO .03                /* Save for LastX*/
+            LocR 11                /* Registers .00 to .10 */
+            STOS .03            /* Save stack */
             SPEC?
                 JMP sum_product_nan
             STO .00
@@ -71,8 +71,8 @@
         XLBL"PRODUCT"                /* Entry: PRODUCT */
             INTM?
                 ERR ERR_BAD_MODE
-            LocR 04                /* Registers .00 to .03 */
-            STO .03
+            LocR 11                /* Registers .00 to .10 */
+            STOS .03            /* Save stack */
             SPEC?
                 JMP sum_product_nan
             STO .00
@@ -95,11 +95,9 @@
 product_entry::        DSL .00
                 JMP product_loop
 
-sum_product_okay::    RCL .03
+sum_product_okay::    RCLS .03
             STO L
-            Num 0
-            FILL
-            RCL .01
+            x[<->] .01
             RTN
 
 sum_product_nan::    Num NaN
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
WP 34S and 31S bugs and fixes - Bit - 11-22-2014, 07:49 PM
RE: WP 34S and 31S bugs and fixes - Bit - 11-23-2014, 06:48 PM
RE: WP 34S and 31S bugs and fixes - Bit - 11-24-2014, 02:21 AM
RE: WP 34S and 31S bugs and fixes - Bit - 11-25-2014, 05:11 AM
RE: WP 34S and 31S bugs and fixes - Bit - 11-26-2014, 05:24 AM
RE: WP 34S and 31S bugs and fixes - Bit - 11-26-2014, 01:35 PM
RE: WP 34S and 31S bugs and fixes - Bit - 11-26-2014, 01:38 PM
RE: WP 34S and 31S bugs and fixes - Bit - 11-26-2014, 07:56 PM
RE: WP 34S and 31S bugs and fixes - Bit - 11-27-2014, 02:13 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-31-2015, 01:32 AM
RE: WP 34S and 31S bugs and fixes - Bit - 11-29-2014, 08:31 PM
RE: WP 34S and 31S bugs and fixes - Bit - 12-06-2014, 03:23 AM
RE: WP 34S and 31S bugs and fixes - Bit - 12-06-2014, 03:02 PM
RE: WP 34S and 31S bugs and fixes - Bit - 12-07-2014, 09:38 PM
RE: WP 34S and 31S bugs and fixes - Bit - 12-12-2014, 03:20 PM
RE: WP 34S and 31S bugs and fixes - Bit - 12-06-2014, 08:44 PM
RE: WP 34S and 31S bugs and fixes - Bit - 12-07-2014, 10:01 PM
RE: WP 34S and 31S bugs and fixes - Bit - 12-08-2014, 03:38 PM
RE: WP 34S and 31S bugs and fixes - Bit - 12-08-2014, 05:19 PM
RE: WP 34S and 31S bugs and fixes - Bit - 12-08-2014, 05:49 PM
RE: WP 34S and 31S bugs and fixes - Bit - 12-08-2014, 06:34 PM
RE: WP 34S and 31S bugs and fixes - Bit - 12-16-2014, 02:57 AM
RE: WP 34S and 31S bugs and fixes - Bit - 12-24-2014, 01:09 PM
RE: WP 34S and 31S bugs and fixes - Bit - 12-24-2014, 02:36 PM
RE: WP 34S and 31S bugs and fixes - Bit - 12-24-2014, 04:30 PM
RE: WP 34S and 31S bugs and fixes - Bit - 12-17-2014, 12:55 AM
RE: WP 34S and 31S bugs and fixes - Bit - 12-23-2014, 04:03 AM
RE: WP 34S and 31S bugs and fixes - Bit - 12-23-2014, 01:23 PM
RE: WP 34S and 31S bugs and fixes - Bit - 12-23-2014, 04:48 AM
RE: WP 34S and 31S bugs and fixes - Bit - 12-23-2014, 01:38 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-01-2015, 10:42 PM
RE: WP 34S and 31S bugs and fixes - Bit - 12-24-2014, 01:11 PM
RE: WP 34S and 31S bugs and fixes - Bit - 12-24-2014, 04:36 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-08-2015, 03:04 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-08-2015, 04:34 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-08-2015, 05:28 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-09-2015, 12:32 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-09-2015, 12:38 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-10-2015, 06:28 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-17-2015, 04:50 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-18-2015, 03:42 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-18-2015, 05:32 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-18-2015, 06:47 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-18-2015, 08:54 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-18-2015, 09:12 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-18-2015, 09:37 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-11-2015, 05:07 AM
RE: WP 34S and 31S bugs and fixes - DMaier - 01-11-2015, 06:51 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-12-2015 12:48 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-12-2015, 01:31 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-12-2015, 02:00 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-12-2015, 05:44 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-12-2015, 11:39 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-17-2015, 02:34 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-17-2015, 05:16 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-17-2015, 05:47 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-17-2015, 04:20 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-17-2015, 04:35 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-18-2015, 03:11 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-18-2015, 09:56 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-24-2015, 04:37 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-25-2015, 04:42 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-25-2015, 05:27 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-25-2015, 05:50 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-25-2015, 06:08 PM
RE: WP 34S and 31S bugs and fixes - Bit - 01-28-2015, 12:26 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-21-2015, 12:40 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-22-2015, 05:16 AM
RE: WP 34S and 31S bugs and fixes - Bit - 01-31-2015, 12:52 AM
RE: WP 34S and 31S bugs and fixes - Bit - 02-07-2015, 06:17 PM
RE: WP 34S and 31S bugs and fixes - Bit - 02-08-2015, 05:58 PM
RE: WP 34S and 31S bugs and fixes - Bit - 02-20-2015, 04:52 AM
RE: WP 34S and 31S bugs and fixes - Bit - 02-24-2015, 03:50 AM
RE: WP 34S and 31S bugs and fixes - Bit - 03-15-2015, 04:55 PM
RE: WP 34S and 31S bugs and fixes - Dieter - 03-15-2015, 10:41 PM
RE: WP 34S and 31S bugs and fixes - Bit - 03-15-2015, 10:50 PM
RE: WP 34S and 31S bugs and fixes - Pascal - 05-07-2015, 07:47 AM
RE: WP 34S and 31S bugs and fixes - fhub - 05-07-2015, 11:56 AM
RE: WP 34S and 31S bugs and fixes - fhub - 05-07-2015, 02:05 PM
RE: WP 34S and 31S bugs and fixes - fhub - 05-07-2015, 03:23 PM
RE: WP 34S and 31S bugs and fixes - fhub - 05-09-2015, 05:19 PM
RE: WP 34S and 31S bugs and fixes - Marcio - 06-10-2015, 07:06 AM
RE: WP 34S and 31S bugs and fixes - Marcio - 06-10-2015, 01:06 PM
RE: WP 34S and 31S bugs and fixes - 2far - 08-27-2015, 11:06 AM
RE: WP 34S and 31S bugs and fixes - 2far - 08-27-2015, 04:09 PM
RE: WP 34S and 31S bugs and fixes - 2far - 08-27-2015, 09:55 PM
RE: WP 34S and 31S bugs and fixes - fhub - 10-01-2015, 03:37 PM
RE: WP 34S and 31S bugs and fixes - d b - 10-02-2015, 03:21 AM
RE: WP 34S and 31S bugs and fixes - Pascal - 12-21-2015, 04:40 PM
RE: WP 34S and 31S bugs and fixes - Marcio - 12-21-2015, 08:41 PM
RE: WP 34S and 31S bugs and fixes - fhub - 12-22-2015, 10:39 AM
RE: WP 34S and 31S bugs and fixes - fhub - 12-22-2015, 01:20 PM
Moving off-screen window - striegel - 01-13-2016, 11:10 AM
RE: WP 34S and 31S bugs and fixes - fhub - 01-13-2016, 03:10 PM
RE: WP 34S and 31S bugs and fixes - Leonid - 02-04-2017, 06:48 AM
RE: WP 34S and 31S bugs and fixes - Nick - 02-07-2017, 02:47 PM
RE: WP 34S and 31S bugs and fixes - Leonid - 02-08-2017, 08:10 AM
RE: WP 34S and 31S bugs and fixes - Nick - 02-08-2017, 08:41 AM
RE: WP 34S and 31S bugs and fixes - vido - 02-07-2017, 08:00 AM
RE: WP 34S and 31S bugs and fixes - vido - 02-07-2017, 07:35 PM
RE: WP 34S and 31S bugs and fixes - Dieter - 05-23-2017, 12:19 PM
RE: WP 34S and 31S bugs and fixes - Dieter - 05-23-2017, 05:05 PM



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