From: Yann on 21 Sep 2009 07:42
The key in accepting an ML keyboard test is controlling the position
of the key in the menu.
This is possible, because the paging is fixed at 6 items per page, and
you control the position of the xNAME in the list.
An example extracted from Phantasie Conquest ( http://www.hpcalc.org/details.php?id=6639
to check if any of the menu key has been pressed is below :
%* Check Keyboard
C=0.A LC(3)$102 % 1FF ==> Toutes les touches; 102==> Ligne
Menu et A (sur ligne 2, va savoir...)
OUT=C GOSBVL =CINRTN
?C#0.A EXIT % Si C<>0, alors une des touches demandées
By attributing more precise values to C before calling CINRTN, and
also controlling output value,
you can know exactly if the selected key has been pressed.
Now, 2 drawbacks :
- C values are different wether you are targeting HP48 or HP49/50
- if the program position changes in the list of xNAMES, you need to
update the ASM code with new values.
To be fair, i much prefer your method, which is not only simpler to
but also more flexible (with no dependancy on program position, nor on
From: John H Meyers on 21 Sep 2009 20:26
On Sun, 20 Sep 2009 16:57:42 -0500, Andreas wrote:
> Easiest is to use the sNAME directive
> and add an invisible space character at the end, like
> sNAME NameIt NameIt\20
> So the real name of the xNAME would be NameIt\20
> which can not be entered and the command line parser
> will always create NameIt from it which is not the ROMPTR.
This trick is even used for names of stored items,
e.g. in the "HP48 Hacker's ROM" card produced by Joe Horn,
where the ABOUT menu key actually represents
a program stored under the name "ABOUT "
After all, everyone wants to use the same name ABOUT,
which would otherwise be in conflict between all
libraries and directories (or card ports) which contain it,
although it is intended to be invoked only by pressing a menu key,
and never used as a programmable command.