From: val on
Hi, do you know what is the alpha-enter and beta-enter mode on the HP48
? That is something about redirection but I don't know where to find
info on this.


From: Dave on
On Jan 14, 3:32 am, val <vlep...(a)aol.com> wrote:
> Hi, do you know what is the alpha-enter and beta-enter mode on the HP48
> ? That is something about redirection but I don't know where to find
> info on this.

If flag -63 (Custom ENTER) is set, and the USER keyboard is enabled
(Left-Shift, USER, or set flag -62), then the program named aENTER -
if it exists - will be used to handle command line parsing. Basically,
whatever you've entered into the command line is passed as-is as a
string to your aENTER program. This allows you to do your own custom
command line parsing. As an example, here's my aENTER, which allows
entering binary numbers without prefixing the # character:

\<< ERRN \-> E
\<< DUP
IFERR "#" SWAP
+ OBJ\->
THEN
IFERR E DOERR
THEN
END DROP OBJ\->
ELSE SWAP DROP
END
\>>
\>>

The bENTER program is slightly different. If, while entering something
in the command line, you press a key that executes an automatic ENTER
(for example, any of the arithmetic keys), then the command line will
be parsed with aENTER (if it exists), the key which performed the
automatic ENTER will be executed as normal, and then bENTER will be
executed and passed the name of the operation that performed the
automatic ENTER. A very simple bENTER program to see this in action:

\<< 1 DISP 1 FREEZE \>>

-Dave Britten
From: val on
Dave a �crit le 14/01/2010 :
> On Jan 14, 3:32�am, val <vlep...(a)aol.com> wrote:
>> Hi, do you know what is the alpha-enter and beta-enter mode on the HP48
>> ? That is something about redirection but I don't know where to find
>> info on this.
>
> If flag -63 (Custom ENTER) is set, and the USER keyboard is enabled
> (Left-Shift, USER, or set flag -62), then the program named aENTER -
> if it exists - will be used to handle command line parsing. Basically,
> whatever you've entered into the command line is passed as-is as a
> string to your aENTER program. This allows you to do your own custom
> command line parsing. As an example, here's my aENTER, which allows
> entering binary numbers without prefixing the # character:
>
> \<< ERRN \-> E
> \<< DUP
> IFERR "#" SWAP
> + OBJ\->
> THEN
> IFERR E DOERR
> THEN
> END DROP OBJ\->
> ELSE SWAP DROP
> END
> \>>
> \>>
>
> The bENTER program is slightly different. If, while entering something
> in the command line, you press a key that executes an automatic ENTER
> (for example, any of the arithmetic keys), then the command line will
> be parsed with aENTER (if it exists), the key which performed the
> automatic ENTER will be executed as normal, and then bENTER will be
> executed and passed the name of the operation that performed the
> automatic ENTER. A very simple bENTER program to see this in action:
>
> \<< 1 DISP 1 FREEZE \>>
>
> -Dave Britten

Nice feature. Thanks Dave.


From: John H Meyers on
On Thu, 14 Jan 2010 02:32:51 -0600, val wrote:

> What is the alpha-enter and beta-enter mode on the HP48?

It's the same for all HP48/49/50 (but only in RPN mode).

See "What is Custom ENTER?" [Apr 3 2001]
http://groups.google.com/group/comp.sys.hp48/msg/d6936655bd00bf50

Old links within the above post no longer work.


Here are programs to simply observe when each function is called,
and what is on the stack upon entry to each function.

Perform CONT to continue normal execution; it is recommended
that you do not alter the stack until after performing CONT:

\<< "\GaENTER" PROMPT STR\-> \>> '\GaENTER' STO
\<< "\GbENTER" PROMPT DROP \>> '\GbENTER' STO

The posted sequences \Ga and \Gb represent
the single Greek characters Alpha and Beta,
which can be typed in "alpha" mode as right-shifted A and B,
and \-> represents the "right arrow" character (right-shifted zero);
\<< and \>> also obviously represent "program delimiters."

The calculator can understand these "backslash" sequences
only when transferring programs in "ascii" mode using transfer software.

Flags -63 (Custom ENTER) and -62 (User keys mode)
must both be set to enable "Vectored Enter";
toggling User mode (left-shift, Alpha)
then also toggles "Vectored Enter"


Here's an HP48/49/50 "function trace,"
which leaves on the stack (in RPN mode)
a record of prior RPN calculations, a bit like
what is left on the stack in ALG mode (HP49/50):

\<< DEPTH \-> d \<< LASTARG DEPTH d - \->LIST
"{1 " ROT + STR\-> DUP SIZE GET { 14. 18. }
OVER TYPE POS { + SWAP } { DROP2 } IFTE
-55 DUP SF CF \>> \>> '\GbENTER' STO

-55 CF -62 SF -63 SF @ Required flag settings

Toggle User mode (left-shift, Alpha) to turn tracing off/on.

Example: You type 2 3 and then press +

The stack then shows { 2 3 + } [your input] and 5 [your result]


The following (HP49/50 series only), with flag -3 clear,
builds an algebraic expression using RPN operations,
displays both the expression and its current numeric value,
but leaves only the expression on the stack,
ready for further "chained" calculations.

Perform HOME 256 ATTACH _before_ entering this program,
and back up memory first, because "syseval" is dangerous,
if any mistake is made:

\<< DEPTH \-> d \<< LASTARG DEPTH d - \->LIST
"{1 " ROT + STR\-> DUP SIZE GET DUP TYPE 18 == {
+ OVER TYPE 9 == { DROP } { NIP \->ALG } IFTE
IFERR DUP \->NUM THEN DROP ELSE -79 CF -97 SF 2 \->LIST
#2EF67h SYSEVAL HEAD 2 FREEZE END } { DROP2 } IFTE
-55 DUP SF CF \>> \>> '\GbENTER' STO


You can use '\GaENTER' to do such things as
"Save unlimited command lines," as posted here
http://groups.google.com/group/comp.sys.hp48/msg/0edf00f94d56538d


Speaking of things "unlimited," the following SysRPL program
(shown for HP49/50 series, requires Extable library for compiling)
allows you to UNDO an unlimited number of your last actions,
although you must actually use CONT in place of UNDO:

":: DEPTH #0=?SEMI DROP SuspendOK? NOT?SEMI
' xHALT EvalNoCK ROMPTR A3 10 ;
@" -92 SF ASM '\GbENTER' STO

Here's a way to install the above without compiling anything
(there will be an error at LIBEVAL if the checksum test fails):

"D9D20C4130E7A434423040F5229A4379E60"
"D08839136229E203A0010B2130" +
DUP BYTES DROP #824Eh == #100001h * LIBEVAL
'\GbENTER' STO

Change ROMPTR A3 10 to ROMPTR A3 E to make an HP48G[X/+] version.

Use KILL or a warmstart (ON+C) to delete all saved UNDO levels
(after all, calc memory is not actually infinite :)


The following resets flags and modes after any operation,
thus undoing forced mode changes for HP49/50 CAS commands
(though it can't restore deleted variables, if any);
you should first set your preferred modes and do one PUSH
(turning off USER mode while you do this),
so that there will be something to POP the very first time:

\<< PATH POP PUSH EVAL { -62 -63 -120 } SF
DEPTH { DROP } IFT -55 DUP SF CF \>> '\GbENTER' STO

Faster replacement for the combination of POP and PUSH:
\<< { HOME CASDIR ENVSTACK } RCL DUP SIZE
{ HEAD LIST\-> 1 - SWAP EVAL \->LIST STOF }
{ DROP PUSH } IFTE \>> 'POPU' STO

Replace SWAP EVAL in the above with NIP
to avoid restoring the current directory,
thus allowing POPU to replace all of PATH POP PUSH EVAL
(restore flags only, allowing successful execution of UPDIR
and/or entering a subdirectory).


Other uses of \GbENTER could be to automatically display
stack level 1 (if numeric) as degrees+minutes+seconds,
or in some other special format,
or to automatically simplify any algebraic results,
or to automatically do all sorts of other stuff.


With so many different uses for "Vectored Enter,"
you might want to keep all of them handy -- but how?

Well, you can store different Vectored Enter programs in each directory,
so you can make different directories for different purposes --
any directory not having its own '\GbENTER' or '\GaENTER' programs
will look to higher directories for others to use as a default.


[r->] [OFF]