HP Forums
HP-32S/33S/35S emulator with Stack Overflow sensing/Stack display - 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: HP-32S/33S/35S emulator with Stack Overflow sensing/Stack display (/thread-233179.html)



HP-32S/33S/35S emulator with Stack Overflow sensing/Stack display - x34 - 10-24-2012

It is hard to develop programs for HP-32S due to low available memory. You need to optimize numbers, i.e. replacing 0.9 with 1;10;1/x;- sequence to free a couple of bytes. The problem is, when re-doing programs written for 35s/33s, stack usage becomes higher, and you can inadvertently get stack overflow.

So, I hope there is some emulator for one of these calculators, which either could be set to signal stack overflow (i.e. when non-zero value is pushed higher than T) or just display stack contents.

Are they available?


Re: HP-32S/33S/35S emulator with Stack Overflow sensing/Stack display - Dieter - 10-25-2012

I do not think there is an emulator with built-in stack overflow warning. Simply because it does not make sense: Key in any number you like, or simply press the ENTER key, and T is lost. Data is lost even if T was zero before - a zero does not indicate an "empty" register, it can be a meaningful, important value just as any other number.

Regarding memory usage of numeric constants: yes, sometimes you have to be a bit ...creative. For instance, on the 35s [Pi] [INT] is shorter and faster than a simple [3]. But what about the 32s? How many bytes are required for a simple 0.9?

I think the best start for a translation from a 35s program to your 32s, or in general from machine X to Y, is a thorough understanding of how the program works. Literal translations sure are not the best way to handle this, often a different approach based on the specific features of the target device is way better - and ofter faster and more concise as well.

Just think of most HP-67/97 programs that could also run on a HP-41 system (with attached card reader), and then imagine how much better and faster these could have programmed, using the advantages of the 41-series.

Dieter


Re: HP-32S/33S/35S emulator with Stack Overflow sensing/Stack display - Bart (UK) - 10-25-2012

Use an RPL calculator (48S/G series, 50G), their stack depth is limited only by available memory (visible stack 4 to 11 levels depending on model & display settings). 50g emulator available here.


Re: HP-32S/33S/35S emulator with Stack Overflow sensing/Stack display - x34 - 10-26-2012

Bart, IMHO RPL calculators are too different from RPN ones, especially concerning stack usage. I don't see any help in using HP-50G to prototype HP-32S program.

Dieter, I agree zero could be meaningful value. Say I use NIL or another guard value instead of zero. 0.9 consumes 9.5 bytes, numbers in range 0-254 consume 1.5 bytes only, so 1;10;1/x;- takes 6 bytes instead of 9.5.

Maybe there is some RPN (not too far from HP-32S) emulator which shows stack contents. I would be glad to hear about one with syntax close to HP-32S/33S/35S.

Another option is to tune some existing emulator to fit my needs.
Is there any 32s/33s/35s emulator with source code?