During my testing I suddenly ran into an "Insufficient memory" message which puzzled me quite a bit. After some poking around I saw that with every run of the program I loose exactly 1600 bytes of free memory until at some point I am left with nothing. To recover the lost memory it is sufficient to save the calculator state. Running the program again leads to the same sequential memory loss.
To me the program seems nothing special, using only a bunch of loops and local variables. I tried to isolate different parts of the code into a separate program but was not successful in reproducing the memory leak. Therefore I will have to post the full code here...
My first try was to run the RAW file through the DM42 programming tool. This tool, however, fails with "Invalid TEXT subcommand at PC:00BE". The command at 00BE seems to be the newly introduced "X≥?" (line 40), so this is probably not yet supported by the programming tool. Instead, I printed the program to a txt file then. The original RAW file is, just in case, also attached.
Code: Select all
00 { 342-Byte Prgm }
01▶LBL "FPLOT"
02 RCL "GrMod" @@@ save original graphics mode
03 LSTO "_GrMod"
04 0
05 STO "GrMod"
06 0 @@@ set up plotting range and steps
07 LSTO "_XMIN"
08 5
09 LSTO "_XMAX"
10 2
11 LSTO "_XSTEP"
12 0
13 LSTO "_YMIN"
14 1
15 LSTO "_YMAX"
16 RCL "_XSTEP"
17 RCL÷ "ResY"
18 LSTO "_DX"
19 RCL "_YMAX"
20 RCL- "_YMIN"
21 RCL÷ "ResX"
22 LSTO "_DY"
23▶LBL F @@@ main printing function
24 RCL "_XMIN"
25 LSTO "_XPOS"
26 CLLCD
27 1
28 XEQ 51 @@ initial horizontal line
29▶LBL 11 @@@ outer loop: divide plot range into single screens
30 RCL "ResY"
31 1000
32 ÷
33 1
34 +
35 LSTO "_YSCR"
36▶LBL 12 @@@ inner loop: single screen contents
37 RCL "_DX"
38 STO+ "_XPOS"
39 RCL "_XPOS"
40 X≥? "_XMAX"
41 GTO 19 @@ at end of plotting range
42 RCL "_YSCR"
43 XEQ 52 @@ left and right border
44 ISG "_YSCR"
45 GTO 12 @@ next pixel line of current screen
46 PRLCD
47 CLLCD @@ clear screen in preparation of next segment
48 XEQ 53 @@ tic marks of new screen segment
49 GTO 11 @@ go to next screen segment
50 GTO 99 @@ (my mistake: this line is not needed anymore)
51▶LBL 19 @@@ print final horizontal line
52 RCL "_YSCR"
53 XEQ 51
54 PRLCD @@ print this remaining part
55 ADV
56 GTO 99 @@ finished
57▶LBL 51 @@@ print horizontal line at ST X
58 +/-
59 0
60 PIXEL
61 R↓
62 +/-
63 RTN
64▶LBL 52 @@@ print left and right border
65 1
66 PIXEL
67 R↓
68 RCL "ResX"
69 PIXEL
70 R↓
71 RTN
72▶LBL 53 @@@ print left and right tic marks in row 1
73 "××××"
74 1
75 2
76 AGRAPH
77 1
78 RCL "ResX"
79 4
80 -
81 AGRAPH
82 "←" @@ start to prepare tic label
83 ARCL "_XPOS"
84 3
85 1
86 XEQ "DISPLAY" @@ Bill's DISPLAY function for in-graphics text
87 RTN
88▶LBL 99 @@@ restore original graphics mode and exit
89 RCL "_GrMod"
90 STO "GrMod"
91 END
My DM42 info: DMCP v3.21, DM42 v3.18
Any ideas? Any additional information I can provide?
Cheers
Florian