Post Reply 
Is there a RPN operation that does nothing? (NOP)
01-08-2018, 01:46 PM (This post was last modified: 01-08-2018 03:16 PM by Krauts In Space.)
Post: #21
RE: Is there a RPN operation that does nothing? (NOP)
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 :>

HP: 20S 25C 32S 33E 33s 35s 41CV 42S 39GS 48SX 71B
Casio: FX702P
Swissmicros: DM15L
Need Forth71B
Find all posts by this user
Quote this message in a reply
01-08-2018, 04:09 PM
Post: #22
RE: Is there a RPN operation that does nothing? (NOP)
(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.
Find all posts by this user
Quote this message in a reply
01-08-2018, 04:31 PM (This post was last modified: 01-08-2018 04:32 PM by Krauts In Space.)
Post: #23
RE: Is there a RPN operation that does nothing? (NOP)
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

HP: 20S 25C 32S 33E 33s 35s 41CV 42S 39GS 48SX 71B
Casio: FX702P
Swissmicros: DM15L
Need Forth71B
Find all posts by this user
Quote this message in a reply
01-08-2018, 05:52 PM
Post: #24
RE: Is there a RPN operation that does nothing? (NOP)
(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.
Find all posts by this user
Quote this message in a reply
01-09-2018, 06:56 PM
Post: #25
RE: Is there a RPN operation that does nothing? (NOP)
(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
Find all posts by this user
Quote this message in a reply
01-10-2018, 07:44 AM
Post: #26
RE: Is there a RPN operation that does nothing? (NOP)
(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

HP: 20S 25C 32S 33E 33s 35s 41CV 42S 39GS 48SX 71B
Casio: FX702P
Swissmicros: DM15L
Need Forth71B
Find all posts by this user
Quote this message in a reply
01-10-2018, 08:33 AM (This post was last modified: 01-10-2018 08:36 AM by Garth Wilson.)
Post: #27
RE: Is there a RPN operation that does nothing? (NOP)
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.

http://WilsonMinesCo.com (Lots of HP-41 links at the bottom of the links page, http://wilsonminesco.com/links.html )
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)