View on GitHub

vscode-hp42s-free42

Language support for HP42S/free42 programming language.

HP42S-free42

hp42s-free42-extension-logo

GitHub license Installs Downloads

Language support for HP42S/free42 programming language.

What’s new in HP42S-free42:

Features

Supported filetypes

The endless chain of encoding and decoding:

*.hp42s -> *.hp42s.hex42 -> *.hp42s.raw -> *.hp42s.raw.hex42 -> *.hp42s.raw.hp42s -> …

Depending on the file type, snippets, syntax highlighting with the additional commands of free42 are supported or not.

Useful for Hewlett Packard HP-42S calculators, SwissMicros-DM42 calculators and FREE42 applications.

Demo

Features

Instruction sets

Syntax Highligthing

Syntax Highligthing

Snippets with description

Every keystroke command and its variations with a description.

Snippets with description

Comments

Comments are possible in several variants.

Comments

Document Formatter

The formatter prepares the code for encoding. It will replace all abbreviations, which are used for ascii text editing. When using Visual Studio Code, the code is displayed in UTF8, though all original characters of the HP42S/free42 can be displayed correct.

However when I enter a program manually into a real calculator it helps to have line numbers. If I miss a command it helps to find the error.

Right-click in the editor to get the context menu, then select menu Format Document or press keyboard-shortcut Win: SHIFT+ALT+F/ Linux: SHIFT+ALT+F/ Mac-OSX: ⇧⌥F.

Document Formatter

The formatter has several settings:

Encode Code - Comand

Before encoding, please format the code. This avoids further special cases that would otherwise have to be taken into account.

Press Win/Linux: Ctrl+Shift+P, Mac-OSX: ⇧⌘P, then write HP42S to get the command hp42s/free42: Encode Code in the drop down list.

The hp42s/free42: Encode Code command generates a *.hp42s.raw or *.free42.raw file. These files can be loaded by free42 or DM42.

Depending on the setting HP42S/free42.encoderGenerateHexFile setting, the command will generate a readable hex42 file.

Although the program size will be calculated and shown in the first line ({ n-Byte Prgm }). For some reason, the last ending END command is ignored. Real program size will be 3 bytes more.

That’s what the real HP-42S does. It is strange, since the END is, in fact, a part of the program… but that’s the way it is.

Encode Code

Encoding Success

Encoding with no errors: The raw program size is reported in the first line.

Encode Success

The command generates two output files:

Encoding Errors

Encoding with errors: The first line line contains the first error.

Encode Error

Encoding with errors: All errors are logged to the *.log file.

Encode Log

Decode Code - Comand

From a *.raw file the decoder generates the following files

To decode a raw file, please select hp42s/free42: Show Raw in the context menu of the file listed in the right explorer pane.

Explorer context menu

This will show the formatted bytes of the file.

Raw view

In the editor open the context menu again an select hp42s/free42: Decode Raw.

Raw view context menu

The decoder will generate the output files.

Decoded files

Used References

Documents

Requirements

None.

Extension Settings

Encoding Settings:

Decoding Settings:

Document Formatter Settings:

Recommendations

Visual Studio Extensions: