Trying to emulate some functions.
09-01-2019, 12:06 PM
Post: #7
 Sylvain Cote Senior Member Posts: 1,765 Joined: Dec 2013
RE: Trying to emulate some functions.
(08-31-2019 08:05 PM)rprosperi Wrote:  No, the issue is the CX does not have the X>=0? function built-in. So the workaround he found in the book (which book Gérard?) does indeed work as a substitute since the flag test always fails and thus skips the immediately following statement.

Programmer HP-41
Philippe Descamps et Jean-Jacques Dhénin
1982, ISBN: 2-86595-056-5, Édition du P.S.I.

P.30, Chapitre II, Tests et Drapeaux

F: L'algorithme de négation utilise le drapeau 30 de l'instruction CATALOG qui est toujours faux pour effectuer la logique inverse:
E: The NOT algorithm uses catalog flag 30 which is always false to do it's reverse logic:

Code:
... TEST?       // test inversé  // reverse test  FS? 30      // toujours faux // always false INSTR. ...

Example: X>=0?
Code:
... X<0?        // test inversé  // reverse test  FS? 30      // toujours faux // always false TONE 5      // instruction à exécuter pour X>=0? // instruction to execute for X>=0? ...

X with 0 tests
Code:
X=0?        // disponible // available X#0?        // disponible // available X<0?        // disponible // available X>0?        // disponible // available X<=0?       // disponible // available X>=0?       // X<0?  FS? 30

X with Y tests
Code:
X=Y?        // disponible // available X#Y?        // disponible // available X<Y?        // disponible // available X>Y?        // disponible // available X<=Y?       // disponible // available X>=Y?       // X<Y?  FS? 30

F: Le livre introduit aussi la logique des tests combinatoires OU et ET
E: The book also covers boolean logic OR and AND

Sylvain
 « Next Oldest | Next Newest »

 Messages In This Thread Trying to emulate some functions. - ggauny@live.fr - 08-31-2019, 11:27 AM RE: Trying to emulate some functions. - Gerson W. Barbosa - 08-31-2019, 12:49 PM RE: Trying to emulate some functions. - ggauny@live.fr - 08-31-2019, 06:39 PM RE: Trying to emulate some functions. - grsbanks - 08-31-2019, 07:19 PM RE: Trying to emulate some functions. - rprosperi - 08-31-2019, 08:05 PM RE: Trying to emulate some functions. - grsbanks - 09-01-2019, 05:22 AM RE: Trying to emulate some functions. - Sylvain Cote - 09-01-2019 12:06 PM RE: Trying to emulate some functions. - ggauny@live.fr - 09-01-2019, 04:02 PM RE: Trying to emulate some functions. - ggauny@live.fr - 09-01-2019, 06:40 PM

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