[DM41L] memory/register usage does not match HP41C (SOLVED)

If you think you've found a bug in one of these machines, post about it here indicating the steps you perform in order to reproduce it.

Please prefix your topic with the model number in question and firmware version this way:

[DM16 V22] CHS gives unexpected results
Boub65
Posts: 89
Joined: Tue Sep 12, 2017 2:34 pm
Location: Rabat, Morocco

[DM41L] memory/register usage does not match HP41C (SOLVED)

Post by Boub65 » Thu Mar 15, 2018 6:29 pm

Hi all,
still trying to calculate as many digits of PI as I can on my DMxxL calculators (especially that yesterday was PI day :lol: ).

On the DM15L, I was stopped by what could be a bug (or an undocumented limitation) on indirect adressing limited to 99 registers : see post viewtopic.php?f=11&t=1801 :(

Now, on the DM41L, I was trying to compute 1160 digits of PI as documented in the famous HP41C article by Ron Knapp.
The famous article provides a 396 steps program (397 if you count the END instruction).
You need to do a "SIZE 238" on your DM41L to be able to compute the 1160 digits (you need in fact to access to 237th register on line .014).

But, impossible to do a "SIZE 238" (you get the "PACKING/TRY AGAIN" message)! the maximum that can be performed is "SIZE 237" which allows calculation of ONLY 1150 digits. :(

So I think, that there might be a problem in memory allocation on the DM41L that uses ONE (1) extra register VS HP41C.
Article and program can be found on Thomas Okken Free42 libraries (http://thomasokken.com/free42/42progs/index.html) under "pi_dec"

I don't have a HP41C to check it's behavior relative to the article.

PS: for those ( :?: ) who will only read the title of the article that specify 1110 digits, the author says on top of the HP41C Code Listing "EXTENDED PRECISION - pi to 1160 places" and he gives later in the article the time to compute "1160 places in 15 1/2 hours".

Sincerely,
Boubker.
Last edited by Boub65 on Sat Mar 17, 2018 2:26 pm, edited 1 time in total.
2xDM15L, DM41L, DM42 SN#00855
TI-89 titanium, CASIO fx-cg50 (to play with micropython)

rprosperi
Posts: 501
Joined: Mon Apr 24, 2017 5:48 pm
Location: New York

Re: [DM41L] memory/register usage does not match HP41C (?)

Post by rprosperi » Thu Mar 15, 2018 10:55 pm

Boub65 wrote:
Thu Mar 15, 2018 6:29 pm
But, impossible to do a "SIZE 238" (you get the "PACKING/TRY AGAIN" message)! the maximum that can be performed is "SIZE 237" which allows calculation of ONLY 1150 digits. :(
Key Assignments and Alarms also can take up RAM, so make sure there are none of those when you set SIZE.

Also, PACK (or GTO..) to be sure all slack space in the code is removed.

Worst case, set SIZE first, then enter the program. It's (generally speaking) far more likely the issue is one of these things than if the f/w is providing different RAM sizes than the real machine. But please note my use of the word likely...
--bob p

DM42: β00071 & 00282

grsbanks
Posts: 857
Joined: Tue Apr 25, 2017 9:23 am
Location: Preston, Lancs, UK
Contact:

Re: [DM41L] memory/register usage does not match HP41C (?)

Post by grsbanks » Fri Mar 16, 2018 8:50 am

@rprosperi is probably right here.

The DM41L allocates memory within the emulated machine in exactly the same was as the HP-41CX does because it is using the ROM of that machine.

SIZE 238 should leave you with 81 registers of program space if there are no global key assignments and no alarms in place. CLKEYS and CLRALMS will take care of that for you.
Not SwissMicros staff, just an enthusiast.

Boub65
Posts: 89
Joined: Tue Sep 12, 2017 2:34 pm
Location: Rabat, Morocco

Re: [DM41L] memory/register usage does not match HP41C (?)

Post by Boub65 » Fri Mar 16, 2018 11:39 am

@grsbanks and @rprosperi...
I did my tests after a Hard Reset.
Weird... will try again...
2xDM15L, DM41L, DM42 SN#00855
TI-89 titanium, CASIO fx-cg50 (to play with micropython)

grsbanks
Posts: 857
Joined: Tue Apr 25, 2017 9:23 am
Location: Preston, Lancs, UK
Contact:

Re: [DM41L] memory/register usage does not match HP41C (?)

Post by grsbanks » Fri Mar 16, 2018 2:57 pm

Not SwissMicros staff, just an enthusiast.

Boub65
Posts: 89
Joined: Tue Sep 12, 2017 2:34 pm
Location: Rabat, Morocco

Re: [DM41L] memory/register usage does not match HP41C (?)

Post by Boub65 » Fri Mar 16, 2018 4:38 pm

@grsbanks...
You should do a SIZE 238 after loading the PI program (397 steps)...
2xDM15L, DM41L, DM42 SN#00855
TI-89 titanium, CASIO fx-cg50 (to play with micropython)

grsbanks
Posts: 857
Joined: Tue Apr 25, 2017 9:23 am
Location: Preston, Lancs, UK
Contact:

Re: [DM41L] memory/register usage does not match HP41C (?)

Post by grsbanks » Fri Mar 16, 2018 8:28 pm

Don't type the final END. It's not needed if this is the only program in memory.

Here's a dump:

Code: Select all

DM41
08  4b000000000000  000000455a4953  0000000000c000  00000000000000
0c  00000000000112  11d001691120c0  0000002c048000  00000000005001
c0  b2000000c8512d  9600d0000f8685  80111b15439873  96009c05cf0f90
c4  21144030988089  9703bf00868502  71069180759700  00111b11104011
c8  804110716664b6  770f9083714190  13947143314033  7668114130111b
cc  00bc00850e2369  10400591807596  80920077111b11  64b50011930093
d0  15427190804166  6892717740111b  7495714b717675  1b159471420d83
d4  95714b71687111  0006ba000c8374  e00006be0008e0  00139471947075
d8  518383109701b8  00bb0011121551  71e0000c2330aa  10421606957177
dc  15b60005970114  00151b16421a17  51744040ac00b5  93727542749270
e0  12937477769470  71121594717142  68838383124194  403033a8000b21
e4  724071111b1343  75542240761295  1a134368114571  0a216898731114
e8  41161b1c154031  19416e11124211  9202111a12421a  09a81d22236841
ec  40409600b70085  76757168928077  7142837495714b  716971111b1594
f0  ce807643689272  111b1542760842  80759200777669  43681193007192
f4  68111b1545b800  42837495714b71  b3008507111b15  06918077409600
f8  0005111b111040  928092007740b6  4066b500119300  111b1110419080
fc  4b767174746840  42710483749571  7168111b159471  1542837495714b
100  0006b10003111b  e00006b90005e0  00711213194371  832330779701b5
104  03121319515183  4110711442e000  51427112419471  40303375121319
108  2240111b134314  43681145717554  83839873141a13  1c154031012168
10c  6e14421141141b  111a1017421541  9bf31540124332  10436812421540
110  a91d9c00194011  c000f30050498a  00000000000000  00000000000000
A: c000f30050498a  B: 0000002c0480fd  C: 0000002c0480fd
S: 00100100000000
M: 00011cd5ff73cb  N: 00000000000000  G: 00
Not SwissMicros staff, just an enthusiast.

rprosperi
Posts: 501
Joined: Mon Apr 24, 2017 5:48 pm
Location: New York

Re: [DM41L] memory/register usage does not match HP41C (?)

Post by rprosperi » Fri Mar 16, 2018 10:29 pm

grsbanks wrote:
Fri Mar 16, 2018 8:28 pm
Don't type the final END. It's not needed if this is the only program in memory.
Doh! Wish I had thought of suggesting that, and this is not even the first thread with a program so tight that it could not fit with the extra END. Thanks for entering it to find out the cause.
--bob p

DM42: β00071 & 00282

Boub65
Posts: 89
Joined: Tue Sep 12, 2017 2:34 pm
Location: Rabat, Morocco

Re: [DM41L] memory/register usage does not match HP41C (?)

Post by Boub65 » Sat Mar 17, 2018 10:09 am

rprosperi wrote:
Fri Mar 16, 2018 10:29 pm
grsbanks wrote:
Fri Mar 16, 2018 8:28 pm
Don't type the final END. It's not needed if this is the only program in memory.
Doh! Wish I had thought of suggesting that, and this is not even the first thread with a program so tight that it could not fit with the extra END. Thanks for entering it to find out the cause.
OMG!!!!! You nailed it!
Thanks for the info...
(I really thought that "Packing" the program would save space, instead it was adding the extra END and then using one more register)

@grsbanks, how did you enter the program? Is it using the raw file provided on Thomas Okken's website? The dump you provide couldn't be decoded on on DM41 decoder page?

@grsbanks, what is your thoughts on my DM15L M1B memory size finding viewtopic.php?f=11&t=1801 ?
2xDM15L, DM41L, DM42 SN#00855
TI-89 titanium, CASIO fx-cg50 (to play with micropython)

grsbanks
Posts: 857
Joined: Tue Apr 25, 2017 9:23 am
Location: Preston, Lancs, UK
Contact:

Re: [DM41L] memory/register usage does not match HP41C (?)

Post by grsbanks » Sat Mar 17, 2018 11:30 am

Boub65 wrote:
Sat Mar 17, 2018 10:09 am
@grsbanks, how did you enter the program? Is it using the raw file provided on Thomas Okken's website? The dump you provide couldn't be decoded on on DM41 decoder page?
There has been some work put into the DM41 encoder/decoder page and I used the pre-release version of that to generate the dump.
Boub65 wrote:
Sat Mar 17, 2018 10:09 am
@grsbanks, what is your thoughts on my DM15L M1B memory size finding viewtopic.php?f=11&t=1801 ?
I've confirmed it and put it on the developer's radar. Right now he's working on a different problem with the DM15_M80 but I'm confident this will be looked at soon.
Not SwissMicros staff, just an enthusiast.

Post Reply