From: John H Meyers on
On Sat, 12 Dec 2009 08:49:11 -0600, Janek Kozicki wrote:

> I see that libraries have a CRC sum.
> How can I invoke a CRC check on them?

By not getting "Invalid Card Data" when turning on the calc?

Or: Any_lib DUP NEWOB LBCRC SAME @ should be 1 (true)

The following LBCRC comes from the HP48 "Hack" library,
applies both to libraries and "Backup" objects,
and inserts the correct CRC into the end of the object:

::
CK1&Dispatch
# 8F
CODE
LBL1 GOSBVL =SAVPTR
C=DAT1 A
D0=C
D0=D0+ 5
A=DAT0 A
A=A-CON A,4
GOSBVL =DoCRC
DAT0=A 4
GOVLNG =GETPTRLOOP
ENDCODE
#9F
CODE
GOTO LBL1
ENDCODE
;

Postings referenced below include an initial CKREF
(not needed by the above UserRPL after NEWOB)

Curiously, the correct result of Any_lib BYTES DROP
is a function solely of the length of the library -- i.e.
any two libraries having the same length must have the same result!

Different (but same length) versions of a library
can thus not be distinguished by this checksum alone,
but file corruption is still detectable with as high a probability
as is normally afforded by the checksum.

It should be possible to compute the correct BYTES checksum
for any library, based solely on its length,
and to compare that to the actual result of BYTES,
which would be another way to verify the "internal" checksum.


Related threads and postings:

Checksum of libraries
http://groups.google.com/group/comp.sys.hp48/browse_thread/thread/505bcdcad3c808e4

http://groups.google.com/group/comp.sys.hp48/msg/10e368e0f057ce03

Computing a CRC from a hex string
http://groups.google.com/group/comp.sys.hp48/msg/e7b1cf4971798283

AnyObject BYTES DROP
gives the same result as
AnyObject \->H \<< program from last post above \>>

[r->] [OFF]
From: Janek Kozicki on
Thanks for your detailed reply, I'll take some time to understand
it :) I recall that I was writing programs like that 10 years ago, so
a bit of "remind myself" action and with enough time I should be back
on track.

The On-D On-K does nothing, so I assumed that you mean K without ON.
The On-D + K test worked like this: it displays a random pattern on
LCD, then shows text "RAM2 90000". And apparently it ends like that,
because I can invoke another test after that.

best regards
Janek Kozicki
From: John H Meyers on
On Sun, 13 Dec 2009 05:46:36 -0600, Janek Kozicki wrote:

> The On-D + K test [suggested by "Han"] worked like this:
> it displays a random pattern on LCD, then shows text "RAM2 90000".

Unfortunately, that's a "failure" code.

It should say RAM2 OK [and size, e.g. 128K]

[r->] [OFF]
From: Janek Kozicki on
On Dec 13, 7:28 pm, "John H Meyers" <jhmey...(a)nomail.invalid> wrote:
> On Sun, 13 Dec 2009 05:46:36 -0600, Janek Kozicki wrote:
> > The On-D + K test [suggested by "Han"] worked like this:
> > it displays a random pattern on LCD, then shows text "RAM2 90000".
>
> Unfortunately, that's a "failure" code.
>
> It should say RAM2 OK [and size, e.g. 128K]
>
> [r->] [OFF]

Oops :/ I recall now that I've seen exactly the same message 10 years
ago, when I asked a friend to solder another 128 kB chip to the PCB.
But then I didn't know what it meant. And also about that time I
stopped using my HP48, because the keyboard got damaged badly in the
process.

Currently I have port 1 (with broken memory) loaded full of apps, and
seems to work. However if I get some undefined behaviour (so far I had
a total lockup, once in EQ Writer, had to "Try to recover memory" to
un-lock the calc) - I'll know that it's probably due to faulty 2nd
128Kb....

I'm not getting an "invalid card data" error upon power-on, but if I
get this error, I'll know why I got it.

I can think about replacing that 128 Kb chip... but I will see first
how badly it affects me, and how often I get some undefined behaviour.

Does that 90000 mean that error starts around 90th kB out of 129 kB ?

best regards
Janek Kozicki
From: John H Meyers on
On Wed, 16 Dec 2009 16:59:29 -0600, Janek Kozicki wrote:

>> On-D + K test displays a random pattern on LCD,
>> then shows text "RAM2 90000" [error]

> Does that 90000 mean that error starts around 90th kB out of 129 kB ?

It may be the IQ of the HP48, approximately 15 times that of Holly,
the ship's computer aboard Red Dwarf:

http://www.tvacres.com/computers_star_holly.htm
http://en.wikipedia.org/wiki/Holly_(Red_Dwarf)
http://www.tv.com/red-dwarf/queeg/episode/10955/summary.html
http://www.highbeam.com/doc/1G1-198521580.html
http://www.sb410.net/red_dwarf_episodes.htm
http://www.bubblegun.com/features/probelovett.html
http://www.wharf.co.uk/2009/05/norman-lovett-takes-red-dwarfs.html

The over-rated HAL9000 computer was in fact only 1/10 as smart as the HP48,
and much less friendly :)

http://www.fun-facts.com/item/83451

..