Page 2 of 3

Re: Stand alone Encoder/Decoder

Posted: Mon Mar 19, 2018 10:07 pm
by Bernd
You can use the Free42 to convert code from txt to raw and vice versa. Copy the code from the editor to the clipboard, switch to program mode in Free42 and paste the code. After this you can export the code to a Raw file. This works also the other way round from raw to txt.

Regards
Bernd

Re: Stand alone Encoder/Decoder

Posted: Mon Mar 19, 2018 10:49 pm
by Guenter
toml_12953 wrote:
Sun Mar 18, 2018 3:53 am
Guenter wrote:
Sun Mar 18, 2018 12:04 am
Question: When the captain dates a flight attendant for [censored], Is that work or fun, suggestions?
Is he paid for this fun? If so, it's more like work (the kind of work I'd come out of retirement for!)
No work, it's really fun. If it was work, then tho co pilot (or first officer) had to do it.
Günter

Re: Stand alone Encoder/Decoder

Posted: Tue Mar 20, 2018 3:53 pm
by jayhawk
Mcastil7 wrote:
Fri Mar 16, 2018 5:57 pm
I would like to be able to encode/decode programs even when I'm not connected to the internet. Where can I get the program that I can run on my machine (Linux/Mac)—preferably, the source code?

Thanks,

Mauricio
I use Free42 v2.0.16 on Ubuntu Mate for this purpose.

In this version of Free42 You can copy/paste plain text in PRGM mode.

Note that the latest version in Ubuntu's repository is version 1.4.77-1.1, that does not implement this copy/paste feature. So get the latest version from Thomas' site.

Re: Stand alone Encoder/Decoder

Posted: Tue Mar 20, 2018 8:42 pm
by ijabbott
jayhawk wrote:
Tue Mar 20, 2018 3:53 pm
I use Free42 v2.0.16 on Ubuntu Mate for this purpose.

In this version of Free42 You can copy/paste plain text in PRGM mode.

Note that the latest version in Ubuntu's repository is version 1.4.77-1.1, that does not implement this copy/paste feature. So get the latest version from Thomas' site.
Indeed, that works in all versions of Free42 2.0.x on all platforms except DM42.

Re: Stand alone Encoder/Decoder

Posted: Wed Mar 21, 2018 7:47 am
by jayhawk
ijabbott wrote:
Tue Mar 20, 2018 8:42 pm
jayhawk wrote:
Tue Mar 20, 2018 3:53 pm
I use Free42 v2.0.16 on Ubuntu Mate for this purpose.

In this version of Free42 You can copy/paste plain text in PRGM mode.

Note that the latest version in Ubuntu's repository is version 1.4.77-1.1, that does not implement this copy/paste feature. So get the latest version from Thomas' site.
Indeed, that works in all versions of Free42 2.0.x on all platforms except DM42.
Exactly.
From the version history for Free42:
2017-04-22: release 2.0 (beta)

* Copy & Paste now handle matrices, ALPHA mode, and PRGM mode.
Versions prior to 2.0 only copy/paste from the X register.

And this:
2018-01-07: release 2.0.9

* Program Paste no longer requires line numbers.
is really cool. Makes You able to write complex programs in a txt editor.

As text editor I recommend Geany, an ultra lightweight all-purpose IDE. It has the cool feature of column-select (ALT+SHFT+cursor arrows) so You can quickly remove line numbers of programs pasted from Free42. Also don't forget to remove the first line: '00 { xxx-Byte Prgm }'

Re: Stand alone Encoder/Decoder

Posted: Tue Mar 27, 2018 12:26 pm
by RobFisher
I threw together a quick hack to be able to get Free42 to convert a program from text to binary on the command line: https://github.com/RobFisher/free42-lin ... 0def4fb07f

Probably this could be developed further, such as removing the dependency on GTK and adding the option to convert raw back to text.

In fact a completely command-line Free42 would be nice. You could have it act like a filter (pipe in the program and arguments and it prints out X); and have an interactive mode for debugging. A fun project for anyone with spare time (I rarely do, these days). Oh, and an Emacs mode for editing, and have Free42 validate the code for flymake-mode to work... :D

Re: Stand alone Encoder/Decoder

Posted: Fri Apr 13, 2018 12:39 am
by pica
Is there any reason why DM42 can't be persuaded to load programs in either .raw or .txt format?
Surely there there is already an interpreter which converts the programs we type in on the keyboard to machine language?

Re: Stand alone Encoder/Decoder

Posted: Fri Apr 13, 2018 12:51 am
by rprosperi
pica wrote:
Fri Apr 13, 2018 12:39 am
Is there any reason why DM42 can't be persuaded to load programs in either .raw or .txt format?
Surely there there is already an interpreter which converts the programs we type in on the keyboard to machine language?
The programs are not converted to machine language, they are stored in an internal format, (likely very) close to .raw format, at least in the case of the 42S -Thomas is this the same for Free42?

The 42s ROM and Free42 program "interpret" the FOCAL code on-the-fly (though some things like jump addresses are stored to make program execution faster).

Re: Stand alone Encoder/Decoder

Posted: Fri Apr 13, 2018 3:17 am
by Thomas Okken
The format used internally by Free42 is completely different from that used inside the HP-42S. Without going into details, the Free42 format uses roughly twice as much memory, but is much easier to decode for program execution.

Free42 converts from the HP-42S format to its own format while importing raw files, and does the reverse when exporting raw files. The internal format is only used in memory and in the state files.

Could the DM42 be modified so that it could load and save programs in text format? Absolutely. In Free42 2.0, I added code that performs those conversions, for copying and pasting programs using the clipboard. That code, currently unused in the DM42 because it has no clipboard, could be used for loading and saving programs from and to text files as well.

Re: Stand alone Encoder/Decoder

Posted: Sat May 12, 2018 4:16 pm
by axd
You are right to point this out. I drew Michael's attention to this issue a long time ago.

It used to be possible to download the web page as HTML (complete), but now there seems to be an explicit dependency on a web site.

The dependency on a central server is crippling, IMHO there should be no reason to make users dependent on a web site to provide such services. Making users dependent is the pathway to programmed obsolescence.

The solution is to publish this kind of tools via eg Git or similar versioning, so that anyone can clone and/or download them, stay up-to-date, be able to archive such tools for future, post-apocalypse use (I'm kidding, but I deeply believe in the idea of archival and am convinced such hardware will outlive the makers, and therefore also the websites), and even contribute to ameliorate the tools.