Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

replacing an HP16C with the HP50G

139 views
Skip to first unread message

Patrice

unread,
Nov 18, 2009, 7:52:24 PM11/18/09
to
Hello,

I would like to use my 50G to replace my 16C, but the standard functions do not
provide the ALU flags.
Do you know about a library which would fill the gap at UserRPL level ?

Thanks,
Patrice

PremiumBlend

unread,
Nov 18, 2009, 9:54:09 PM11/18/09
to

Hello Patrice,

I'm feeling bold tonight so I'll take a stab at
this. The HP 50G has 256 flags compared
to 6 on the HP 16C. I don't understand the
reference you are making to standard
functions. The ALU flags sound like system
flags, is that correct?

Regards,

Mark

Patrice

unread,
Nov 19, 2009, 1:24:49 AM11/19/09
to
Hello Mark,

On Wed, 18 Nov 2009 18:54:09 -0800 (PST), PremiumBlend <mnhol...@yahoo.com>
wrote:

Correct, since ALU means Arithmetic and Logic Unit, ALU flags are
reduced to Carry and Greater in the case of the 16C but is usually a greater
family, depending of the CPU, you can have a zero flag, odd/even flag, you can
even have a special carry flag when the CPU have a BCD mode (capricorn).

if the carry is set, 1 + 1 = 3.
Every arithmetic and Logic function is using and setting these flags and you can
test/set/clear them.
and you make decisions by testing theses flags.

>
>Regards,
Regards too,

Patrice

John H Meyers

unread,
Nov 19, 2009, 5:51:51 AM11/19/09
to
[16C flags]

Carry and Overflow?

Rotation through carry (up to 65-bit rotate)?

Three binary arithmetic modes?
(unsigned, 2's complement, 1's complement)?

Built in fixed <-> floating conversion?

"Register re-mapping" by changing word size?

Similators have been written for HP48, IIRC;
some free (and incomplete), one for purchase (may be complete).
These may also have been designed around the HP48 keyboard layout.

But the issue of whether there's a full 16C simulator to run on 49/50 series
may not be as important to an OP as what functionality the OP wants.

Basic binary operations (up to 64 bits),
logic, and conversion all exist,
identically in all HP48/49/50 series calculators,
but some particular functions of the 16C do not natively exist.

At least one result of the following search
shows a 16C similator for 49/50 series, by Craig Finseth,
which perhaps is worth looking into:
http://www.hpcalc.org/search.php?query=16c+OR+hp16c+OR+hp-16c

[r->] [OFF]

John H Meyers

unread,
Nov 19, 2009, 6:30:20 AM11/19/09
to
If you want to do 32-bit arithmetic (and rotations) with carry flag,
you can set HP48/49/50 word size to 33,
and voila -- there's your "carry" flag!
(go figure out "G" for yourself :)

Not quite so simple if word size is 64,
but in fact you can do it, if you just
use some more complex logic.

My simplistic signed (2's complement) replacements
for built in R\->B and B\->R commands,
which work with any word size > 1
but of course are limited to 12-digit "real" values:

\<< DUP 0. \>=
{ R\->B } { NEG R\->B NEG } IFTE \>> 'SR\->B' STO

\<< DUP 1. R\->B RR <
{ B\->R } { NEG B\->R NEG } IFTE \>> 'SB\->R' STO

Unsigned 64-bit
Integer <-> Binary conversions for 49/50 series,
which work as well with lists:

(must be in "Exact" mode before compiling next program)

\<< 64. STWS 0 MAX 18446744073709551615 MIN
DUP R\->B DUP B\->R R\->I ROT - I\->R 1E8
SWAP OVER ADD SWAP R\->B - - \>> 'I\->B' STO

\<< 64. STWS DUP B\->R R\->I DUP R\->B ROT -
1E8 SWAP OVER R\->B ADD B\->R SWAP - R\->I - \>> 'B\->I' STO

So now, you need only fill in the rest of your simulator :)

If there is some easy way to run ARM code in 50G (or close relatives),
perhaps that could be another approach to the entire project;
simulation within the "Saturn CPU" (itself emulated, but who cares,
it delivers the same answers anyway, only faster) is another route.

I didn't look to see how Craig Finseth approached it,
in his existing 16C emulators, nor whether his emulators
are operated solely by keypresses, or whether there are also
callable functions to make use of in your own programs.

[r->] [OFF]

0 new messages