
                        HP-28 OFF and RESTART commands

Here is the promised follow-up to my recent posting about a
programmable OFF command for the HP-28C and HP-28S.

The three SYSEVAL addresses I posted were:

              1BB                  1CC                  2BB
             #07FBA               #07FEF              #18E58h

It turns out that this SYSEVAL includes a RESTART command, so there
was no need to look for a separate one.  Try running the following
program, with the appropriate one of the three addresses:

                 #07FBA
      <<  "OFF"  #07FEF  SYSEVAL  "RESTART"  >>
                 #18E58

Your HP-28 should turn off - then when you press ON it should restart
so that the program will finish with "OFF" in level 2 of the stack and
"RESTART" in level 1.

I gave one example of a use for this - to reset FAST mode on an
HP-28S.  Here are two more.  First, to prevent random playing with
your HP-28 by unskilled users, you could use a program which
automatically turns the HP-28 off as soon as it is turned on:

               <<  1  10  START  #address  SYSEVAL  NEXT  >>

This simply turns the HP-28 off the first 10 times you press ON -
sufficient to discourage most people who just think they can borrow
your HP-28:- "I only wanted to do a couple of calculations, honest, I
didn't mean to do any harm, what does Memory Lost mean anyway, ouch!"

You can make the program more sophisticated, for example with an
infinite loop so that the user can only make the HP-28 stay on by
doing a System Reset (not Memory Lost!) as soon as he/she turns on the
HP-28.

Here is a second use:

  <<  #address  SYSEVAL  #4001FFC40000000  STOF  MEM  DROP  >>

This stores a default set of flags (as at Memory Lost, but HEX mode)
when your HP-28 is turned on, then it uses MEM to force "garbage
collection", and DROPs the result from the stack, leaving you with a
neatly set up HP-28.

The next thing to look for is a STARTUP command which is executed
every time you turn on your HP-28, regardless of the way in which it
turned off.  For example you might want your HP-28 to display a
message giving your name and address every time it is turned on, no
matter how it is turned off.  This seems a difficult thing to do -
some dedicated user will have to decode the turn-on code to see if
there is a jump vector to RAM included so that a STARTUP routine can
be put into RAM and executed via this vector.

I'd better stop before this gets too technical.  Many thanks to Graeme
Cawsey who rid me of my misunderstandings about OFF and RESTART.
Apologies to any folks at HP who may have felt upset by my comments
about a not-quite working RESTART - the code I described is actually
designed for a different purpose.  Now it's back to playing with
HP-42S PEEKs and POKEs!

Comments and flames to the net, or to me at the below addresses, but
please note I might take about a week to reply.  NOMAS: this is NOn
MAnufacturer Supported information - please do not ask HP about it!
Disclaimer: neither I nor my employer shall accept any responsibility
for any use of this material.

Wlodek Mier-Jedrzejowicz,
BITNET/EARN:  MIER @ SPVA.PH.IC.AC.UK  or UMAPD51 @ VAXA.CC.IC.AC.UK
JANET:        MIER @ UK.AC.IC.PH.SPVA  or UMAPD51 @ UK.AC.IC.CC.VAXA
UUCP:         WLODEK @ UK.CO.ZEN
