On 12/7/2012 2:00 PM, Scott Chapin wrote:
> My emulator is on my iPhone (m48+).
> When I transfer my HP50 home directory backup from my SD card OTA,
> it opens up as a binary string with null characters.
>
> I was hoping that EMU48 might allow me to create a useable file.
A calculator "directory" is a binary object.
Binary objects, when stored as computer (or SD card) files,
are prefixed with an 8-byte "header" followed by the binary image
of the object as it resides within calculator internal memory.
The 8-byte "header" is "HPHP49-x" for HP49/50 series objects,
and "HPHP48-x" for HP48[S/G] series objects, which are generally
not mutually compatible, hence are normally rejected
(by remaining as a string containing all bytes of the computer file,
including the first 8 bytes "HPHP4?-x")
when loaded into the internal memory of
a different series calculator than they were stored from.
Some transfer software also even tests objects having
a matching "binary header" for the same series,
to see whether the object type is valid,
and whether an internal function for "skipping over"
the object agrees with the prefix-removed file length;
objects failing either test are corrupted, hence are best
left encapsulated in the string, where they can't cause a crash.
On the HP49/50 series, you can even use a simple UserRPL program
to clip off the "binary prefix" and force any string to be interpreted
as an internal binary object, but if it turns out to be
an invalid or corrupt object, you might soon have
either a crash or a complete "Memory Lost" wipe to show for it.
Are you trying to transfer binary objects between different series?
Is your "OTA transfer" being performed in a "binary" mode,
rather than assuming that what's being transferred is
a human-readable plain text UserRPL "source" file, as is done
when using HP's built-in Kermit (or other file transfer software)
"in ascii mode"? "Ascii mode" means that the computer side file
is the human-readable version of the binary file on the calculator side,
involving "compiling" of plain text files going from computer into calculator,
before final storing on calculator side, or first de-compiling (to plain text)
of files going from calculator to computer, prefixed in this case
by a "mode header line" such as: "%%HP: T(3)A(D)F(.);"
The "mode header line" helps to assure that re-compiling of UserRPL text
is done using modes matching when they were de-compiled and "translated,"
because proper UserRPL interpretation may vary with current settings of
character [T]ranslation mode, [A]ngle mode, and [F]raction mark mode.
In the computer -> calculator direction, file transfer software
usually recognizes either "binary" or "ascii" file headers,
automatically adjusting all transfer modes accordingly;
in the calculator -> computer direction,
the user-chosen file transfer mode is selected,
and an appropriate mode header is prefixed.
One HP49/50 series mode affecting proper UserRPL interpretation
is not reflected in "ascii" headers, which is "Exact" vs. "Approximate"
mode -- in the HP49/50 series, "Real" numbers always display with a
"fraction mark" ("decimal point") but a different "Integer" object type
displays with no such character; this same display distinction is used
to compile each object to its separate type in "Exact" mode,
whereas they are both compiled to "Real" type in "Approximate" mode.
The HP48 series also compiles all numbers to "Real" type,
because it has no "Integer" type, and while de-compiling,
it omits a trailing "fraction mark" ("decimal point")
for numbers that appear to have an integer value.
Therefore, when using HP49/50 series calculators,
one should therefore normally compile HP49/50 series UserRPL text
in "Exact" mode, but compile HP48 series UserRPL in "Approximate" mode,
to avoid introducing new object types into HP48 series programs, and
HP49/50 UserRPL programs might not work in HP48 series calculators
if they depend on any new object types.
Although "binary" objects (other than strings) are not human-readable,
nor are they transferable in general between calculator series,
they do avoid all the potential ambiguities associated with UserRPL program text,
and are best for "guaranteed correct" backup/restore and calculator <-> emulator transfer.
[r->] [OFF]