"So ya wanna run HP-42 programs on yer 48, do ya? Piece o' cake!" HP42S by Joseph K. Horn 15 Oct 1990 An HP-42-to-48/41-Emulator translator Files: The HP42S directory contains two files: TR42 and TAB42. Requirements: HP-42S, HP-48SX "41CV Emulator Card", and James Donnelly's Tool Library (for the REPLACE function). Purpose: Allows you to run HP-42S programs on the HP 48SX. Method: "Print" the program from the 42 to the 48, translate it into 41 code using the TR42 program, and run it using the 41 Emulator Card. Theory: The 41 Emulator Card allows HP-41 programs to run on the HP 48S. So it would seem that it should be able to run HP-42 programs too, since the 42 is so much like the 41. But it can't, because so many functions got renamed in the 42. For example, the "CHS" function in the 41 was renamed to "+/-" in the 42. There were so many changes, that Zengrange decided that the extra code required to handle the 42 was not worth the bother, especially since the 42 does not have external program storage ability, which makes the demand for 42->48 ability minimal. All we have to do, though, is replace the new command names with the old ones, plus a little minor reformatting, and the Emulator will "think" it's a 41 program. This editing process can be automatically & quickly done by running TR42. INSTRUCTIONS: (1) On the HP-42, execute 0 DELAY. (2) Get the 42 and 48 ready for I/R transfer: (a) Elevate the 42 by resting it on top of Donnelly's manual for the Programmer's Toolkit (it's just the right height). (b) Point them "head to head" with their "HEWLETT"s directly across from each other. (c) On the 42, press PRP. Don't press the program name yet, but make sure it's in the menu. (3) Transfer the program from the 42 to the 48: (a) Press INPRT on the 48. (b) Within 10 seconds, press the program name on the 42. (4) When transfer is done, see the program as a string in level 2 and a 1 or 0 in level 1. If 0, try the transfer again. If 1, it may have been a good transfer; attempt translation now: with the program string in level 1, execute TR42. (5) Check the result by down-arrowing through it. Q. What does TR42 do? A. It: (a) removes the unnecessary program line 00; (b) replaces all CHR 4's (printer linefeeds) with CHR 10's (newline characters); (c) replaces all double quotes with single quotes (for Emulator); (d) removes all unnecessary ST's in stack-register commands; (e) removes all those blobs on LBL lines; (f) changes the 42's special multiplication symbol into "*"; (g) changes the 42's special division symbol into "/"; and (h) replaces all 42 commands with their 41 equivalent, as listed on pages 171-172 of the 42 Owner's Manual. For example, all occurrences of "+/-" get replaced by "CHS". There are 20 commands which are searched for and replaced. Q. How fast does TR42 run? A. Several seconds for a small program; several more for a large one. This speed is possible due to the use of the REPLACE function in the HP 48 Programmer's ToolKit by James Donnelly. Q. I don't own the 41 Emulator Card; is TR42 of any use to me? A. Yes; it takes INPRT strings, which are not really editable, and makes them useable. Q. What does TR42 do with 42 commands that have no 41 equivalent? A. Nothing. They are left alone so that you may create your own 41 Emulator command extensions (see manual) to emulate them, if you wish. Otherwise, programs containing such commands (like AGRAPH) cannot be run by the Emulator. Q. What do I do with the program string that TR42 yields? A. Whatever you please. You can EDIT it. You can PR1 it. You can STO it. You can ->41 it. You can even DROP it. Q. Can the list of functions that are searched for and replaced be changed? A. Yes, very easily. The file "TAB42" is a lookup table of pairs of 42/41 commands. For exampl˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙F(˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙ ˙˙$˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙˙H<ŘxKH˙xŘxLH˙ŘđŘxZH˙'Š؊-Š&ŠB BDC[2hȇŠ Š ŠŠ.ŠŠ-ŠBD3[‡ţŠ&Š }B[4‡]3‡BD@BD6BDtBBDRBBD2BD@      B B Tb5cxb c‡€ŔŠU€ŠWTb5cxb c‡€BD\]‡U€B W