|HP-42S, 41CX and synthetic programming thoughts|
Message #1 Posted by Vincent Weber on 25 June 2008, 9:13 a.m.
I have recently tried to give synthetic programming on the 41 a look and read the book "Synthetic programming made easy", and enjoyed it.
However, SP is not possible on the 42S (besides poking into memory to get long labels and normally non-programmable instructions into programs) because 1) the 42S has a totally different memory architecture than the 41, hence does not have such registers as M,N,O,P,Q,b,d, etc. and 2) the 42S OS has a torough check of parameters and do not accept any SP instruction.
I then started to wonder: "What do I miss not having synthetic programming facilities on the HP-42S (and the Free42 simulator) ? do I have workarounds ?". The sort answer seems to me: "Yes! the 42S has extra built-in functionality that more than make up for the lack of SP". But I would need this to be commented...
Here are my thoughts on the subject, based on the little understanding I got on SP from the book. The list of SP applications and comments below is certainly not exhaustive, and I would most appreciate if SP experts on the forum could complete/correct these thoughts !
So, here it goes. SP can be used on a 41 to:
1-Input any character in the alpha register, not just plain A-Z
=> The 42S can readily enter any character from the alpha menu
2-Use registers M,N,O,P to manipulate directly the alpha register
=> The 42S does not have these registers, but have powerful alpha manipulations functions (ALENG, AROT, etc...) to perform this. (By the way, this is also true of the 41CX/Extended functions)
3-Use registers M,N,O,P as extra "scratch" registers to avoid conflits of use of numeric registers
=> The 42S does not have these registers, but have more general named variables that can be created and deleted on the fly for that purpose
4-Change the numeric registers base adress to avoid confliting use ("curtain")
=> The 42S does not have this facility, but since the registers are stored in the REGS matrix, you can save this matrix locally and restore it after program completion. This is quite powerful, athough it requires to have quite a bit of memory if you do not wish to resize (but memory is not really an issue on Free42 :))
The Extended Functions seems to be able to move the curtain without SP (REGMOVE, etc.)
5-Store and restore the entire flags (RCL d/STO d)
=> The 42S, unfortunately, does not have this feature, and I wish it had it! But let's note that the primary usage given of the book of this is: restore the display mode after a "FIX 0" used to append a counter value to the alpha display as an integer. This goal is achieved simplty on the 42S thanks to the AIP function, which does not exist on the 41.
6-Use a NOP-like instruction (TEXT0) to lift the stack in any case after an ISG or DSE
=> Indeed this is useful, and unfortunately without 42S equivalent that I know of; but on this forum there are examples of using the DEG instruction as a NOP instruction; not ideal, especially when using trigs, but an acceptable workaround.
7-Fast "infinite" loops without labels nor "flying gooze" movement (STO b/RCL b)
=> No 42S equivalent of this, but IMHO this is not an issue given the speed and memory amount of Free42
8-Save memory on exponentials (i.e. E3 instead of 1E3)
=> Same comment as point 7
=> No 42S equivalent, but not overly useful to me as I don't intend to turn Free42 into a music instrument...
10-Multi-key-stroke key assignments, e.g. RCL IND X
=> Not possible in the 42S in the CUSTOM menu... but I feel that the comprehensive menu structure of the 42S makes up for it.
That's all for what I could see of SP applications, I certainly missed some, thanks for your input !
Juste one last note - I think Free42 is wonderful and fixes most of the shortcomings of the 42S:
- The lack of I/O and mass storage is adressed,
- The ackward 2-key stroke alpha entry is adressed,
- The display is clear,
- Memory and speed are almost infinite,
- You do not need date/alarms functions when running Free42 on a PDA that adresses these much better than any calculator.
- Nor do you need extended memory functions/memory when you have all the mass storage you want.
In short, I just wish the HP42S had the following additional functions:
- a NOP instruction,
- Algebraic Equation entry a la 19BII/27S, with L() and G() functions,
- One-line complex numbers entry a la 35S,
- Fraction support a la 32SII.
Cheers and best regards from