Language support for HP42S/free42 programming language.
- more new commands for free42
- package updates
- bug fix
- syntax highlighting
- snipptes with description
- comments
- document formatter
- encoding code to raw
- decoding raw to code
Supported filetypes
*.hp42s
for the original operation set of the HP-42S*.free42
for the extended operation set of the free42
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.
- HP42S instruction set
- Support Free42 Extensions to the HP-42S Instruction Set (v2.4)
Every keystroke command and its variations with a description.
- Normal snippets appear when writing the command
- Snippets for commands with leading special character appear when writing the command name (eg: use
DEC
for→DEC
, useREG
forΣREG
) - Use
e
,ᴇ
orE
forᴇ
in1.2ᴇ-23
- Use
OP
for×,÷,+/-,Σ+,Σ-,←,↑,↓,→,%,⊢,%CH
- Use
FLAG
for all flags01
to99
- Use
FOC
for√,∫,░,Σ,▶,π,¿,␊,≤,≥,≠,↵,↓,→,←,µ,£,°,Å,Ñ,Ä,∡,ᴇ,Æ,…,␛,Ö,Ü,▒,■
- Use
[LF]
or␊
for a line feed in a string. Formatter will replace[LF]
to␊
.
Comments are possible in several variants.
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
.
The formatter has several settings:
Use Line Numbers
: This will insert/refresh the leading line numbers.Remove Too Long Spaces
: This will reduce whitespaces in the code.Replace Abbreviations
: Abbreviations for special characters will be replaced by the correct intended character.Trim Line
: This removes whitespaces at the beginnning and at the end of a code line.
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.
Encoding with no errors: The raw program size is reported in the first line.
The command generates two output files:
- a file in
raw42
format - a file in
hex42
format, when settingHP42S/free42.encoderGenerateHexFile
is checked
Encoding with errors: The first line line contains the first error.
Encoding with errors: All errors are logged to the *.log file.
From a *.raw
file the decoder generates the following files
*.hex42
: The sequence of the command bytes, when settingHP42S/free42.decoderGenerateHexFile
is checked.*.hp42s
: The code file with only pure HP42S commands.*.free42
: The decode has detected free42 commands. The code will only run on free42 applications.
To decode a raw file, please select hp42s/free42: Show Raw
in the context menu of the file listed in the right explorer pane.
This will show the formatted bytes of the file.
In the editor open the context menu again an select hp42s/free42: Decode Raw
.
The decoder will generate the output files.
- Thomas Okken - free42
- SwissMicros
- SwissMicros - Forum
- MoHPC, The Museum of HP Calculators
- MoHPC - Forum
- FOCAL character set
- perl script txt2raw.pl V1.0 by Vini Matangrano
- Hewlett-Packard HP-42S RPN Scientific Calculator Owner´s Manual
- Hewlett-Packard HP-42S RPN Scientific Programming Examples and Techniques
None.
Encoding Settings:
HP42S/free42.encodergenerateHexFile
: This will although generate a*.hex42
file, to see the correct hex encoding.
Decoding Settings:
HP42S/free42.decodergenerateHexFile
: This will although generate a*.hex42
file, to see the correct hex encoding.
Document Formatter Settings:
HP42S/free42.formatterUseLineNumbers
: see above Document FormatterHP42S/free42.formatterReplaceAbreviations
: see above Document FormatterHP42S/free42.formatterRemoveTooLongSpaces
: see above Document FormatterHP42S/free42.formatterTrimLines
: see above Document FormatterHP42S/free42.formatterUseWhitespaceBetweenHex
: see generated hex files
Visual Studio Extensions:
- hexdump for VSCode for raw file inspections
- gitLens for better integration of the source code management