Encoder/Decoder
DM42 Listing: (copy to clipboard) | PC: | Hex Code: |
---|---|---|
|
||
Status: |
Upload and decode .raw file:
Select a .raw file to upload from your computer. It will be decoded and the corresponding listing displayed above. |
Encode and download .raw file:
Click on the Encode button to encode your program and then download it as a .raw file by clicking on the Download button. |
Please note that you do not have to prefix a program that you enter with a line such as:
00 { nn-Byte Prgm }
Nor do you have to enter line numbers. Both of these will be added automatically when you
click on the "Encode »" or "« Decode" button provided
there are no errors in your program or hex data.
Comments can be entered either on their own on lines or after DM42 instructions. An '@' sign and
anything following it will be considered as a comment and not contribute to the encoded raw data.
There is, however, some scope for ambiguity when an '@' sign appears inside a string, program
name or variable name. Take the following example:
01 "1" @ "1" or "2"
Does this represent the string 1" @ "1" or "2 or does
it represent the string 1 followed by the comment @ "1" or
"2"?
This is where the "Greedy comments" checkbox comes in. If it is checked, then the parser will attempt to match as much of the program line as possible to a comment and the above line will be interpreted as the string 1 followed by the comment @ "1" or "2". If, on the other hand, the checkbox is unchecked then the parser will try and match as much of the line as possible to actual program instructions, meaning that the above example will be interpreted as the string 1" @ "1" or "2.
Special sequences such as \GS (see below) in comments can be translated to their Unicode
equivalents if the "Translate comments" checkbox is checked. Eg. if this is the case then
the line:
01 SQRT @ calculate \v/X
...will be translated to:
01 SQRT @ calculate √X
Many of the characters used in HP-42S/DM42 programs cannot be entered directly with a keyboard. In order to help with this, we provide several special "codes" that you can use and there are also easy-to-type mnemonics for instructions that use them. This encoder also accepts HP-41 style instructions, eg. you can type ST/ 10 instead of STO÷ 10 or RCL T instead of RCL ST T.
The table below shows what equivalent instructions you can use and also gives the HP-41 equivalent that you can use if there is one. If you do use an HP-41 equivalent, it will subsequently be "translated" back to the HP-42S version in the final listing.
In order to get: | You can type: | |
---|---|---|
HP-42S/DM42 style | HP-41 style | |
R↑ | R^ | |
R↓ | R\v or Rv | RDN |
ENTER | ENTER^ | |
Σ+, Σ-, CLΣ, PRΣ, ΣREG, ΣREG? | \GS+, \GS-, CL\GS, \GSREG, \GSREG? SUM+, SUM-, CLSUM, PRSUM, SUMREG, SUMREG? |
|
X≠0?, X≤0?, X≥0? | X#0?, X<=0?, X>=0? | |
├"string" (append to alpha) | |-"string" | |
→POL, →REC | \->POL, \->REC | R-P, P-R |
→DEG, →RAD | \->DEG, \->RAD | R-D, D-R |
→OCT, →DEC | \->OCT, \->DEC | |
+/- | CHS | |
N! | FACT | |
IP, FP | INT, FRC | |
→HMS, →HR | \->HMS, \->HR | HMS, HR |
×, ÷ | x, / | *, / |
STO+, STO- | ST+, ST- | |
STO×, STO÷ | STO*, STO/ | ST*, ST/ |
STO ST Y, STO IND ST Y | STO Y, STO IND Y |
You will also need similar codes to type the special characters in strings, labels and variable names:
In order to get: | You type (case-sensitive!): |
---|---|
÷ | \:- |
× | \x |
√ | \v/ |
∫ | \S |
▒ | \FUZ |
Σ | \GS |
▸ | \|> |
π | \PI |
¿ | \? |
≤ | \<= |
line feed | [LF] |
≥ | \>= |
≠ | \# |
↵ | \</ |
↓ | \v |
→ | \-> |
← | \<- |
£ | \PND |
μ | \m |
° | \o |
Å | \Ao |
Ñ | \N~ |
Ä | \A" |
∡ | \<\ |
ᴇ | \E |
Æ | \AE |
… | \... |
Escape character | [ESC] |
Ö | \O" |
Ü | \U" |
• | \. |
Version History
- 20230920 − Converted to JavaScript only.
- 20201001 − Moved to a server hosting all the decoder/encoders
- 20190828 − Added support for decoding of synthetics in .raw data
- 20190827 − Fixed separation and listing of multiple prgms in a RAW file and added XROM a,b support
- 20190629 − Added support for LSTO local variables and for YMD date mode
- 20180218 − Bugfix: Allow numbers not to be null-terminated in .raw files and allow leading zero to be omitted
- 20180112 − Bugfix: jQuery-UI altered the font in the listing textareas. Fixed
- 20180106 − Bugfix: encoder automatically translates typographical quotes, added tabs on decoder page
- 20170709 − Added ability to comment code and program counter column, improved scrolling synchronisation
- 20170707 − Bugfix: final END no longer contributes to code length
- 20170705 − Initial release