[comp.sys.handhelds] Empty names on HP[24]8*

jurjen@cwi.nl (Jurjen NE Bos) (08/14/90)

As a semiprofessional calculator abuser :-), I always tried to make empty
names on my HP28C and HP48SX, and also on a borrowed HP28S.
These are the results:
On the 28C, it is easy to make an empty name using the differentiate
function.  If you differentiate a user function, the calculator makes
a new name by putting "der" in front of the function's name.  The user 
may then program such a function himself.
For the moment, we are only interested in the fact that the new name is
three letters longer than the old name.
With this trick, you can easily make a name longer than the maximum of
127 characters.  If you go on and on, you can make very long names.
Of course, I wanted to know what happens if you make a name of 256 characters.
The result is just what I expected: the empty name.
More exactly, the program:

\<< 'F(X)' 1 85
  START 'X' \.d 'F(X)' 1 ROT OVER OBGET OBSUB
  NEXT
1 OBGET 1 GET
\>>

gives as result: '' (the empty name).
For the HP28C, nothing is wrong with this name, except that you can't type it.
Using this name, one can for example make the algebraic '*+', which is just
like 'a*a+a', but with the empty name in it three times instead of 'a'.
You can also use the name as a variable name for storing things under a black
menu label.

When I ran this on a HP28S, all went right, but there is one problem:
Storing something under the name '' crashes the calculator :-) .  For the
rest, everything works fine (as far as I know).

Now we get to the HP48SX.  Here, I first discovered that the derivative
puts "der" in front of a name shorter than 127 characters, and "der\027"
(that means: the four-character string with "d", "e", "r", escape in it)
if the name is longer than 128 characters 8-).
So I wrote this adapted program to deal with this case:

\<< 'FF(X)' 1 74
  START 'X' \.d { '&F(X;1)' '&F(X)' }
\|vMATCH DROP DUP \->STR SIZE 1 DISP
  NEXT
\>>

This program does not work!  The 74th iteration of the loop hangs at the 
differentiation operator, which tries to make a 252-character name into a
256-char name, but for some reason doesn't finish.  If you replace the
'FF(X)' by 'F(X)', you get a 255-char name, but that's all.

There are much quicker ways to make empty names.
There's also SYSEVAL!  If you're daring enough, do the following:
HP28C:
Put your wordsize to 64 with 64 STWS,
and your base to hex with HEX, and execute
\<< #2D12 'T' DUP PURGE STO #4FFF0 SYSEVAL
\>>

HP28S:
Put you wordsize to 64 with 64 STWS, and execute
\<< #2D12h HOME 'T' DUP PURGE STO #CFFF0h SYSEVAL
\>>

HP48SX:
This is a bit of a problem.  I don't know for you, but the address
#7FFB0 is the next example worked for my machine.  Don't worry, you won't
crash if you use the wrong address; you'll only get "External".  (But you
better not mistype the #1D898.  That's asking for trouble :-)  It does
not only depend on your port 0, but also on things I don't know.
Put your wordsize to 64 with 64 STWS, and execute
\<< #2E48h HOME 'T' DUP PURGE STO #7FFB0h 2 #1D898h SYSEVAL
\>>

The above programs let the calculator evaluate the empty name in the
28C and 28S case.  The above program for the 48SX is a little more
complicated to avoid evaluation of the name.  (This is the piece of
code 2 #1D898h SYSEVAL: it gets and object from a given address without
evaluating it.  I call it SYS because SYS EVAL does exaclty what SYSEVAL
does.  SYS is a nice and relatively harmless way to peek in ROM.)

(The following is discovered by Eric Toonen)
Now the big surprise: I did all this because on the 48 evaluating the empty
name does indeed do something: it is a directory name!
In fact, it is a subdirectory of the HOME directory and it contains three
variables:
- USERKEYS, containing the user key assignments
- USERKEYS.CRC, the checksum of the above
- ALARMS (I'm not sure about the name), containing the alarm settings
If you are in this directory, PATH gives { HOME } but this list is not what
it looks like: LIST\-> gives HOME '' 2.
BTW: editing the ALARMS list is impossible because it contains some 96-bit
binaries.  They are printed as C# 24 ddddddddddddddddddddddddh, but you
can't enter them.

So far my experiences with empty names.  I hope you liked it.
--
|                 | "Never imagine yourself not to be otherwise than what |
| Jurjen N.E. Bos | it might appear to others that what you were or might |
|                 | have been was not otherwise than what you had been    |
|  jurjen@cwi.nl  | would have appeared to them to be otherwise."         |