What are applications of HP-IL Emulation for HP-41X?

The purpose of this article is to show that many (if not all) of HP-IL functionality can be provided by HP-41X. HP-41X tried (and succeeded) to provide the HP-IL connection via serial cable from HP-48GX/49G to the PC and emulate as many HP-IL devices as possible in the virtual way, without the need for HP-IL card or any real HP-IL devices (which are very hard to find nowadays, BTW, and will be even more hard to find in the future). Everything what is needed is contained inside the HP-41X emulator and the appropriate HP-IL server program running on the computer.

After you connect the calculator to the PC via serial cable and made all other adjustments according to the installation instructions, start HP-IL server on the PC side and HP-41X on the calculator side. Then type SF 15 to activate trace mode and execute a few HP-41 instructions to test the HP-IL connection. If the correct output appears inside the HP-IL console on the computer then a connection is working OK and HP-IL is ready to use. Execute CCD ROM instruction CAT 0 to list all available virtual HP-IL devices. The currently SELECTed device (DISPLAY) will be marked with ‘*’.

Then find some LIF tape/disk files with HP-41 programs/data/keys and load it into the HP-IL server (press the ‘...’ button and find/load the file using the appropriate ‘Open File’ dialog box). Execute CAT 7 or DIR to list the contents of the virtual tape/disk. You can load programs from the tape/disk into the emulator with READP or save them to the tape/disk with WRTP as on the real HP-41. Other types of files (register blocks, data files, extended memory files, key assignments, ASCII text files, ROM images, calculator state files, ...) can be loaded and saved as well. Files saved by HP-41X are fully compatible to the HP-41 standard so they can be used with the real HP-41 HP-IL mass storage devices and even with other emulators like Emu41 without problem. Of course, files created with HP-41 and Emu41 can be used with HP-41X. Sharing these files via e-mail with other HP-41X, HP-41 and Emu41 users is easy.

Furthermore, ROM plug-in modules developed with HP-41X using HEPAX, ZENROM or RAMBOX can be easily saved and loaded into the Emu41, HP-41 or some newly developed devices like Clonix or MLDL2000. Vice versa is possible, too, so HP-41X can use vast majority of the modules created for the HP-41 calculator. Direct input/output is possible as well, using the appropriate INPUT and OUTPUT virtual devices, providing a vast of possibilities for binary/text data manipulation and transfer. File transfer programs writen for Emu41 which utilize DOSLINK device can be easily converted to be used with HP-41X by simply replacing all occurances of “DOSLINK” with the appropriate “INPUT” or “OUTPUT” device. The default input and output files are INPUT.DAT and OUTPUT.DAT in the HP-IL server directory. If you want to use another files then execute CLRDEV command from EXT-IO module (included with HP-41X) prior to start of the program (because, in HP-41X, the input/output file doesn’t have to be tied to any particular name but can be specified by the user upon receiving the Device Clear HP-IL command). Furthermore, all console and printer output is captured to the CONSOLE.TXT and PRINTER.TXT files (located in the HP-IL server directory) which can be further manipulated by any text editor on the computer.

Using the PRINTER and COMPORT/LPTPORT devices, many advanced printer applications are possible like printing to the Windows printer(s) or the direct control of the printer via serial/parallel port. By using the EXT-IO and EXT-IL modules some advanced prints can be done like multi-column prints and fast HP-41 barcode plots (with the aid of SKWIDBC ROM module). For converting Emu41 + HP-IL card printing programs, “PRINTER”/“LPRTER1” to “LPTPORT” replace is usually only what is needed. Controlling my LaserJet printer via HP-IL from HP-48GX running HP-41X works like a breeze ...

Here are a few examples of modules management via HP-IL emulation on HP-41X which can be very useful for ROM modules development and uploading ROM images (the basic knowledge about using HP-IL, EXT-IO, HEPAX and ZENROM is assumed):

(1) Working with HEPAX:

As HEPAX is built-into the HP-41X it is common to describe it’s use first:

(1.1) Displaying disassembled ROM listings on the screen:

Execute AUTOIO (or MANIO 1 SELECT), execute DISASM from HEPAX, enter the start/end address and HEPAX will start to print the listing automatically (it will be displayed on the HP-IL console and captured into the CONSOLE.TXT file located in the HP-IL server directory). If needed, stop the listing with R/S.

(1.2) Capturing disassembled ROM listings into text files:

Execute MANIO 7 SELECT CLRDEV, enter the name of the file into the HP-IL server and execute DISASM from HEPAX - the rest is the same as in (1.1). After the process is finished, edit the resulting file with any text editor.

(2) Working with ZENROM:

(2.1) Displaying disassembled ROM listings on the screen:

Execute AUTOIO (or MANIO 1 SELECT) SF 15, execute MCED from ZENROM, press ENTER, enter the start/end address, press R/S and ZENROM will start to print the listing (it will be displayed on the HP-IL console and captured into the CONSOLE.TXT file located in the HP-IL server directory). If needed, stop the listing with R/S.

(2.2) Capturing disassembled ROM listings into text files:

Execute MANIO 7 SELECT SF 15 CLRDEV, enter the name of the file into the HP-IL server and execute MCED from ZENROM - the rest is the same as in (2.1). After the process is finished, edit the resulting file with any text editor.

In both (1.2) and (2.2) cases, if you want to use the default OUTPUT.DAT file in the HP-IL server directory, then CLRDEV can be omitted.

(3) Saving/loading ROM images to the virtual tape/disk:

Either WRTROM/READROM from HEPAX or WRTPG/READPG from RAMBOX can be used (and perhaps other commands from modules like ERAMCO etc. which I haven’t tested). The resulting files are fully compatible with the standard HP-41 ROM image files and can be used either on HP-41 or Emu41. All pages can be sent, this include ROM, HEPAX RAM, RAMBOX and MLDL pages. Of course, only HEPAX RAM, RAMBOX and MLDL pages can be received. As HP-41X management of pages/modules is fully automatic, the whole loading/saving process is very simple. 64K W&W RAMBOX2 emulation has been developed as well (extended to 96K) but this is a separate version of HP-41X which is only available for some special purposes (as it is 64K ASTRONAV software written by Antoine M. Couëtte).

Text files containing disassembled ROM listings can be converted to the BIN format for use with Emu41 by using the CLBIN41 program (included with the Emu41).

Keep in mind that HEPAX and RAMBOX images aren’t mutually compatible. Fortunatelly, HP-41X can be used to convert images from one format to the other - just load RAMBOX image with READPG and save it to HEPAX image with WRTROM or load HEPAX image with READROM and save it to RAMBOX image with WRTPG.

(4) Capturing HP-41 program listings into text files:

(4.1) Using CONSOLE device:

Execute AUTOIO (or MANIO 1 SELECT) CLRDEV and type PRP followed by the name of program to print. If you want more listings to be captured at once then just execute a few more PRPs in succession. At the end, all listings will be displayed on the screen and captured into CONSOLE.TXT file located in the HP-IL server directory. The CONSOLE device is using MS DOS 437 codepage and some characters are remapped to match the original HP-41 character set.

(4.2) Using OUTPUT device:

Execute MANIO 7 SELECT CLRDEV, enter the name of the file into HP-IL server and type PRP followed by the name of program to print. If you want more listings to be captured at once then just execute a few more PRPs in succession. No codepage character remapping is performed during the capture. CLRDEV can be omitted if you want to use the default OUTPUT.DAT file located in the HP-IL server directory.

Flags 15 and 16 (MAN/NORM/TRACE) can be used to format the listing according to your needs. Resulting files containing the listings can be further manipulated using a text editor. The best results are achieved by using an MS DOS editor in the full-screen mode as this will more closely match the HP-41 character set.

Conclusion:

Combine the above facts with all HP-41X improvements and enhancements over the regular HP-41 and you will see how much power has been packed into this little package. Contrary to the popular opinion on the MoHPC forum that only emulator with HP-IL support is Emu41, the HP-41X emulator is very HP-IL capable and suitable for all kinds of ROM modules development as it can execute all these tasks quite well without the need for an HP-IL card and other expensive hardware.