Translation table HP42s(ascii) <=> HP42s(raw)

Post here to share useful tips and tricks, to ask questions about using your DM42 or to report software-related problems
mcc
Posts: 277
Joined: Fri Jun 23, 2017 5:10 am

Translation table HP42s(ascii) <=> HP42s(raw)

Post by mcc »

Hi,

what is the best place to look for a recent (that is: 3.02/3.18) translation
table for the conversion between HP42s programs in text form and in raw form?

I have no problems reading source codes...but I don't know the inner circle
of Free42 (yet) and would be thankful for a pointer.

I am playing (PLAYING!) with the idea, whether it would be possible to (may be)
implement a "HP42s" plugin for Neovim (which uses Lua for its scripting language).
This could read programs in ASCII and save it in raw format and - since Neovim is
able to read binaries without destroying the contents - read raw format and display
ASCII.

As said...this is just an IDEA...neither any design has been made nor do I have any
clue how complex this would be.

Where do I need to dig into?

Cheers!
mcc
DM 42 - SN: 00373, Firmware release v.:3.22. / DMCP 3.24. as compiled by SwissMicros
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: Translation table HP42s(ascii) <=> HP42s(raw)

Post by Thomas Okken »

There is a lot more involved than just table lookups, unfortunately! You could take a look at core_copy() and core_paste() in core_main.cc, following the prgm_mode cases, but those are only half the story, since they convert between text and the internal format used by Free42. The other half would be core_export_programs() and core_import_programs(), which convert between the internal format and raw format.

A better starting point would probably be the DM42 Programming Tool, although I don't know if the source code for that is available.
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: Translation table HP42s(ascii) <=> HP42s(raw)

Post by Thomas Okken »

Or maybe this plugin for Visual Studio Code would be a good starting point: https://marketplace.visualstudio.com/it ... 42s-free42

It looks like the source code for that is available.
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: Translation table HP42s(ascii) <=> HP42s(raw)

Post by Thomas Okken »

The VSC plugin hasn't been updated recently so it won't support the new functions added in the last few months. The DM42 Programming Tool is more up-to-date, although even it probably doesn't support XSTR, since that isn't even in any released version of Free42 yet. It will be in 3.0.3.
(XSTR is for embedding long strings in programs, and it adds a new twist to the format conversion because one XSTR instruction can be translated to several raw instructions.)
grsbanks
Posts: 1122
Joined: Tue Apr 25, 2017 11:23 am
Location: Preston, Lancs, UK
Contact:

Re: Translation table HP42s(ascii) <=> HP42s(raw)

Post by grsbanks »

I'm working on updating the online decoder/encoder with the latest additions to Free42. Trying to strike a balance between this, having just started a new job and having a partner back in hospital at the moment so please bear with me.
There are only 10 kinds of people in the world: those who understand binary and those who do not.
mcc
Posts: 277
Joined: Fri Jun 23, 2017 5:10 am

Re: Translation table HP42s(ascii) <=> HP42s(raw)

Post by mcc »

Hi,

just in case:
It was not my intention explicitely or implicitely to imply that it is time to update the online translator!
Sorry if it had sound like that -- it was by far not my intention...

Thanks a lot for all the replies! I am just looking and gathering informations, what an effort it would be
to imnplement something like that...

@Thomas:
Where did you find the source code for the VSC plugin?
As I visited the page I did neither find a "download" nor
a "github" nor similiar common suspicouds things - on the
other hand I know that my browse plays a bad game with me...

Cheers!
mcc
DM 42 - SN: 00373, Firmware release v.:3.22. / DMCP 3.24. as compiled by SwissMicros
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: Translation table HP42s(ascii) <=> HP42s(raw)

Post by Thomas Okken »

mcc wrote:
Sat Apr 17, 2021 5:22 pm
Where did you find the source code for the VSC plugin?
On the page I linked to, there is a "repository" link that takes you to GitHub. I didn't look at the actual code, but from a quick glance, it looks like everything is there.
mcc
Posts: 277
Joined: Fri Jun 23, 2017 5:10 am

Re: Translation table HP42s(ascii) <=> HP42s(raw)

Post by mcc »

Hi Thomas,

thanks a lot! I have found it...

This link is only visible, if I switch off the addons
"uBlock" und "uMatrix" which I normally use to not to spray too much
of my data onto the internet...

Cheers!
mcc
DM 42 - SN: 00373, Firmware release v.:3.22. / DMCP 3.24. as compiled by SwissMicros
User avatar
akaTB
Posts: 794
Joined: Tue May 02, 2017 1:56 pm
Location: Milan, Italy

Re: Translation table HP42s(ascii) <=> HP42s(raw)

Post by akaTB »

mcc wrote:
Sat Apr 17, 2021 5:38 pm
This link is only visible, if I switch off the addons
"uBlock" und "uMatrix" which I normally use to not to spray too much
of my data onto the internet...
uBlock is not the culprit here, since I use it too and can see the Repository link.
Greetings,
    Massimo
ajcaton
-+×÷ left is right and right is wrong :twisted: Casted in gold
Thomas Okken
Posts: 1100
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: Translation table HP42s(ascii) <=> HP42s(raw)

Post by Thomas Okken »

grsbanks wrote:
Sat Apr 17, 2021 4:52 pm
I'm working on updating the online decoder/encoder with the latest additions to Free42. Trying to strike a balance between this, having just started a new job and having a partner back in hospital at the moment so please bear with me.
Of course, look after yourself and those close to you first! But if the DM42 Programming Tool is straight PHP, maybe I could help as well. I would also be interested in hosting an instance on my own web site.
Post Reply