First off, in the "49 series", I'm including the 48gII and 50g as
well as the 49G and 49g+.
I'm glad that you found a solution, but note that clearing all of
user memory and port 0 wasn't really necessary. For the 49 series,
holding down the backspace key while doing a warmstart skips
running any library configuration programs (such as the one for
the library that was causing you a problem), and also skips
running any 'STARTUP' program that you may happen to have. Of
course this gives you a chance to purge any misbehaving library,
or edit or purge 'STARTUP'.
A warmstart can (normally) be invoked by holding down the ON key,
pressing and releasing the C key, and releasing the ON key. If the
keyboard doesn't respond so that this doesn't work, a "hardware
reset" (insert a partially straightened small paper-clip or
something similar straight into the "RESET" hole in the back)
should do it.
On a 48 series, the reset hole is found by removing one of the
upper feet from the back; on the 48G series, it's on your right as
you face the back, but on the 48SX/S, it may be on either the
right or the left, depending on when it was manufactured. It
should have the letter "R" molded in (under the foot) next to it,
but it could be that some were manufactured with a circuit board
with the switch on one side, and a case back with the "R" on the
other side.
A hardware reset also adds an entry to the warmstart log.
Certain system error conditions also invoke a warmstart.
A warmstart is also the first thing that's done by the TTRM (Try
To Recover Memory?) procedure, even before you choose YES or NO.
Much of the rest of this post is plagiarized from Bill Wickes's
HP 48 Insights Part I: Principles and
Programming HP 48G/GX Edition (available on the Museum DVD / CD-ROM set;
see http://www.hpmuseum.org/cd/cddesc.htm). He refers to a
warmstart as a system halt.
Also, on the 48 series only, a system halt is performed
automatically when you turn the 48 on, if you have stored or
removed any libraries from any ports since the last time the 48 was
turned on, or if you have inserted or removed memory cards, or
changed a RAM card's write-protect switch position. This ensures
that there are no references remaining to library objects that you
may have removed.
A library usually (although it doesn't have to) includes a
configuration program, which usually (possibly along with other
actions) attaches the library automatically. If a library isn't
"auto-attaching", then you'll have to use the ATTACH command with
its library number as the argument before any of its commands can
be used.
On the 49 series only, a warmstart (unless the backspace key is
held down) finishes by executing any program in the reserved
variable 'STARTUP' in the home directory. This would be a good
place to run the ATTACH command for any non-auto-attaching library
that you want attached every time, or for that matter, to run the
DETACH command for any auto-attaching library that you don't want
attached every time, along with anything else that you want done
at every warmstart.
What a system halt does:
-
aborts all current execution;
-
clears the stack, the return stack, all local memories (local
variables and HALTed procedures), last arguments, the recovery
stack (last stack or UNDO), the command stack (last command
lines), and the graphics display (PICT), (and in the 49 series,
all virtual stacks);
-
turns off user mode (by clearing system flag -62);
-
sets the last error number to zero and the last error message to
an empty string;
-
detaches all libraries currently attached to the home directory,
and executes the configuration programs of all libraries in the
various ports (not including library files stored in the SD card
port of a 49g+ or 50g);
-
reestablishes the home directory as the current directory;
-
executes the MTH menu (for the 49 series, the TOOL menu instead);
-
(added with the 49 series: executes any program stored in the
reserved variable 'STARTUP' in the home directory;)
-
(added with the 49 series: if the backspace key is held down,
executing library configuration programs and the 'STARTUP'
program is skipped;)
-
leaves global or port variable, alarms, and key assignments
unchanged. All flags are also left unchanged, except flag -62,
which is cleared.
The reason for turning off user mode (clearing flag -62) with
every warmstart is that you can lock yourself entirely out of
using the keyboard (even from using it enough to turn off user
mode) with key assignments. This provides a "safety net" for that
situation; with user mode turned off, you now have access to the
"standard" keyboard again, and can change or remove the key
assignments.
On the 49 series, if you prefer to have user mode always on and
want to avoid having it off after a warmstart, then you can
include the sequence -62 SF within a 'STARTUP' program; you'll
still have a "safety net" of skipping execution of 'STARTUP' (thus
leaving user mode turned off) by holding down the backspace key
while warmstarting.
As you can see, a warmstart can be a bit disruptive, but not
nearly so much as a memory clear can be.
What a memory reset does:
A memory reset, for which you press the three
keys ON, A, and F all together (release in the order first F, then
A, and finally ON), starts by executing a system halt. Then the
calculator displays "Try To Recover Memory?" with YES and NO menu
keys.
If you see this display when you turn your calculator on, or at
any other time when you have not deliberately performed a memory
reset, it indicates that the calculator has detected a corruption
of the memory contents such that it can not continue normal
operations without at least a partial memory reset. This
corruption can be caused by a hardware fault, including the
effects of static electricity, by the execution of SYSEVAL with an
incorrect system address (or wrong arguments for a SYSEVAL
sequence, or starting with the 48G series, similar misuse of
LIBEVAL, or with the 49 series, FLASHEVAL), or just defective
built-in or add-in software (which includes a buggy or designed
for a different model SysRPL or assembly language program or
library).
If you choose NO, the calculator performs a complete reset,
deleting all global variables, port 0 variables, key assignments,
and alarms and resetting all flags to their default values. The
calculator displays "Memory Clear" when it is ready to resume
manual operations. (Note that ports 1 and higher are left
unchanged.)
If you choose YES at the "Try To Recover Memory?" prompt, the
calculator attempts to recover or restore as many user memory and
port 0 variables as it can by scanning through memory for
recognizable objects. If it detects a valid user memory, then it
can usually restore it unchanged, except that user key assignments
and alarms are always lost. If it finds invalid objects, it
discards them and rebuilds as much of the user memory structure as
it can. In some cases when the home directory itself is corrupt,
subdirectory objects there can be reconstructed, but they lose
their names. The calculator makes up variable names for these
directories, naming them D.01, D.02, and so forth. When the
automatic reconstruction process is finished, the standard display
is restored. Then you can inspect the VAR menu to determine how
much of user memory is intact. (Note that it might not be able to
recover anything at all.)
During variable reconstruction, the calculator looks for library
objects to try to determine where port 0 begins. Unfortunately,
if it encounters a library that was stored in a global variable,
it takes that as the start of port 0, which means that some part
of user memory will be discarded. For this reason, you should not
keep libraries in user memory for long term storage -- store them
in a port instead.
Oh, regarding your earlier questions, I surmise that you somehow
stored a library designed for a 48 series into port 2 of your 50g.
Normally, a 49 series safely stores a data stream with a 48 series
binary transfer header (or vice versa) as a character string
object, but by modifying the transfer header or other tricks, you
may be able to fool the system. Many supported entry points
changed in the transition from the 48 series to the 49 series, so
as a general rule, don't expect "binary objects" (except perhaps
simple objects that don't include commands) from one series to
work in the other series; if you want to try using them, first
decompile them to source code for the model they were designed for, and then try to compile them to
object code for the model that you want to use them with.
As Marcus mentioned, 48S and 48G series libraries and SysRPL
programs aren't necessarily interchangeable either, because some
supported entry points did change.
If an "unsupported" entry point is used, then it might work only
with the ROM revision that it was written for.
For many UserRPL objects that don't include SYSEVAL, LIBEVAL, or
FLASHEVAL, a library, library data object, minifont, font, or
symbolic vector/matrix, a Kermit "ASCII" or Conn4x "Text" transfer
will accomplish the decompiling and compiling. A 48 series always
compiles the source code of an exact integer as a real number, and
if a 49 series is in exact mode, then the 48 series source code of
a real number that doesn't include a fraction mark is compiled as
an exact integer.
Apparently something in the library was causing the 50g to hang
when the ON-C warmstart tried to run its configuration program. A
TTRM (Try To Recover Memory?) does include at least one warmstart
(which may explain why holding down backspace worked), but even
responding NO to clear all "user memory" and port 0 leaves all
other ports intact, so the library was still in port 2, and the
50g tried to run its configuration program again. Of course a
hardware reset merely invokes another warmstart and adds an entry
to the log, and removing the batteries leaves port 2 (nonvolatile
flash memory) intact.
Regards,
James
Edited: 15 Oct 2006, 6:51 p.m. after one or more responses were posted