Thread Closed 
HP-25/SR-56 Identical Conditionals
10-14-2021, 04:49 PM
Post: #13
RE: HP-25/SR-56 Identical Conditionals
(10-14-2021 04:18 PM)Dave Britten Wrote:  
(10-14-2021 12:38 PM)Valentin Albillo Wrote:  Then post a non-contrived example which shows its usefulness and cleanness, please.

V.

I don't have a specific example on the tip of my tongue, but the general pattern usually ends up being something like this on an HP:

LBL 1 //loop start
...do some things...
DSZ 4 //decrement counter
GTO 0
GTO 9 //exit loop
LBL 0
...do some more things...
GTO 1 //loop end
LBL 9
...post-loop instructions...

i.e. when you need to decrement a counter and break out of the loop when the counter reaches its end, but you need to do this in the middle of the loop body. On a TI you can replace the exit test with something like INV 2nd DSZ 04 9' to break out of the loop when the counter hits 0. Slightly more elegant, but it's a small victory with how much less elegant a lot of programming constructs are on the TI-59/58. Wink

Excuse me but in your example you use "DSZ 4". At face value, I read this as "Decrement and Skip if Zero (Register 4)".

But I asked for an example of "DSNZ", i.e., "Decrement and Skip if Not Zero" ...

What gives ? Can you supply a non-contrived example using DSNZ, as asked, to see its usefulness and cleanness, please ?

Regards.
V.

  
All My Articles & other Materials here:  Valentin Albillo's HP Collection
 
Visit this user's website Find all posts by this user
Thread Closed 


Messages In This Thread
RE: HP-25/SR-56 Identical Conditionals - Valentin Albillo - 10-14-2021 04:49 PM



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