Post Reply 
HP 35s Checksum explained
02-14-2015, 08:38 AM (This post was last modified: 02-14-2015 08:41 AM by Tugdual.)
Post: #26
RE: HP 35s Checksum explained
There is one more thing I wanted to share regarding memory management. I mentioned earlier in this thread that I observed the memory was rearranged in some circumstances and I found this was related to 2 possible events: removing on EQN or earsing all EQN.
Let's see what happens...

We will be using simple program blocks that I will call PA for
Code:
LBL A
1
Starting with PA, PB, we find the following checksums:
Case 0:
Code:

[MEMORY CLEAR]
LBL A ->7991
1
LBL B -> 4CCE
1
Okay now let's start from scratch and enter PA,PC,PB
Code:
LBL A -> 7991
1
LBL C -> 5BBF
1
LBL B -> 43DD
1
Now we remove PC and we see that PA and PB kept the same checksums.
Call EQN and then CLEAR 3 (EQN) or simply create a new EQN and delete it.
Check again the checksums
Code:
PA -> 7991
PB -> 4CCE
What happened is that the literal allocation for C left a gap in memory and as soon as you suppress one or all EQNs, the 35s is trying to fill gaps and change the program pointers.
Unfortunately this doesn't really help because we still depend on pointers.
For example if you do this:
  1. Enter PB
  2. Up, Up
  3. Enter PA

You end up with the same code as case 0 but the entry of literals was reversed and therefore pointers are swapped. Since pointer value is part of checksum calculation, you will end up with different checksums.
Code:
LBL A -> 7A1D
1
LBL B -> 4C42
1
Even if there was a way to sort all pointers, you would still depend on pointer values and therefore a separate LBL would still not have its own checksum code dependent.

The only correct way would be to ignore pointer and only include the literal string value (which is the case, it is included). As I said this is a major design flaw, I don't see a way to produce a memory independent checksum with this current design.
There is still one mystery, that is the actual calculation of checksum for the literals and EQN used in the code. I couldn't figure out exactly how this is calculated but I'm not really keen about spending time on this as it would be pretty useless.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
HP 35s Checksum explained - Tugdual - 02-08-2015, 05:43 PM
RE: HP 35s Checksum explained - Tugdual - 02-09-2015, 09:20 AM
RE: HP 35s Checksum explained - Gerald H - 02-09-2015, 12:57 PM
RE: HP 35s Checksum explained - Tugdual - 02-09-2015, 04:07 PM
RE: HP 35s Checksum explained - Tugdual - 02-09-2015, 04:42 PM
RE: HP 35s Checksum explained - Tugdual - 02-09-2015, 10:36 PM
RE: HP 35s Checksum explained - Tugdual - 02-10-2015, 01:53 PM
RE: HP 35s Checksum explained - Paul Dale - 02-14-2015, 08:44 AM
RE: HP 35s Checksum explained - Tugdual - 02-14-2015, 08:57 AM
RE: HP 35s Checksum explained - Tugdual - 02-11-2015, 06:55 PM
RE: HP 35s Checksum explained - Tugdual - 02-11-2015, 08:45 PM
RE: HP 35s Checksum explained - Tugdual - 02-14-2015 08:38 AM



User(s) browsing this thread: 1 Guest(s)