WP-34s memory questions



#9

I've finally started spending a bit more quality time with my 34s, trying to learn the ins and outs of this incredibly neat little device. My first step was reading more thoroughly through the documentation that I had only scanned when I first got the calculator.

However, I am not having luck finding the answers to a couple of basic questions, and am a bit confused.

1) The manual mentions that the hardware has 6kB of RAM, of which 4kB are volatile. However some of the memory information in the document seems a little vague on how much real memory (in bytes) is actually being used. The doc generally talks about "words" but does not seem to explicitly specify the word size in bytes. From the various facts presented, it seems to me that the underlying physical word size is two bytes and that only the 2kb of non-volatile RAM are usable by the user of the calculator. Is that correct? Is the 4kB of volatile RAM usable in any way from a user program?

2) The document seems to use "word" to mean two different things. In one case it uses it to discuss the physical memory used by registers and SRS entries, and in the other case it is used to refer to the interpretation of the contents of registers in integer mode. I read through various spots in the documentation several times and a still not clear on these questions: How many bytes does a registers use? Does the memory usage of a register change dependent on the word size in integer modes? How many bytes does a SRS use up on a simple function call?

Edited: 20 Feb 2013, 8:07 p.m.


#10

Quote:
1) The manual mentions that the hardware has 6kB of RAM, of which 4kB are volatile. However some of the memory information in the document seems a little vague on how much real memory (in bytes) is actually being used. The doc generally talks about "words" but does not seem to explicitly specify the word size in bytes. From the various facts presented, it seems to me that the underlying physical word size is two bytes and that only the 2kb of non-volatile RAM are usable by the user of the calculator. Is that correct? Is the 4kB of volatile RAM usable in any way from a user program?

User RAM is most of the 2kb region. The other 4kb doesn't survive the sleep between keystrokes and cannot be directly used by a user program. It is used for internal functions e.g. matrix operations use almost all of this memory for internal stuff.

There is flash library space you can use for programs but not registers. This space is quite large. About 11kb without crystal and IR support, quite a bit less with the latter.

You are correct, memory is divided into two byte words. Each program step consumes one such word.


Quote:
2) The document seems to use "word" to mean two different things. In one case it uses it to discuss the physical memory used by registers and SRS entries, and in the other case it is used to refer to the interpretation of the contents of registers in integer mode. I read through various spots in the documentation several times and a still not clear on these questions: How many bytes does a registers use? Does the memory usage of a register change dependent on the word size in integer modes? How many bytes does a SRS use up on a simple function call?

Registers are eight bytes in integer and single precision modes and sixteen bytes in double precision mode.

Register size doesn't change based on integer word size. They are always eight bytes there.


What is an SRS ?

A user code function call consumes two bytes from memory. Allocating local variables uses a few more than the registers require.


Pauli


#11

Thanks for the clarification!

If my program wants to keep an array of 16 bit integers, and I want to pack multiple values into each register in order to conserve memory, is there any support built in for that, or do I just have to write the code myself?

As for SRS (Subroutine Return Stack), I was just attempting to use the terminology in the manual.


#12

There are no bit field or packing commands in the device. However, there is a very powerful suite of bit shifting and mask generation commands, all of which accept indirect arguments. I'd expect it to be straightforward to implement.

- Pauli

Edited: 21 Feb 2013, 7:58 p.m.

#13

Quote:
1) The manual mentions that the hardware has 6kB of RAM, of which 4kB are volatile. However some of the memory information in the document seems a little vague on how much real memory (in bytes) is actually being used. The doc generally talks about "words" but does not seem to explicitly specify the word size in bytes. From the various facts presented, it seems to me that the underlying physical word size is two bytes and that only the 2kb of non-volatile RAM are usable by the user of the calculator. Is that correct? Is the 4kB of volatile RAM usable in any way from a user program?

2) The document seems to use "word" to mean two different things. In one case it uses it to discuss the physical memory used by registers and SRS entries, and in the other case it is used to refer to the interpretation of the contents of registers in integer mode. I read through various spots in the documentation several times and a still not clear on these questions: How many bytes does a registers use? Does the memory usage of a register change dependent on the word size in integer modes? How many bytes does a SRS use up on a simple function call?


Thanks for your questions. Indeed, there are words and
words in the manual. The first kind is used in integer modes (e.g. word size). The second kind is used as a unit for memory size, with 1 word = 2 bytes. For your questions under point 2) please turn to App. B - I will check that in the meantime as well.

d:-)


#14

Please check p. 157 of the manual for register size etc. Some answers were also given by Pauli already. I will try to make it clearer in the printed edition.

d:-)

Edited: 21 Feb 2013, 5:18 a.m.


#15

I did reread it and I agree that all the answers are there.

Once I have the information and I reread it, it all makes sense; the first time through, however, it felt like I was having to deduce some of the information rather than having it spelled out for me.

If I can make a suggestion: having the chart on page 154 have more detail would have been a huge help and might be the only change necessary. If it identified individual words, and then the groups of words that make up each entity that in turn make up each section, that would summarize all the info. Furthermore, if it picked a concrete example (number of global registers) and actually put word/byte numbers in, that would make it crystal clear as well.


#16

Of course you can make a suggestion :-) The challenge is the WP 34S being so flexible ... :-/

With respect to the diagram on p. 154: it shows 2kB to scale. Sections 1 and 3 are fixed size (88B and 140B, respectively, as stated there). The remaining bytes go to sections 2 and 4 as described on p. 157 (incl. some concrete numbers). Since things may change with double precision (see App. H) I cannot state many eternal sentences in App. B but you get the idea - that's what I hope at least.

d:-)


Possibly Related Threads...
Thread Author Replies Views Last Post
  [WP-34S] Unfortunate key damage with update to V3 :( svisvanatha 5 672 12-10-2013, 11:37 PM
Last Post: Les Bell
  WP-34S (Emulator Program Load/Save) Barry Mead 1 377 12-09-2013, 05:29 PM
Last Post: Marcus von Cube, Germany
  DIY HP 30b WP 34s serial flash/programming cable Richard Wahl 2 545 12-04-2013, 11:14 AM
Last Post: Barry Mead
  WP 34S/43 ?'s Richard Berler 3 511 11-10-2013, 02:27 AM
Last Post: Walter B
  My FrankenCulator (wp-34s) FORTIN Pascal 4 529 11-09-2013, 06:18 PM
Last Post: FORTIN Pascal
  WP 34S Owner's Handbook Walter B 5 689 11-09-2013, 05:34 PM
Last Post: Harald
  wp 34s overlay and programming. FORTIN Pascal 6 687 11-08-2013, 01:28 PM
Last Post: Nick_S
  m.dy in display of WP-34S Harold A Climer 3 424 11-05-2013, 11:28 AM
Last Post: Andrew Nikitin
  WP 34s : An old problem coming back Miguel Toro 2 385 11-05-2013, 03:00 AM
Last Post: Marcus von Cube, Germany
  [WP 34s] Pressure Conversion Factors Timothy Roche 8 776 11-04-2013, 07:17 PM
Last Post: Dave Shaffer (Arizona)

Forum Jump: