## Constant encoding bug in dm41.swissmicros.com.

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
Kf6gpe
Posts: 26
Joined: Thu Jun 15, 2017 8:01 am
Location: Boulder Creek, CA, USA
Contact:

### Constant encoding bug in dm41.swissmicros.com.

Today I transcribed the Sunrise/Sunset program in the HP user library by David Westcott (#000508C, available from the hpmuseum archive memory stick and CDs) into my DM42, and it works great!

I decided to test it on the DM41 series before putting the raw files where people could download it, and made an interesting discovery --- dm41.swissmicros.com is failing to convert the raw files to the register format for the DM41.

The listing of the code as generated by the LIFUTILS decomp41 is

Code: Select all

LBL "INITSUN"
9.936741207E-5
STO 26
4.908229466
STO 27
0.03000526417
STO 28
7.902463002E-6
STO 29
5.817764173E-8
STO 30
4.881627934
STO 31
628.331951
STO 32
5.279620987E-6
STO 33
0.4093197551
STO 34
-2.271109689E-4
STO 35
-2.860400719E-8
STO 36
8.775127628E-9
STO 37
0.01675104
STO 38
-418E-7
STO 39
-126E-9
STO 40
694023
STO 41
365.25
STO 42
37.106
STO 43
122.0879
STO 44
RTN
END

Here's the raw files for both the register loader and the actual program, which seem to work as intended on the DM42.
• sun.zip
• sun.tar
I've tried it two ways from the web site. First I tried uploading the raw file and choosing "decode raw"; I then tried pasting in the decomp41 output in the listing and encoding it that way. Both methods gave me the error

Code: Select all

Error: unrecognized or incomplete function[ 0.03000526417 ]
If [ 0.03000526417 ] is an external module function, try: [ XROM mm,ff ]
Error is at line 6.

When I keyed that value into my program, I keyed it as an exponential (3.000526417 E-2; it looks in the application like it's stored as the float. I'd expect both representations to be the same, but I'm wondering if it's a significant digits problem with the encoder. Truncating the value to 3.0005264 and attempting to encode does in fact get me past this; the web site encoder then fails at line 18, which is the constant 0.4093197551, another ten-digit constant.

I think the problem is actually in LIFUTILs, though, because if I try to decompile and then recompile the raw file using just decomp41 and comp41, I get the same error! So I'm guessing that there's something just a little goofy about the raw file from Free42 and the number encoding or representation that's creating a bad representation of long constants in raw files.

As always, not the end of the world. But an interesting artifact, and the artifact points a little bit about how dm41.swissmicros.com is built!

Cheers,
R.

Kf6gpe
Posts: 26
Joined: Thu Jun 15, 2017 8:01 am
Location: Boulder Creek, CA, USA
Contact: