FC?C and FS?C usefulness
|
11-16-2021, 10:14 PM
Post: #1
|
|||
|
|||
FC?C and FS?C usefulness
A couple questions for the gurus:
1) what's the usefulness of the FC?C and FS?C apart from their obvious meaning? Is there some neat trick they can be used to accomplish? 2) why aren't there their counterparts FC?S and FS?S ? |
|||
11-16-2021, 10:37 PM
Post: #2
|
|||
|
|||
RE: FC?C and FS?C usefulness
These instructions let you test a flag and then clear it. The alternative would be code like:
Code: FS? 0 I.e. they save steps and simplify understanding the logic. The WP 34S introduced the extra flavours and more. Pauli |
|||
11-16-2021, 10:49 PM
Post: #3
|
|||
|
|||
RE: FC?C and FS?C usefulness
Thanks Pauli, I didn't realize that the instructions originate from RPN so I haven't specified that I was referring to RPL language.
I can see why they're useful in RPN context but their utility in RPL escapes me, since at user level the conditionals don't follow the skip-if-true logic. And then, why no FC?S and FS?S ? It's evident that whoever proposed these commands gave greater importance to flags being cleared than set... probably the reason is obvious to those versed in RPN, but I'm not one of the lot! |
|||
11-16-2021, 10:54 PM
Post: #4
|
|||
|
|||
RE: FC?C and FS?C usefulness
(11-16-2021 10:49 PM)JoJo1973 Wrote: Thanks Pauli, I didn't realize that the instructions originate from RPN so I haven't specified that I was referring to RPL language. Hmmm, now that I think about it maybe they're useful if you're testing an exception flag... |
|||
11-17-2021, 02:51 AM
(This post was last modified: 11-17-2021 03:03 AM by Sylvain Cote.)
Post: #5
|
|||
|
|||
RE: FC?C and FS?C usefulness
(11-16-2021 10:14 PM)JoJo1973 Wrote: 1) what's the usefulness of the FC?C and FS?C apart from their obvious meaning?These are great for error handling. FOCAL example: Code: ... (11-16-2021 10:14 PM)JoJo1973 Wrote: 2) why aren't there their counterparts FC?S and FS?S ?There was no more space left in the ROMs or in the functions tables I would assume. Edit: Doh! I should have know better, they had 256 entries in the functions table. Half of them are 1 byte functions and the rest are 2 and 3 bytes functions, labels and text. So they had to make a choice about what functions to keep and what functions to leave out. Most of the missing test functions can be simulated with the others. SYNTHETIX Card: SIDE #1 & SIDE #2 Missing from FOCAL: Code: X>=0? Code: X<0? Code: LBL "X>=0?" Sylvain |
|||
11-17-2021, 07:48 AM
Post: #6
|
|||
|
|||
RE: FC?C and FS?C usefulness
Imagine you want to toggle a flag.
Without these functions, that would look like Code: FS? 00 instead of simply Code: FC?C 00 I never missed the FC?S and FS?S counterparts - you just switch the flag meaning and you can use FC?C and FS?C.. (11-16-2021 10:37 PM)Paul Dale Wrote: The first CF 0 is not needed ;-) Cheers, Werner 41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE,DM15L,12C,16CE |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)