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

"Safe" string compiler for all HP48/49/50

100 views
Skip to first unread message

John H Meyers

unread,
May 26, 2007, 4:04:04 PM5/26/07
to
STRC - Alternative to STR\-> for all HP48/49/50

STR\-> (DOSTR>) performs both compiling and *evaluating*
the result of compilation, so here we provide
a "safe" version, for compile-only needs,
such as after an INPUT command:

"string" -> compiled_object
(always one object returned, never evaluated)

Cases which differ from STR\->
"PURGE" -> PURGE (non-executed command)
"X" -> 'X' (always unevaluated)

Multiple-object (or no object) cases:
"ob1 ob2" -> program containing unevaluated objects
"" -> empty program (invisible on stack)

If multiple objects are either expected or to be rejected,
use "{" SWAP + "}" + STRC instead, which results in a list,
containing as many objects as the string represents;
this can be done even with STR\->, although STRC provides
a more absolute safety against evaluating objects.

STRC is similar to the protection originally provided against
executing anything transferred from a computer to a calculator
using Kermit; Conn4x may not afford this same protection,
and may execute transferred commands,
which may also result in transferred ascii files
interfering with the transfer software itself, resulting in
either wrong stored info or errors within transfer software.

The downloadable file below contains comments preceded by "@"

Both source and binary are provided.

You may use the entire file, which tests for calc series,
or you may select portions for your specific model,
and/or for source vs. binary installation.

One should always make a memory backup
before installing "system" software.

%%HP: T(3); @ Header for ascii file transfer only

@ SysRPL source for STRC
"
:: CK1NOLASTWD CK&DISPATCH1 str
:: palparse NOTcase2drop SYNTAXERR DUPTYPECOL? NOT?SEMI
{ xSILENT' x' } OVER LENCOMP #1- NTHELCOMP NOT?SEMI
OVER CARCOMP jEQcase EVAL ; ; ( \<< \>> or 'X' )
"

@ To compile with on-board MASD+Extable or Jazz:
RCLF SIZE 3 >
{ 64 CHR + -92 SF ASM2 } { ASS } IFTE 'STRC' STO

@ Binary installer (no assembly required :)
RCLF SIZE 3 > { @ 49/50 series
"D9D20792628236252133D9D2026FE267"
"943431622715329A4347A2073883FE98" +
"3B21302C230B7650E0E306B65029A432" +
"C23098050A3D63E8F60B2130B2130" +
64 STWS DUP BYTES DROP #13Bh ==
#100001h * LIBEVAL
} { 10 CHR @ need ASC\-> on original 48[S/G]
"D9D202BA812BF81D0040D9D204A83201"
"91668F017E126C2A1647A20C94324563" + OVER +
"2B21302C230B7650E0E306B650C2A162" +
"C230980506DC36E8F60B2130B2130F49" + SWAP +
"D" + ASC\-> } IFTE 'STRC' STO

@ [End]

John H Meyers

unread,
May 26, 2007, 6:40:52 PM5/26/07
to
On Sat, 26 May 2007 15:04:04 -0500:

> STRC - Alternative to STR\-> for all HP48/49/50

Original post:
http://groups.google.com/group/comp.sys.hp48/msg/6e8ba656497402c

If you store the following text (with "boundary" lines
as the first and last lines) in a file named "strc4849.mim"
and open that using WinZip, you will obtain binary files
named "strc48" and "strc49" -- ready for transfer to calculators
of whichever series you have ( 48[S/G] vs. 49/50/etc. )
either via cable or directly on SD card.

If you are copying from a "Quoted-Printable" encoded version
of this post, first replace all "Equal3D" by "Equal"

-----boundary-----
Content-Type: application/octet-stream; name="strc4849.zip"
Content-Transfer-Encoding: base64

UEsDBAoAAgAAAFZ/ujYrcT6YRwAAAEcAAAAGAAAAc3RyYzQ4SFBIUDQ4LVedLSCrGLKP0QAEnS1A
iiMQGWb4EOchxqJhdCrASSNUNrISA8IysGcFDj5gawUsGiYsA4lQYM1jjm+wEgMrMQBQSwMECgAC
AAAAZH+6Njv7A1ZHAAAARwAAAAYAAABzdHJjNDlIUEhQNDktV50tcCkmKGNSEjOdLSD2LnZJQxMm
clEjqTR0KnCDOO+JsxIDwjKwZwUOPmBrBZJKIywDiVCg0zaOb7ASAysxAFBLAQIUAAoAAgAAAFZ/
ujYrcT6YRwAAAEcAAAAGAAAAAAAAAAAAIQAAAAAAAABzdHJjNDhQSwECFAAKAAIAAABkf7o2O/sD
VkcAAABHAAAABgAAAAAAAAAAACEAAABrAAAAc3RyYzQ5UEsFBgAAAAACAAIAaAAAANYAAAAAAA==
-----boundary-----

John H Meyers

unread,
May 26, 2007, 7:03:23 PM5/26/07
to
On Sat, 26 May 2007 17:40:52 -0500:

> If you are copying from a "Quoted-Printable" encoded version
> of this post, first replace all "Equal3D" by "Equal"

It turns out that you also need to re-join "split" lines,
by removing the "Equal[newline]" which may get inserted;
i.e. split lines look like this:

StartOfLine................................Equal
.....EndOfLine

Below is a small program which I actually use
on my (emulated) calculator to do this --
just copy original text, paste on calculator stack,
run program, copy "fixed" text from calculator stack.

%%HP: T(3); @ Header for file transfer by cable
@ Quoted-Printable encoding corrector for email or postings
@ (49/50 series only)
\<< 61 CHR \-> e \<< \->STR DUP e "3D" + POS
{ 13 CHR "" SREPL DROP e 10 CHR + "" SREPL DROP
e "3D" + e SREPL DROP } IFT \>> \>> 'KQP' STO

@ [End]

0 new messages