Here is a short test program to reproduce the issue. Note that this issue occurs only on the DM42 (with both firmware 3.2 and 3.3 - I've not tested with the previous ones). I cannot reproduce the issue with the latest version of Free42 (2.0.14) nor with the HP-42S.
Code: Select all
00 { 47-Byte Prgm }
01▸LBL "TST"
02 CLST
03 XEQ "KG"
04 8
05 RTN
06▸LBL "KG"
07▸LBL A
08 "ADD"
09 KEY 1 GTO 01
10 KEY 9 GTO 99
11 MENU
12 PROMPT
13 GTO A
14▸LBL 01
15 GTO A
16▸LBL 99
17 END
Now: XEQ "TST" EXIT => you get on the stack 8 in X and 0 in the other registers as expected
But if you press the "ADD" softkey before pressing EXIT you have on the stack 8 in X and Y and 0 in Z and T
and if you press "ADD" twice before pressing EXIT you get on the stack 8 in X, Y and Z and 0 in T
I don't understand why there is one more 8 on the stack for each press of the "ADD" soft key ????
It seems that there is a bug in the return address stack handling.
If I put a STOP just after the 8 at step 4 and do XEQ "TST" ADD EXIT the program stops on the STOP instruction with 8 in X, then if I do SST twice, upon the RTN it goes back to step 4 and put again 8 on the stack as if the return address from the XEQ "KG" was not consumed by the step 17, or was duplicated by pressing ADD.