HP Forums
Is there a RPN operation that does nothing? (NOP) - Printable Version

+- HP Forums (https://www.hpmuseum.org/forum)
+-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html)
+--- Forum: General Forum (/forum-4.html)
+--- Thread: Is there a RPN operation that does nothing? (NOP) (/thread-9850.html)

Pages: 1 2


RE: Is there a RPN operation that does nothing? (NOP) - Krauts In Space - 01-08-2018 01:46 PM

Assumed that you don't want you calculator going off ( Wink ), why not the ON-command? (HP41&42 - dunno what HPs provide this command too)
STO ST X takes at least 2 or even 3 byte (I'm not so deep into this), whilst the ON-command might only take 1 byte and it completey leaves the stack alone, which prevents any side effects.
Just remember to turn your calc off :>


RE: Is there a RPN operation that does nothing? (NOP) - grsbanks - 01-08-2018 04:09 PM

(01-08-2018 01:32 PM)Thomas Okken Wrote:  is inelegant; how about

1
STO+ 00

which has the virtue of making it absolutely clear what the programmer intends.

But it's even less of a NOP than any of the other solutions put forward because:
  • The contents of the T register is lost
  • The value 1 is injected into X
With the other options, the stack is left intact.


RE: Is there a RPN operation that does nothing? (NOP) - Krauts In Space - 01-08-2018 04:31 PM

You could write a "LBL 'NOP' RTN" with a "GSB 'NOP'".
This answers any questions on your code, even in decades. But I wouldn't bet on any speed records with that. Wink


RE: Is there a RPN operation that does nothing? (NOP) - Thomas Okken - 01-08-2018 05:52 PM

(01-08-2018 04:09 PM)grsbanks Wrote:  
(01-08-2018 01:32 PM)Thomas Okken Wrote:  is inelegant; how about

1
STO+ 00

which has the virtue of making it absolutely clear what the programmer intends.

But it's even less of a NOP than any of the other solutions put forward because:
  • The contents of the T register is lost
  • The value 1 is injected into X
With the other options, the stack is left intact.

True. Clarity or efficiency -- can't always have both.


RE: Is there a RPN operation that does nothing? (NOP) - Dieter - 01-09-2018 06:56 PM

(01-08-2018 01:46 PM)Krauts In Space Wrote:  Assumed that you don't want you calculator going off ( Wink ), why not the ON-command? (HP41&42 - dunno what HPs provide this command too)

On the HP-41 ON is not programmable.

Dieter


RE: Is there a RPN operation that does nothing? (NOP) - Krauts In Space - 01-10-2018 07:44 AM

(01-09-2018 06:56 PM)Dieter Wrote:  
(01-08-2018 01:46 PM)Krauts In Space Wrote:  Assumed that you don't want you calculator going off ( Wink ), why not the ON-command? (HP41&42 - dunno what HPs provide this command too)

On the HP-41 ON is not programmable.

Dieter

oops! :/
Thanks


RE: Is there a RPN operation that does nothing? (NOP) - Garth Wilson - 01-10-2018 08:33 AM

Quote:On the HP-41 ON is not programmable.

With the ZENROM however, you can do 44 TOGF (toggle flag 44, the continuous-ON flag). That's one of the things I have my 41cx do every time I turn it on.

I have a program, TOFF, that sets flag 11 (the flag to run automatically upon turn-on) and gives some fast synthetic beeps and does OFF, assigned to a key. I don't use the ON key to turn it off. The auto-run program sets the continuous-ON flag, checks for upcoming alarms to display how long before they're due, checks my DAYTMR file to see if it's supposed to remind me of anything today, and displays the current time and date. It takes a couple of seconds.

Again though, LBL 00 through LBL 14 are all one byte each, and probably among the fastest instructions. Why wouldn't you use those for NOP.