HP Forums
Question about WP-34S firmware - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: Question about WP-34S firmware (/thread-229938.html)



Question about WP-34S firmware - Nigel J Dowrick - 08-25-2012

I've been reading through the source code for the WP-34S, playing around and making (mostly minor) changes. A question has occurred to me: where do the variables in the C code - things like i, j, n, s, v, status, etc. - actually live? There doesn't seem to be space for them in the calculator RAM, but if they're stored in flash how will the memory cope with the constant changing of these variables every time the program runs?

I'm sorry if this question reveals my ignorance, but I'd still love to know the answer! Thank you.

Nigel (UK)


Re: Question about WP-34S firmware - Paul Dale - 08-25-2012

The C local variables live in volatile RAM on the stack.


- Pauli


Re: Question about WP-34S firmware - Nigel J Dowrick - 08-25-2012

Thank you! I've learned something. Does the WP-34S code go close to the limit? I've looked at the compiler output logs but I'm not quite sure how to use them to answer this question. I can see a line that says

.volatileram    0x002001b0      0x210
Is the 0x210 the number of bytes used by static variables?

Nigel (UK)


Re: Question about WP-34S firmware - Walter B - 08-25-2012

The WP 34S code goes very close to the limit d:-)


Re: Question about WP-34S firmware - Paul Dale - 08-25-2012

Not entirely. We have a few in non-volatile RAM as well.

The 34S firmware does go very close to the limit. We almost certainly overwrite some of these volatile static variables during some operations -- e.g. the matrix code uses a lot of stack space and I'd be very surprised if it didn't. The statistical code used to be close to overflowing volatile RAM too but that will have changed after the conversion to xrom. This isn't a problem, the state in volatile RAM is mostly for the keyboard engine and xrom code neither of which are in operation during these times

BTW: some of the keyboard engine state gets copied into LCD buffer RAM so that volatile RAM can be powered down between keystrokes.


- Pauli