The Museum of HP Calculators

HP Forum Archive 21

[ Return to Index | Top of Index ]

HP-41C "W" function, what was it intended for?
Message #1 Posted by Dan Grelinger on 19 Dec 2012, 12:57 p.m.

The HP-41C has a synthetic function (byte 31D, 1FH) that is displayed as "W'ALPHA STRING" (The ' is the small superscripted 't' that denotes text on the HP-41). It can only be entered into a program through synthetic means, and Keith Jarret's Synthetic Programming Made Easy says that it simply sends the HP-41 into a lockup state, requiring battery removal. I tried it out last night, and on my -CV from 1982, only get a "NONEXISTENT" after a delay, indicating that the HP-41 is searching for the Alpha Label specified as part of the command. "NONEXISTENT" is eventually displayed even if a the label specified (Cat 1, 2, or 3) exists.

Any ideas as to what this function was originally indended to be? It is grouped with the global label GTO and XEQ functions, and also assumes a text label follows in program memory, just like GTO and XEQ. Could it have been a provision for a 'Write' function, a programmable function to write a program, perhaps to the card reader?

Since there are several HP-41C emulators available now, I thought someone may have figured out what it may have been intended for.

Just curious...

      
Re: HP-41C "W" function, what was it intended for?
Message #2 Posted by Eric Smith on 19 Dec 2012, 7:25 p.m.,
in response to message #1 by Dan Grelinger

It wasn't intended for anything. It's a left over instruction code, and the "W" name and the execution address are just artifacts of what data happens to be at the locations that would be used for its entry, if it had one.

It's sort of like eG0BEEP, except that in that case only the name is an artifact.

            
Re: HP-41C "W" function, what was it intended for?
Message #3 Posted by 聲gel Martin on 20 Dec 2012, 2:46 a.m.,
in response to message #2 by Eric Smith

Often I considered patching the OS in a few places, and this would definitely be one - a pole position in the byte table can be put to a good use, won愒 you think? Having an unused entry is a wasted opportunity...

                  
Re: HP-41C "W" function, what was it intended for?
Message #4 Posted by Paul Dale on 20 Dec 2012, 3:38 p.m.,
in response to message #3 by 聲gel Martin

Text 0 get used in synthetics. The other three should be clear but what for? Function launchers of some kind I guess.

- Pauli

                        
Re: HP-41C "W" function, what was it intended for?
Message #5 Posted by 聲gel Martin on 21 Dec 2012, 5:19 a.m.,
in response to message #4 by Paul Dale

Dunno, the RCL Math feels like a good choice to fill that gap - but it'd need at least four entries. There's space in page 3 for the additional code but I'm not clear on where exactly apply the scalpo yet... nice project for the holidays it seems. Suggestions anyone?

                              
Re: HP-41C "W" function, what was it intended for?
Message #6 Posted by Dan Grelinger on 21 Dec 2012, 3:30 p.m.,
in response to message #5 by 聲gel Martin

I was going to suggest RCL arithmetic, and it would be possible to use just one of the instruction bytes, I believe, assuming that it could be turned into a three byte instruction; e.g. RCL+01 would be (in decimal) 31,64,01, RCL-T would be 31,65,112, RCL*IND01 would be 31,66,129, and RCL/INDY would be 31,67,242.

Another use for them would be for a random number function, Combinations/Permutations, a Gamma function, a y-intercept / slope function, or a linear estimate / correlation coefficent function. These are all on the HP-15C and are missed on the HP-41C.

                              
Re: HP-41C "W" function, what was it intended for?
Message #7 Posted by Monte Dalrymple on 27 Dec 2012, 12:16 p.m.,
in response to message #5 by 聲gel Martin

The place to intercept this bytecode is in the XROW1 routine at address 0074. There obviously isn't room to patch it there, but you can replace a few bytes by a jump to somewhere else to expand the code. XROW1 starts with a test for <13 to branch to the digit entry routine. If you then insert a test for 15 you can branch to new code to interpret the new functionality. If the test isn't true return to 007A to handle the 13/14 cases. Just be sure to guarantee that the pointer is positioned properly if continuing on to XCUTEB.

Edited: 27 Dec 2012, 12:17 p.m.

                                    
Re: HP-41C "W" function, what was it intended for?
Message #8 Posted by Monte Dalrymple on 27 Dec 2012, 12:23 p.m.,
in response to message #7 by Monte Dalrymple

...but be aware that I used the empty locations 507F-5084 in the Timer ROM in the CL for a short power-on routine, so you'll need to find a different "blank spot" to use.

Edited: 27 Dec 2012, 12:48 p.m.

                                    
Re: HP-41C "W" function, what was it intended for?
Message #9 Posted by Eric Smith on 27 Dec 2012, 7:38 p.m.,
in response to message #7 by Monte Dalrymple

That handles execution, but it will still try to display (in PRGM mode) a W with an inline ALPHA argument. It takes more extensive patching to fix that. And if you want your new function to be listed in CATALOG 3, even more patching.

            
Re: HP-41C "W" function, what was it intended for?
Message #10 Posted by Dan Grelinger on 20 Dec 2012, 11:34 a.m.,
in response to message #2 by Eric Smith

There are a couple of other unused instruction bytes. On the Synthetix HP-41C Quick Reference Card for Synthetic Programming they are listed as "Spare". Decimal 175 and 176 (also 'pole positions'). Instruction 175 appears just like 174 (GTO/XEQ IND) when inserted into a program, but it does not seem to do anything when executed. Instruction 176 shows up as a short form GTO (specifically GTO 15), but it doesn't appear to do anything when executed, either.

So in summary, (along with instruction 240, the 'Text 0' instruction) it appears that there are 4 (out of 256) instruction bytes that were never used in the HP-41C.

Thanks!

            
Re: HP-41C "W" function, what was it intended for?
Message #11 Posted by 聲gel Martin on 21 Dec 2012, 8:24 a.m.,
in response to message #2 by Eric Smith

Hi Eric, I'm at a loss trying to identify where in the OS exactly is the "mapping" done, I guess it's somewhere in page 2 but really don't have a clear picture. Could you give me some pointers? Thanks much in advance.

                  
Re: HP-41C "W" function, what was it intended for?
Message #12 Posted by Eric Smith on 21 Dec 2012, 11:17 p.m.,
in response to message #11 by 聲gel Martin

Patching to change something like W is very tricky, because there isn't any space dedicated to a table entry for it. It's been a few years since I studied it, but I'll take another look.

                        
Re: HP-41C "W" function, what was it intended for?
Message #13 Posted by 聲gel Martin on 22 Dec 2012, 4:45 a.m.,
in response to message #12 by Eric Smith

Sounds promising - just sent you a separate mail with a "tool" - maybe it helps us find "W"(aldo).

Cheers, 簍


[ Return to Index | Top of Index ]

Go back to the main exhibit hall