Hi, all.
For those of you interested on this particular subject, I briefly inspected the USPS u-code functions (user coded programs) and collected some facts. Because all U-code programs are PRIVATE, I consider that listing them publicly is infringement; then I'll just comment the facts as general observations, OK?
This is the little beast -
All of the following observations are based on the assumption that the calculator is an HP41CV or an HP41C with one quad memory or two dual memory modules - not a 41CX -, no X-Functions module is plugged in it and only one X-Memory is plugged in the calculator along with the DEL. SERV 1 ROM module. If there is any other module than the DEL. SERV 1 plugged in the HP41CV, it is also assumed that there are no conflicting XROM numbers nor functions/labels names. This is just to avoid any further information conflict, OK?
By executing u-code function 'L', a single 235-register long data file named 'DS' is created, meaning that it 'eats up' all of the XMEMORY and, if installed, a second XMEMORY module will not be used by the module’s functions. It is important to notice that if only one X-Memory is plugged in, creating data files by your own with the USPS’ XMEMORY functions will not allow the programs using these resources to perform correctly. I did not check it completely to make sure if there are parts of it that might work without the XMEMORY (at this point some documentation would help...)
User memory is also entirely used because some of the programs in the module take register R317 as index. If SIZE is less then 318 these programs will not run. I can only think of the fact that the remaining user memory – 1 register and 4 bytes - is left for key assignments, a maximum of two.
One particular fact called my attention: except for SEEKPTA, the U-code programs 'invoke' the XMEMORY handling functions by their names, not by their XROM numbers. I suspect of one reason for that but I am not quite sure. Is it possible that, if the USPS module is used with an HP41CX or with an HP41C/CV with an X-Function module, the original X-Functions will be used then? I remember that the HP41 manual states that the user can write his own custom versions of internal functions because once you execute them with [XEQ] [ALPHA] name [ALPHA], the calculator would first search for it in user memory; if not finding it in user memory, then it would search for the name amongst internal resources. Since the USPS’ programs originally run in ROM, I am not sure if the search for the global labels CRFLD, GETX and SAVEX will follow this scheme. If so, the module will work with no conflicts with an HP41CX or with an HP41CV with an X-Functions PLUS an X-Memory module (‘DS’ file will still be created with 325 registers). Chances are that in the case of using the USPS module with a X-Functions module, the USPS module should be plugged in a higher-numbered port (documentation, please?).
CLFL is not used in any of the U-code programs in the module, so ‘DS’ contents are not cleared by regular program execution. I’d guess it must be explicitly performed by the user, though. It might also be performed by some 'housekeeping' (as mentioned by Àngel Martin in a previous thread) when the calculator is turned on, possibly if a particular key is pressed (as it happens if [ENTER] is pressed when the calculator is turned ON and the -MLDL ROM is installed).
These are the facts I could bring up from briefly inspecting the u-code in the USPS module. I would like to know if it is logical to conclude that the module was produced by Hewlett-Packard just because it has a regular HP identifier – 82500B-A38 – and in this case I guess it would be easier to understand why it implements the XMEMORY access in such a way.
If there is anything else that might be added, I’d very much like to know. Also, if there is anything wrong or wrongly written here, PLEASE let me know. I appreciate any comments, corrections and additional facts.
Cheers.
Luiz (Brazil)
Edited: 11 Nov 2012, 9:27 a.m.