## Getting the L/F-symbol into a string ?

Discussion around the Swiss Micros DM42 calculator.
Thomas Okken
Posts: 781
Joined: Tue May 02, 2017 5:48 pm
Location: United States
Contact:

### Re: Getting the L/F-symbol into a string ?

Thanks Bob!

That is interesting. The HP-42S result matches what I saw with the emulator, but the DM42 appears to perform some kind of translation. The ≥ sign is code 138 in the 82240B character set, and it looks like it has the LF symbol as code 144.

Could you try this program as well? It prints all the codes except 27. It would be interesting to see what other remappings are being done...

Code: Select all

00 { 59-Byte Prgm }
01▸LBL "PTST2"
02 0.24016
03▸LBL 00
04 CLA
05 RCL ST X
06 IP
07 1.001
08 ×
09 0.015
10 +
11▸LBL 01
12 27
13 RCL ST Y
14 IP
15 X≠Y?
16 XTOA
17 R↓
18 R↓
19 ISG ST X
20 GTO 01
21 PRA
22 R↓
23 ISG ST X
24 GTO 00
25 END
rprosperi
Posts: 1027
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

### Re: Getting the L/F-symbol into a string ?

No problem.

Scanning both results I see only 1 difference, and interestingly it's not the one we're looking for.

The double dots character(colon?) directly under the 'p' on the 42S seems to be a blank on the DM42, while the "LF" chars seem to be the same.

Maybe I'm not looking close enough, but have another deadline I have to go meet.

Here are results from both machines.
PTST2 Results sm.jpg (205.99 KiB) Viewed 259 times
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
Thomas Okken
Posts: 781
Joined: Tue May 02, 2017 5:48 pm
Location: United States
Contact:

### Re: Getting the L/F-symbol into a string ?

I see three differences. Comparing the codes for the calculator's display (which also includes what's output by the Free42 virtual printer), the HP-42S driving the 82240B, and the DM42 driving the 82240B:

13:
Calc: ↵
Print from 42S: nothing
Print from DM42: ¶

128:
Calc: thin colon
Print from 42S: regular colon
Print from DM42: space

138:
Calc: LF symbol
Print from 42S: ≥
Print from DM42: LF symbol

Note that the LF symbol also appears at code 144 on the printer.

Also note that all the characters with codes >= 128, with the exception of code 138, are completely different on the printer than in the display. Even codes 128-143, which look the same or at least very similar at first glance, are all different.

I assume the differences aren't relevant in practice. Since on the display, codes 130-137 and 139-255 just replicate the corresponding codes from the bottom half, there's little reason for 42S programs to use them.
rprosperi
Posts: 1027
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

### Re: Getting the L/F-symbol into a string ?

Good eyes!!

I totally missed the 1st and 3rd ones, only saw the 2nd one when printing.

The manual says (p.105):

"Some characters are not printed as you see them in the display. This
is because the character set used in the HP-42S does not directly
match the character set used in the HP 82240A Infrared Printer. Compare
the character table in appendix E of this manual with the
character set listed in the HP 82240A owner's manual"

Appendix E in the manual covers displayed characters but basically doesn't help much by simply saying 130-255 are 'identical' to 2-127.

The symbol "¶" the DM42 program prints for char(13) seems to be the same as char(245) - I've no idea why that would happen, though this is obviously the Carriage Return, so odd behavior is not uncommon.

In Free42, do you substitute the special char "↵" for the normal char(13)? If so, is "↵" char(245) on the virtual printer?
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
Thomas Okken
Posts: 781
Joined: Tue May 02, 2017 5:48 pm
Location: United States
Contact:

### Re: Getting the L/F-symbol into a string ?

rprosperi wrote:
Wed Oct 21, 2020 3:55 am
Appendix E in the manual covers displayed characters but basically doesn't help much by simply saying 130-255 are 'identical' to 2-127.
I guess that's just an indirect way of saying "we didn't care about those character codes when we designed this calculator... and neither should you."
rprosperi wrote:
Wed Oct 21, 2020 3:55 am
The symbol "¶" the DM42 program prints for char(13) seems to be the same as char(245) - I've no idea why that would happen, though this is obviously the Carriage Return, so odd behavior is not uncommon.
The ↵ doesn't exist in the 82240 character set. I think mapping it to ¶ is clever because they both represent a hard line break. Sort of.
Like mapping the calculator code to 138 to printer code 144, it's a nice touch by SM. Their choice for code 128 seems like a mistake, though. But, as indicated by the 82240 manual, since the upper half of the calculator and the upper half of the printer character sets are totally different and the original calculator doesn't bother to perform any kind of mapping between the two, it doesn't really matter much what Free42 or the DM42 do with them, either. My choice to make the virtual printer and Copy match the display characters was motivated mainly by the desire to keep things simple.
rprosperi wrote:
Wed Oct 21, 2020 3:55 am
In Free42, do you substitute the special char "↵" for the normal char(13)? If so, is "↵" char(245) on the virtual printer?
In the Free42 print-out code, and also for Copy, for all characters, I picked Unicode characters that resembled the ones used by the HP-42S as closely as possible. Hence ↵ for 13, and also ↑ instead of ^ for 94. The only exceptions are 10 and 27, where I used the strings [LF] and [ESC] instead of the obvious Unicode characters U+240A and U+241B, because to me those are just too hard to read -- ␊ and ␛, nope. Too small.
rprosperi
Posts: 1027
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

### Re: Getting the L/F-symbol into a string ?

Thanks for explaining.

These odd little discrepancies can indeed be ignored, though it's better now knowing why they occur.
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
Thomas Okken
Posts: 781
Joined: Tue May 02, 2017 5:48 pm
Location: United States
Contact:

### Re: Getting the L/F-symbol into a string ?

A couple of details I missed, and noticed by comparing the print-outs with the Roman-8 character set listing from the 82240B manual:

The HP-42S does perform character code remapping. It remaps most of the codes 0-31, and 127 (append sign) and 128. The DM42 also performs these remappings, except for the noted discrepancies with code 13, which the 42S does not remap but the DM42 does, and 128, which the 42S does remap but the DM42 does not.