Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Complete SYSEVAL translator package

30 views
Skip to first unread message

John H Meyers

unread,
Jan 18, 2000, 3:00:00 AM1/18/00
to joe...@jps.net
Transferring a UserRPL program between an HP48 and an HP49
is generally as easy as plugging in the supplied cable and
just doing an ascii transfer between the calculators.

Watch out if there are any SYSEVAL commands in the program,
however, since system addresses have generally changed in
the HP49, so most addresses need manual lookup and editing.

You may now also need to save (or post) different versions of
such programs, one for the HP48 and another for the HP49.

The package below, however, can automatically convert all
SYSEVAL addresses for you; here's how it works:

You simply add the *name* of each supported system function
as a "tag" along with its address, e.g.
:TRUE: #3A81h SYSEVAL @ the address of TRUE

As you can see, the name between the colons,
just before the address, is the "name tag" for that address;
it has no effect during program execution,
but is the key to making your programs translatable.

Using that "name tag," the translator below can look up
and replace each former address with the correct address
for the calculator into which you download the program.

To do this on an HP49, you need to have HP's "extable" library
installed; this library contains the names and addresses of all
supported system functions. For the HP48, you need Jazz instead.

The same translator which can replace old SYSEVAL addresses
with new ones will also look up and tag the old addresses
for you in the first place, so in fact there is no manual work
left to do to generate the name tags on the original calculator,
and no manual work needed to update the addresses after you have
transferred a program to its new home in a different calculator.

Finally, to save you the trouble of even looking up any SYSEVAL
addresses when you create a new program, you can use entry
point names instead, e.g. "TRUE" SYSEVAL -- when you send
this through the same translator, it comes out as
:TRUE: #3A81h SYSEVAL -- with the correct address for
execution now, plus a name tag for any future translation.

If any new user programs containing SYSEVAL are posted in this
fashion (I have already been posting some of mine in this way),
then it will be no problem for users who have this package
to translate it for their own calcs, or no problem for
the author to post it in a version suitable for each calc,
by just running it through the translator.

I have quite a bunch of such programs myself which I maintain
identically in both my HP48 and my HP49; this had been a
tedious business to deal with before, but now it's trivial.

Wait, folks, we're not done yet -- with every order for this
free translator, you'll get three extras, just like with those
miracle kitchen knives you can buy on TV.

First, all those tags take up more space in your program,
so no doubt sometimes you'll want to remove them, to
shrink your programs again. Fine, we'll throw in
a tag remover program as well -- and it does not even
require the symbol tables (Extable or Jazz) to run.

Second, you've probably heard of Joe Horn's original PACK
program for the HP48, which shrinks every SYSEVAL call
down from 15.5 bytes to only 2.5 bytes each,
by turning it into a direct system address pointer;
okay, we give you that here, too, at no extra cost.

Third, after you have used PACK, you probably know that you
can not edit your program any more. Well, that's probably
no longer true, as we have a final function which does a
pretty good job of undoing the effects of PACK
and restoring the original program.

So that's the deal, folks; if you want the automatic translator,
the automatic tagger, the automatic tag remover, the
program-shrinking PACK function, and the program-restoring
un-PACK function -- all for one low free price,
for an unlimited time only --
just pay attention to the instructions which
will appear right below on your computer screen,
and thanks for watching our show.

--------------------------------

If you are going to install this in an HP49, just be sure
that you have installed the "extable" library and have
done 256 ATTACH *before* starting to download anything;
then download and run the whole self-installing package below;
if you don't have a cable (how did you install "extable" if not?),
then you can type the programs and store them as indicated.

If you are going to install this in an HP48, be sure
that you have Jazz installed first, and then you must
pre-install three extra programs ( ->LST, ->PRG, and ->A )
which are in the folowing ASC-format directory object
(download it, decode it with ASC->, store it,
and *move* the programs to your HOME directory);
then you can download and execute the main installer.

Note that this ->PRG supersedes any hack library program
of the same name; it will do what the hack library version
did (viz. act like ->LIST but make a program instead),
plus a new thing which some hack libraries didn't do
(directly convert a list or algebraic into a program).

%%HP: T(3); @ \->LST, \->PRG, and \->A (in a directory)
@ For the HP48 only; the HP49 has these in library 256
"69A20FF74C0000000020D81420D9D205AA81CCD20510008FC1523248DD6950B2
1301300040D805257440D9D20ECE819FF30D9D2043C813BF3013350B21301204
0D9D20756603BF30CCA50B213094040D9D20756603BF30CCA50B2130F3040E8E
60B2130F700040D8C4354540D9D20ECE819FF30D9D2043C81F9F3013350B2130
F3040D9D2075660F9F30CCA50B213094040D9D2075660F9F30CCA50B21301204
0E8E60B21305303"

You will find ASC-> in the HP48 FAQ and at hpcalc.org;
you can alternatively use the program TASC.EXE from hpcalc.org to
translate first on a PC, and then download the result to your calc.

If you have attached, installed and moved into HOME all the
things outlined above, then you are ready to download
the following self-installer, which adapts itself
to whichever calculator (HP48 or HP49) you load it into;
run it once to create all the advertised programs,
and then discard the downloaded file.

This product, like all JohnCo products, comes with our famous
unconditional lifetime guarantee: if you are not satisfied with
your product, you may return it at any time for a full refund,
no questions asked -- and we'll even pay the e-mail postage!

-----------------------------------------------------------

%%HP: T(3)F(.); @ Header for automatic transfer by cable (Kermit)
@ ("at" symbol toggles comments; end of line terminates comment)
@ \-> is right-arrow character, [backslash]010 is newline.

@ Translate supported SYSEVAL addresses between HP48 <-> HP49
@ ( to transfer UserRPL programs which use SYSEVAL )

@ Each function translates a program on stack level 1.

@ If addresses are not yet tagged on the "source" calc, we
@ automatically look up the name for each address (needs Jazz or
@ Extable) and "tag" each address with the actual entry point name.

@ If addresses are already tagged, then using the names in the tags,
@ we look up each address in our own calc (needs Jazz or Extable),
@ replacing original addresses with correct addresses for our calc;
@ this allows us to import programs created on a different calc,
@ and to automatically update the addresses for the new calc.

@ With this package, you can also do the following:
@ Add tags to addresses to identify SYSEVAL entry point names.
@ Remove such optional tags when desired.
@ Create programs using entry point names as SYSEVAL arguments,
@ then automatically lookup the names and insert the addresses.
@ Implode or re-expand system calls: ->PACK and PACK-> functions.

@ NOTE: You must have "Jazz" or "extable" *** PRE-INSTALLED ***
@ before loading these programs (also library 256 attached if HP49).

@ On HP48 you must also have pre-installed the following functions
@ identical to HP49 library 256: \->LST \->PRG \->A
@ (\->LST and \->PRG differ from 48 hacklib, \->A is same as ADDR).
@ Be sure to install the additional HP48 "support package" first!

@ This is a self-installing file, just like on a computer;
@ it adapts itself to whichever calc (48 or 49) it is loaded into.
@
@ To automatically create all programs, you may download, run,
@ and then discard this entire file, after transferring via cable.
@
@ Alternatively, each individual program may be entered manually.


@ SYSEVAL address translator (see below for HP48 helper functions)
@ Requires Jazz or Extable
@ Conversions:
@ #address SYSEVAL -> :name: #address SYSEVAL [get name tag]
@ :name: xxxxx SYSEVAL -> :name: #address SYSEVAL [replace address]
@ "name" SYSEVAL -> :name: #address SYSEVAL [get address]
@ Program halts on lookup failures, press CONT to leave unchanged.
@ "Extable" currently does not return "last arg" on lookup failures
@ (if it ever does, then include extra DROP where shown as comment).
\<< { SWAP
DUP TYPE 2. == { DUP \->TAG } IFT
DUP TYPE 12. == { OBJ\-> DUP
IFERR GETADR THEN HALT @DROP@ OVER END ROT DROP SWAP \->TAG } IFT
DUP TYPE 10. == { DUP
IFERR GETNAME THEN HALT @DROP@ ELSE \->TAG END } IFT
DUP TYPE 5. == { HALT } IFT @ list-processing is not handled
SWAP } SYSCV \>> @ uses the converter shell found below
'SYSTR' STO

@ HP48 helper functions for GETADR and GETNAME, using EA from Jazz
@ (we currently duplicate the failure to return a last arg on error;
@ therefore do not include the preceding commented DROP commands)
\<< -55. CF IFERR EA THEN DROP ERRN DOERR END \>> @ includes DROP

-55. CF @ for loading the above automatically via cable
IFERR { GETADR } 1 GET STO THEN DROP2 END @ not stored on HP49
{ GETADR } 1 GET @ Use indirect reference
IFERR { GETNAME } 1 GET STO THEN DROP2 END @ not stored on HP49

@ Program to remove the optional tags from all SYSEVALs
@ Does not require any assembler or symbol table
\<< { SWAP DTAG SWAP } SYSCV \>> @ uses shell found below
'SYSRT' STO

@ Common converter shell for several different programs
@ (descends into programs and lists, looking for SYSEVAL)
@ Args: prog_to_be_converted action_for_syseval
@ Note that this program contains its own name twice
@ Requires \->LST and \->PRG as found in HP49G library 256
@ (they are identical in either SysRPL or binary for HP49 and HP48)
\<< -55. CF STD HEX 64. STWS :: SYSEVAL DTAG \-> p s \<<
DUP TYPE 8. == { \->LST p SYSCV \->PRG } IFT
DUP TYPE 5. == { IF DUP SIZE THEN 1.
\<< IF p OVER DTAG s SAME NSUB 1. > AND
THEN EVAL ELSE SYSCV END
\>> DOSUBS END } IFT \>> \>>
'SYSCV' STO

@ The following is like Joe Horn's PACK program,
@ which reduces program size by 13 bytes per SYSEVAL,
@ although it makes the program uneditable
@ (see below for reversing the procedure, however)

@ Conversion: #xxxx SYSEVAL -> 2.5-byte pointer
@ Requires Jazz or Extable
\<< { OVER DTAG TYPE 10. ==
{ DROP DTAG \->STR 2. OVER SIZE 1. - SUB "PTR" SWAP +
ASS } IFT } SYSCV \>> @ Use helper below for HP49
'\->PACK' STO

@ Assembler aid for HP49 (uses MASD instead of Jazz)
\<< "\010@" + ASM \>> @ string is a "newline" before "at"

-55. CF @ for loading the above automatically via cable
IFERR { ASS } 1 GET STO THEN DROP2 END @ not stored on HP48

@ HP48/49 program to undo the action of ->PACK (in most cases)
@ Does not require any assembler or symbol table.
@ Note that this program contains its own name twice.
@ Requires \->LST \->PRG and \->A as found in HP49G library 256
@ This program must be translated with SYSTR (above) before use.
\<< -55. CF STD HEX 64. STWS
DUP TYPE 8. == { \->LST PACK\-> \->PRG } IFT
DUP TYPE 5. == { IF DUP SIZE THEN 1.
\<< "INHARDROM?" SYSEVAL "TRUE" SYSEVAL SAME @ to be translated
{ DUP \->STR "External" POS OVER TYPE 20. == OR
{ \->A :: SYSEVAL DTAG } IFT } { PACK\-> } IFTE
\>> DOSUBS END } IFT \>>
SYSTR 'PACK\->' STO @ Translate before storing

@ End of downloadable HP48G/HP49G file


-----------------------------------------------------------
With best wishes from: John H Meyers <jhme...@mum.edu>


Sent via Deja.com http://www.deja.com/
Before you buy.

0 new messages