PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Code Checksum

Hi,

Is it possible to run a checksum on a small piece of code. I've tried doing this, but the code doesn't seem to being read.

The function in the debugger is at location 0x22014298, but returning the address of the function returns 0x14298.

I believe this is to do with memory paging? or I could be wrong.

Can anyone shed any light on how to do this, or refer me to any articles on how ppc memory works.

Thanks

Glen.
Just would like to clear up the disccussion on the other page a little.

The arm processor has a register (N-bits check the spec) containing the current process id. When accessing memory (both code and data) if the top N bits of the address are zero the process id is or'd to it. Thus your process id is represented by 0x22000000. So if you pass 0x14298 as the address being accessed you are really accessing:
0x22000000 | 0x14298 = 0x22014298

So when accessing 0x22014298 and 0x14298 (as long as you are in the same process), they both refer to the same virtual address, by virtue of the ARM memory management system.

This has nothing to do with windows ce, it's all about the architecture and how the strong-arm/xscale partitions its address space.