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

Casio-like ENG-> programs for HP49

210 views
Skip to first unread message

John H Meyers

unread,
Mar 16, 2001, 6:24:57 AM3/16/01
to
If you remember these from the HP48,
then you have been around here too long
(and so have I :)

Casio's concept for ENG-> (at least for older models)
is not only that exponents should (only temporarily)
be displayed as a power of 10^3,
but also that repeatedly pressing ENG-> keeps adjusting
the mantissa and exponent together, so that, for example,
you can "convert" ohms to kilohms, megohms, etc.,
just by repeatedly pressing the key.

Here, in response to a request,
are a Casio-like ENG-> function (for pure real numbers),
and a U-> function (similar, but for HP49 Unit objects),
resurrected from old postings of 3-4 years ago,
and converted for HP49:


%%HP: T(3)F(.); @ HP49 ONLY! - downloadable file (use Kermit)

@ Programs ENG-> and ENG<- accept REAL numbers (no units),
@ changing the exponent by 3 each time (displaying as a string);
@ use NORM to change string back to the original real number:

\<< { * - } ENGX \>> 'ENG\->' STO

\<< { / + } ENGX \>> 'ENG\<-' STO

\<< STR\-> \>> 'NORM' STO

@ Subroutine (not for direct use):
\<< LIST\-> DROP RCLF \-> a b f \<<
{ { 514. DOERR } { 3. EXP ENG \->STR { DROP DROP } ENGX }
{ DUP "E" POS DUP2 1. + OVER SIZE SUB UNROT 1. - 1. SWAP SUB
DUP STR\-> 3. ALOG a EVAL STD \->STR DUP "E" POS { DROP SWAP }
{ SWAP DROP SWAP STR\-> 3. b EVAL \->STR
1. OVER SIZE 1. - SUB } IFTE "E" SWAP + + } } { 0. 2. }
3. PICK TYPE POS 1. + GET EVAL f STOF \>> \>> 'ENGX' STO


@ Programs U-> and U<- accept UNIT objects only,
@ transforming them to other equivalents
@ using different unit prefixes, e.g. 123.4_m = .1234_km

\<< 0. UU \>> 'U\->' STO

\<< 1. UU \>> 'U\<-' STO

@ Subroutine (not for direct use):
\<< \<<
"yzafpn\Gmm.kMGTPEZYYc.d.Dkhk"
"YZEPTGMk.m\Gmnpfazyyh.D.dmcm"
IFTE DUP ROT POS 1. + DUP SUB \>> \-> d p
\<< DUP TYPE 13. \=/ { 514. DOERR } IFT DUP
:INNERCOMP: #54AFh SYSEVAL :{}N: #5459h SYSEVAL
DUP 2. GET "1" SAME 3. 2. IFTE DUP2 GET
IF DUP TYPE 24. == THEN :CHR>$: #37AA5h SYSEVAL d p EVAL NUM
IF DUP 46. \=/ THEN :COERCE: #262F1h SYSEVAL
:#>CHR: #5A75h SYSEVAL 1. \->LIST REPL
ELSE DROP DUP2 1. SWAP 1. - SUB UNROT DUP2 1. + GET
UNROT 3. + OVER SIZE SUB + + END
ELSE UNROT DUP2 1. SWAP 1. - SUB UNROT 1. + OVER SIZE SUB
ROT "." d p EVAL NUM :COERCE: #262F1h SYSEVAL
:#>CHR: #5A75h SYSEVAL SWAP :umP: #2D76Dh SYSEVAL 3. \->LIST
SWAP + + END :INNERCOMP: #54AFh SYSEVAL
:EXTN: #5481h SYSEVAL CONVERT \>> \>> 'UU' STO

{ ENG\-> ENG\<- NORM ENGX U\-> U\<- UU } ORDER

@ End of HP49 downloadable file (EVALuate it to install programs)


These were hastily converted from original HP48 programs,
so please backup your memory, in case they go awry in HP49.

Tags like :COERCE: etc. are optional, indicating names
of supported ROM entry points.

The only changes from HP48 were converting Syseval addresses in
'UU' to HP49 addresses via SYSTR, adjusting ENGX by inserting
1. OVER SIZE 1. - SUB to hide an HP49 spurious decimal point,
and replacing ROT ROT by UNROT many times.

The SYSEVAL translator for 48 <-> 49 is here:
http://hpcalc.org/hp49/programming/misc/systrans.zip

HP48 versions of the functions in this post
(includes more extensive documentation):
http://hpcalc.org/hp48/math/misc/casioeng.zip
http://hpcalc.org/hp48/math/misc/unitscal.zip

Thanks to Cristian Gross for requesting the exhumation :)

-----------------------------------------------------------
With best wishes from: John H Meyers <jhme...@mum.edu>


-----= Posted via Newsfeeds.Com, Uncensored Usenet News =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
-----== Over 80,000 Newsgroups - 16 Different Servers! =-----

0 new messages