Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Keyboard Interrupts in UserRPL

14 views
Skip to first unread message

goo...@cox.net

unread,
Jun 9, 2007, 12:52:58 PM6/9/07
to
How does someone implement keyboard interrupts in UserRPL? The manual
mentions commands INTON and INAOFF, but they apparently aren't in
UserRPL.

John H Meyers

unread,
Jun 9, 2007, 1:49:28 PM6/9/07
to
On Sat, 09 Jun 2007 11:52:58 -0500:

> How does someone implement keyboard interrupts in UserRPL?

> The manual mentions commands INTON and IN[T]OFF,


> but they apparently aren't in UserRPL.

Do you mean to mask interrupts off,
or to inquire whether a key has been pressed?
(the UserRPL KEY command does the latter).

Machine-language commands can be issued only
from programs containing ML code; you can of course
make a simple program, store it, then call it from UserRPL.

SysRPL programs will not be interrupted by keypresses
(even ON/CANCEL) unless they (or functions which they call)
test for it (including the ATTN? test for ON/CANCEL).

[r->] [OFF]

goo...@cox.net

unread,
Jun 10, 2007, 7:36:37 AM6/10/07
to
On Jun 9, 1:49 pm, "John H Meyers" <jhmey...@nomail.invalid> wrote:
> On Sat, 09 Jun 2007 11:52:58 -0500:
>
>
> Do you mean to mask interrupts off,
> or to inquire whether a key has been pressed?
> (the UserRPL KEY command does the latter).
>

... Exactly what I needed to know!

thanks!
>
> [r->] [OFF]


goo...@cox.net

unread,
Jun 10, 2007, 8:35:54 AM6/10/07
to
The next "wish list" is

1) Highlight a line in the LCD display. I'm using "HELLO" 5 DISP type
commands to put text on the display. How do I highlight (reverse
video) a line?

2) Use the 12th line of the display. If you do "HELLO" 12 DISP,
nothing happens. The bottom line stays blank.

3) Change the active menu from within a program without stopping it.
The selected menu only shows up after the program stops... when I want
it to go back to CST.


John H Meyers

unread,
Jun 10, 2007, 9:53:49 AM6/10/07
to
On Sun, 10 Jun 2007 07:35:54:

> The next "wish list" is:

> Highlight a line in the LCD display.
> I'm using "HELLO" 5 DISP type commands to put text on the display.
> How do I highlight (reverse video) a line?

Perhaps make the text a "grob" using \->GROB,
NEG it, and REPL it on the stack grob.

Your question inspired the following quirky program
(note that the exact address is critical,
always make a backup first):

@ "Night vision" preserver for HP49/50 series *only*
\<< DROP #2EF67h SYSEVAL LCD\-> NEG \->LCD
0 FREEZE \>> '\GbENTER' STO -63 SF -62 SF

> Use the 12th line of the display.

12th line? With what font size?

> If you do "HELLO" 12 DISP,
> nothing happens. The bottom line stays blank.

Do you mean the menu area? When is it blank?

The menu area is a different grob, but you can
turn the menu off using (system entry) TURNMENUOFF
and *then* write to it
(although not with user DISP command, IIRC;
system entries DISPN and Disp5x7 can do it,
but you'd better first find out how to use them properly).

> Change the active menu from within a program without stopping it.
> The selected menu only shows up after the program stops...

If you are using WAIT (for a key), then use -1 WAIT;
otherwise call system function DispMenu.1

If you keep going like this, you're either going to need
to write SysRPL programs or use SYSEVAL a lot in UserRPL.

[r->] [OFF]

John H Meyers

unread,
Jun 10, 2007, 10:19:37 AM6/10/07
to
On Sun, 10 Jun 2007 08:53:49 -0500:

> How do I highlight (reverse video) a line?

Oh, I forgot that the HP49/50 series has something simpler:

Do HOME 256 ATTACH, then:

\<< "314031" H\->S SWAP OVER + + \>> 'INVTXT' STO

"Hello" INVTXT 4 DISP 0 FREEZE

There you go -- displays in "reverse video"!

[r->] [OFF]

John H Meyers

unread,
Jun 10, 2007, 11:41:45 AM6/10/07
to
On Sun, 10 Jun 2007 09:19:37 -0500:

@ Applies inverse video to a text string


\<< "314031" H\->S SWAP OVER + + \>> 'INVTXT' STO

Articles about applying "styles"
(Bold, Italic, Underline, Inverse)
within HP49/50 series text strings:

http://groups.google.com/group/comp.sys.hp48/msg/c9a3996e757abcbe
http://groups.google.com/group/comp.sys.hp48/browse_thread/thread/257882eb53db3e15

You can also simply pre-edit your string in the built-in editor,
using Begin/End to highlight text, then TOOL NXT NXT Style
to apply styles to the selected text;
the User Guide actually almost explains this,
in Appendix L: Line editor commands,
except perhaps about selecting the text first.

[r->] [OFF]

goo...@cox.net

unread,
Jun 12, 2007, 10:20:37 AM6/12/07
to

I'm missing something. I take it "H\->S" means H<arrow>S.

I get "H<arrow>S314031H<arrow>S", with no reverse video.

What's the significance of 314031?

Sorry if I seem dense.

goo...@cox.net

unread,
Jun 12, 2007, 10:25:23 AM6/12/07
to
On Jun 10, 11:41 am, "John H Meyers" <jhmey...@nomail.invalid> wrote:
> On Sun, 10 Jun 2007 09:19:37 -0500:
>
> @ Applies inverse video to a text string
> \<< "314031" H\->S SWAP OVER + + \>> 'INVTXT' STO
>
> Articles about applying "styles"
> (Bold, Italic, Underline, Inverse)
> within HP49/50 series text strings:
>
> http://groups.google.com/group/comp.sys.hp48/msg/c9a3996e757abcbehttp://groups.google.com/group/comp.sys.hp48/browse_thread/thread/257...

>
> You can also simply pre-edit your string in the built-in editor,
> using Begin/End to highlight text, then TOOL NXT NXT Style
> to apply styles to the selected text;
> the User Guide actually almost explains this,
> in Appendix L: Line editor commands,
> except perhaps about selecting the text first.
>
> [r->] [OFF]

Very sorry if I seem dense, but
1) Where can I get a description of "H<arrow>S"?
2) @ does what? How?
3) The text will be generated within the program. Actually, it'll
come in on the serial port. Editing isn't an option.


goo...@cox.net

unread,
Jun 12, 2007, 10:55:10 AM6/12/07
to
On Jun 12, 10:25 am, goo...@cox.net wrote:
> On Jun 10, 11:41 am, "John H Meyers" <jhmey...@nomail.invalid> wrote:
>
>
>
>
>
> > On Sun, 10 Jun 2007 09:19:37 -0500:
>
> > @ Applies inverse video to a text string
> > \<< "314031" H\->S SWAP OVER + + \>> 'INVTXT' STO
>
> > Articles about applying "styles"
> > (Bold, Italic, Underline, Inverse)
> > within HP49/50 series text strings:
>
> >http://groups.google.com/group/comp.sys.hp48/msg/c9a3996e757abcbehttp......

>
> > You can also simply pre-edit your string in the built-in editor,
> > using Begin/End to highlight text, then TOOL NXT NXT Style
> > to apply styles to the selected text;
> > the User Guide actually almost explains this,
> > in Appendix L: Line editor commands,
> > except perhaps about selecting the text first.
>
> > [r->] [OFF]
>
> Very sorry if I seem dense, but
> 1) Where can I get a description of "H<arrow>S"?
> 2) @ does what? How?
> 3) The text will be generated within the program. Actually, it'll
> come in on the serial port. Editing isn't an option.- Hide quoted text -
>
> - Show quoted text -

I actually got the stuff to work, but not from the program. Very
strange. I had to key all of it in...

...yes, I attached 256. :-)

goo...@cox.net

unread,
Jun 12, 2007, 11:30:48 AM6/12/07
to
> ...yes, I attached 256. :-)- Hide quoted text -

>
> - Show quoted text -

Whoever researched this, it's really cool!!!!

I attached 256 from within the program and it worked.

314031 translates (Hex To String, with big-endian, little-endian
twist) to \019\004\019, which appears to be an escape character of
some sort, followed by the "4" which appears to switch on reverse
video. You sandwich Your Text between that sequence, and it's
reversed.

I think all I have to do is attach 256 one time, store the
"\019\004\019" character, and apply it before and after the string to
be displayed. Really cool!!! All I need now is the replacements for
\004 to give italics, underline, and bold!

-goog49

goo...@cox.net

unread,
Jun 12, 2007, 12:04:12 PM6/12/07
to
> -goog49- Hide quoted text -

>
> - Show quoted text -

Here we are:
1:bold (use large characters)
2:Italics
3: Underline
4: inverse

The codes would be
bold: 311031
italics: 312031
Underline: 313031
Inverse: 314031


John H Meyers

unread,
Jun 12, 2007, 1:04:29 PM6/12/07
to
Re previous instructions (to apply "inverse video" to a text string):

Do HOME 256 ATTACH, then:

\<< "314031" H\->S SWAP OVER + + \>> 'INVTXT' STO

On Tue, 12 Jun 2007 10:30:48 -0500:

> I attached 256 from within the program and it worked.

Library 256 ("development" library, built into ROM
but by default not automatically attached)
needs to be attached to *compile* the program properly
(when being edited or transferred in text form to calculator),
so that you need to do HOME 256 ATTACH *before*editing*;
once compiled, the library does not need to be attached
for the commands in 256 MENU to execute, but one
might as well leave it attached all the time,
which can be done via 256 ATTACH in your STARTUP program
(if you have one), or by leaving flag -86 set,
which will also be noticed at startup (warmstart).

The APPS menu will list the Development library,
if in fact it is currently attached; commands 256 MENU
will also always show the commands, but they will be compiled
as variable names (rather than as commands) if library 256
is not in fact attached when you press ENTER after editing,
and if so then the compiled program won't function as expected.

[r->] [OFF]

Message has been deleted

goo...@cox.net

unread,
Jun 12, 2007, 1:26:49 PM6/12/07
to

Absolutely wonderous!

Is the Development Library documented anywhere?


John H Meyers

unread,
Jun 12, 2007, 1:47:39 PM6/12/07
to
By the way, "styled" text is displayed with styles
using DISP or in strings shown on the stack,
but with TOOL > VIEW (which invokes the SCROLL command),
styles are not applied to the small text display,
although they are applied to the "GRAPH" display
(the latter uses the current "system" font).

Applying anything other than reverse video
to the small font doesn't seem very useful,
as it tends to render the tiny font unintelligible.

[r->] [OFF]

John H Meyers

unread,
Jun 12, 2007, 1:57:48 PM6/12/07
to
On Tue, 12 Jun 2007 12:26:49 -0500:

> Is the Development Library documented anywhere?

Chapter 6 of Ye Olde Advanced Users Reference (AUR)
http://www.hpcalc.org/details.php?id=6374
http://www.hpcalc.org/hp49/docs/misc/hp49gpaur.zip

HP provides it also, if you search long enough :)

Even if you find it at HP, the URL is too big
to fit within the margins of any page,
so it will probably be lost to history,
just like Fermat's lost proof :)

[r->] [OFF]

0 new messages