Post Reply 
[41/42/..] Micro-challenge: order X and Y by magnitude
03-09-2016, 12:28 PM
Post: #13
RE: [41/42/..] Micro-challenge: order X and Y by magnitude
(03-09-2016 10:34 AM)Werner Wrote:  I'm not in favour of having all functions predefined - where's the fun, then? I'd rather have the means to define and include my own programs/functions and to use them exactly like the built-in ones.
In that regard, the RTN+1 function of the 34 is a stroke of genius, you can make your own |x|>|y|? function - too bad you're restricted to three characters for the name, but oh well.

But we digress.
here's my 'order X and Y in order of magnitude':

Code:
 X>Y?
 X<>Y
 +/-
 X<=Y?
 +/-
 X<=Y?
 RTN
 +/-
 X<>Y
 RTN


Cheers, Werner

Yeah, I really wish the HPs had RTN+1. On the 41 and 42, you can at least fake it somewhat if you designate a flag as "execute the next instruction" and adhere to that calling convention, e.g. "XEQ ABSX<Y?, FS?C 09, RTN, do something else..." Would also love to have SKIP and BACK. Here's hoping that, with Free42 being GPL, the DM-42L firmware will be open source as well. Assuming SwissMicros doesn't negotiate a different licensing scheme with Thomas, I would assume it would have to be GPL as well.

Also, I haven't had a chance to try your program yet, but the odd number of CHS instructions being run would leave one of the values inverted on the stack, wouldn't it?
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: [41/42/..] Micro-challenge: order X and Y by magnitude - Dave Britten - 03-09-2016 12:28 PM



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