HP Forums

Full Version: "Printer" behaviour in Free42 and P41CX
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I have gotten a lot of great guidance recently from this forum regarding emulators, which I have recently discovered as I have revived my interest in my old HP calculators.

I never had a printer for my HP41CV, and have never owned a "real" HP42S, so I have been trying to educate myself about the virtual printer capacities of the emulators in question. I am particularly trying to understand the MAN mode in each.

In P41CX, the oft-used program instructions AVIEW and VIEW nn do NOT seem to invoke printing in MAN mode. But, in Free42, they do. (I must admit, I like the latter situation better for aesthetic reasons.)

I have found a Quick Reference Card for the HP41CV printer (I understand I am not allowed to say where, but the site providing it is managed by a gent whose surname is a common distance measure in horse racing), which advises that in MAN only printer commands lead to printing, but the documentation it is silent on whether AVIEW and VIEW are counted among such commands. I am guessing not, and I guess that if one wants to print to the printer in MAN mode the program should specify PRA or PRX, though this could lead to a NONEXISTENT error if there is no printer at all, or PRINTER OFF if it is present and not on.

My question is this--is this apparent difference in how these commands are treated in the emulators identical to that in the real calculators? Or is there a difference, and if so, why? Also, what sort of external printers, if any were there for the original 42S?

I am curious, since one would hope that, for ease of portability of 41 programs to 42, the commands would be treated the same. Perhaps not.

Even though was a 41CV user and therefore have much attachment to Charles Lee's emulation, I must admit I am seeing the merits of Free42, which looks especially impressive on my larger screen Palm TX with the EhrlingSM skin--indeed this makes the extra cost of a larger screen unit well worth it.

I wax lengthy. Thanks for a great forum and kind answers to all of my questions to date, even the RTFM ones!


.... does anyone have a complete listing of the flags for 42S? I am discovering they are different. For example, SF 27 on a 41C sets USER mode, whereas on a 42S it invokes display of the custom menu--a similar, but not identical use of the same flag.

Something tells me someone is going to tell me to buy those CDs or DVDs pretty soon ;)

On the HP-41, VIEW and AVIEW cause printing, even in MAN mode (assuming a printer is connected and flag 21 is set, of course). If they do not cause printing on P41CX, that's a bug.

- Thomas

I keep this in a Memo on my Palm (see below):

(It is a bit terse but hopefully it makes sense even to a HP-42S newbie! This list is actually the only reference for the HP-42S I ever use -- but it is good to have the manual to acquaint yourself with it at first.)

- Thomas

HP-42S Flags
00-10 user flags
11 auto exec
12 double wide print
13 lowercase print
14 (reserved)
15 trace print ('normal print' ignored if this is set)
16 normal print
17-20 (reserved)
21 printer enable
22 numeric data input
23 alpha data input
24 range error ignore
25 error ignore
26 audio enable
27 custom menu
28 decimal point
29 thousands separators
30 stack lift disable
31-33 (reserved)
34 agraph control 1 (0 (default): dst = dst | src, 1: dst = src,)
35 agraph control 0 (2: dst = dst & ~src, 3: dst = dst ^ src)
36 digits bit 3
37 digits bit 2
38 digits bit 1
39 digits bit 0
40 fix or all
41 eng or all
42 grad
43 rad
44 continuous on
45 solving
46 integrating
47 variable menu
48 alpha mode
49 low battery
50 message
51 two line message
52 prgm mode
53 input
54 (reserved)
55 printer exists
56 lin fit
57 log fit
58 exp fit
59 pwr fit
60 all sigma
61 log fit invalid
62 exp fit invalid
63 pwr fit invalid
64 (reserved)
65 matrix editor
66 grow
67 (reserved)
68 base bit 0 (Note: dec=0, bin=1, oct=7, hex=15)
69 base bit 1
70 base bit 2
71 base bit 3
72 local label
73 polar
74 real result only
75 programmable menu
76 matrix edge wrap
77 matrix end wrap
78-80 (reserved)
81-99 user flags

Edited: 27 Apr 2006, 3:02 p.m.

I forwarded this link to Mr. Lee for consideration. If this is a bug I would love to see it fixed, especially since the fully functional version of P41CX is sold thru Palmgear (albeit very cheaply), whereas you, Mr. Hildinger, and other developers give us software as good or better and seek only voluntary donations!

Try making it to Canada on your donation-funded transatlantic journey. You probably know that Canadians and the Dutch were strong allies in WWII, and I understand we are well liked in the Netherlands.

Thanks for the flag list. Not terse at all. I used to know HP41C very well, and many of the flags are the same.


I forwarded this link to Mr. Lee for consideration. If this is a bug I would love to see it fixed, especially since the fully functional version of P41CX is sold thru Palmgear (albeit very cheaply), whereas you, Mr. Hildinger, and other developers give us software as good or better and seek only voluntary donations!

I find it hard to give a flat-out "no" to feature requests even though I technically don't owe anybody anything... But I'm getting better at it. I guess once Free42 is as old as P41CX, I may have lost interest in maintaining it, too...

Having said that, if you manage to "guilt" Mr. Lee into fixing P41CX, also check if the ADV function works properly. I suspect that P41CX's current 82143 emulation is accomplished by hooking into the printer ROM, and it simply needs a few additional hooks in VIEW, AVIEW, and (possibly) ADV -- those functions are in the HP-41's ROM, which is why they probably were missed.

- Thomas

P.S. I'll keep your advice about Canada in mind. I've seen only Niagara Falls so far, and something tells me there's got to be more to the country than that. ;-)

ADV from the button in Printer menu works only sometimes, and when executed from the keyboard (XEQ ALPHA ADV ALPHA) not at all, at least in MAN. This is no big deal, more a point of curiosity since I never owned any peripherals with my HP41CV and I wanted some feedback about "real life" behaviour. As far as an emulator goes, it is a heck of a lot of fun, even if slightly less than perfect. Maybe Mr. Lee will revise. Maybe.

Niagara Falls is something of North American landmark well known to Europeans (it is also a border town and is therefore convenient to travellers wanting to see Canada and the US), but you are correct--there is so much more to see and do. The sheer geographic size of the country assures that.

As for "guilt", be better get around to sending you my Euros....


Niagara Falls is something of North American landmark well known to Europeans

It's funny about Niagara Falls -- as soon as you cross that bridge to the Canadian side, you get a bit of that feeling of being back in Europe.

I'm not sure if it's the architecture, the people, or because it's so wet. ;-)

- Thomas

The flag list was so good I was going to ask if there is floating around out there a succinct listing of the HP42s function catalog.

I have browsed all of the menus I can find on Free42, and I just can't seem to find the 42S equivlent to APPEND ALPHA--you know, the thing that looks like |- in program code.... I am sure that as I attempt to cross-pollinate from HP41 to HP42, there will be many more examples of this.


The HP-41 APPEND command has no name on the HP-42S, but the functionality is there: when you're in ALPHA mode and there is no cursor, just press ENTER.

In program mode, it's the same thing; to create a program line like |-"ABC", do Shift ENTER to activate ALPHA mode, and then press ENTER again to insert the "append" character.

Another thing you'll notice is that some HP-41 commands have different names on the 42S. You can enter them by using XEQ and spelling out the old name, and they'll then be changed to the new name (hold down ENTER after spelling the command to see it change to the 42S spelling, or do the whole exercise in program mode so you can look at the result for more than 2 seconds).

The affected commands are /, *, CHS, DEC, D-R, ENTER^, FACT, FRC, HMS, HR, INT, OCT, P-R, R-D, RDN, R-P, ST+, ST/, ST*, ST-, X<=0?, and X<=Y?.

Commands like STO Z are displayed as STO ST Z on the 42S, presumably to avoid confusion with STO "Z".

Finally, you enter IND commands using the [.] key, not [Shift]. The [.] key brings up a menu where you can choose IND or ST. This takes a little bit of getting used to if your fingers are grooved into the HP-41 way of entering such commands.

- Thomas

Edited: 29 Apr 2006, 9:51 a.m.

Thomas, this has been very helpful. I have been going back and forth between 41 and 42 lately, decompiling RAW files, recompiling, seeing if they work on P41CX and Free42, etc, and am discovering that there are certain statements that decompile and recompile differently, so by hand adjustments are needed to make one calculator's program intelligible entirely to the other, though of course the codes are usually very close.

Many thanks again.


... and, last not least, Canada uses metric. Forget "CONVERT" and "UNITS". d;-)

Edited: 30 Apr 2006, 4:02 a.m.

there are certain statements that decompile and recompile differently

Hmmm... That shouldn't happen; could be a bug. Which statements are you having trouble with?

- Thomas