decomp41

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
FILES
REFERENCES
EXAMPLES
BUGS
AUTHOR

NAME

decomp41 - a filter to decompile a HP-41 program raw file

SYNOPSIS

decomp41 [-h] [-l] [-x xrom_file ] [-x xrom_file ] ... < Input file > Output file

decomp41 -?

DESCRIPTION

decomp41 is a filter which produces a listing of an HP-41 user language program. It reads the program as a series of bytes from standard input and prints the listing to standard output (in a similar format to the standard HP-41 printer).

By default, functions contained in plug-in modules are displayed as XROM rr,nn where rr is the number of the plug-in ROM and nn is the number of the function within that ROM. This can be overridden by loading xrom_files, see the -x option below. An xrom_file consists of a number of lines, each consisting of 2 decimal numbers and a string (containing no whitespace), in that order, separated by whitespace. The string gives a name to the function specified by the first number as rr and the second number as nn.

The Linux command pr may be useful for formatting the output of decomp41 into multiple columns.

OPTIONS

-h

Display the bytes (in hexadecimal) that make up each program instruction immediately preceding the display of that instruction

-l

Enable line numbers

-x xrom_file

Use xrom_file to define names for functions in plug-in modules. This option may be repeated to load multiple xrom_files. The file name has to be specified either as a full pathname or as the filename without the extension .xrom in the default location that is specified with the environment variable LIFUTILSXROMDIR (see below).

-?

Print a message giving the program usage to standard error.

FILES

xroms/*

xrom function definition files. Use the environment variable LIFUTILSXROMDIR to point to the location of this directory. On Linux the default location is /usr/share/lifutils/xroms, if the variable is not specified.

REFERENCES

The format of an HP-41 program is documented in many books. Amongst the most useful references are Extend Your HP41 (W. A. C. Mier-Jedrzejowicz) and The HP41 Synthetic Programming Quick Reference Guide (Jeremy Smith)

EXAMPLES

If disk1.dat is a LIF disk image containing an HP41 program called PROG then

lifget -r disk1.dat PROG | decomp41 -x hpil.xrom -x time.xrom

will produce a listing of the program to standard output, with the standard names for the functions in the HPIL module and time module.

BUGS

Some synthetic functions may not be displayed correctly, although an attempt has been made to handle synthetic programming. Some common HP41C characters are not printable in ASCII (and are displayed as \nnn octal display sequences) so the display of strings in programs may be somewhat messy.

AUTHOR

decomp41 was written by Tony Duell, ard@p850ug1.demon.co.uk and has been placed under the GNU Public License version 2.0