Re: A little HP-15C challenge Message #10 Posted by Ex-PPC member on 17 Jan 2003, 11:26 a.m., in response to message #9 by OJM
Congratulations !! :-)
This is the the *exact* answer to my challenge.
I've always found it somewhat curious that such infrequently
used instructions as STO #RANDOM and RCL #RANDOM are
*one byte* in length, instead of two-byte. I guess this
is because all actual two-byte instructions in the set
are of the 'prefix' kind, i.e: STO+, STO-, CF n, SF n,
INTEGRATE a, SOLVE b, etc., so there were no candidates
to use these two remaining one-byte codes.
By the way, STO #RANDOM and RCL #RANDOM do not
divide by 10 numbers in the range [0..1), they come out
unaltered. So, this internal register can be perfectly
used to store constants in that range, thus saving a
valuable register (numbered or allocated from the pool)
or 7 program bytes, at no cost ! This works fine as long
as no random numbers are needed in the routine. I've
used this technique in some of my programs for the 15C,
and sometimes it was the only way to
fit the program in the available memory :-)
Your correct entry is the first one which meets all four
requirements, while minimizing the byte count, so I will be very
pleased to send you the 'prize' via e-mail, if only I had
some e-mail address of yours ... :-)
|