The Museum of HP Calculators

HP Forum Archive 09

[ Return to Index | Top of Index ]

41CV functions
Message #1 Posted by Martin on 8 Sept 2002, 6:49 a.m.

I have an HP-41CV with no modules. How do I get the ATOX and XTOA functions to work? I need them for the Hex to Decimal base conversion programs.

Thanks, Martin

      
Re: 41CV functions
Message #2 Posted by Vieira, Luiz C. (Brazil) on 8 Sept 2002, 8:37 a.m.,
in response to message #1 by Martin

Hi;

XTOA and ATOX exist in the XFUNCTIONS and there is not DIRECT way to put them working in a plain HP41. The HP41CX already have them, and there are four equivalent (and somewhat more controlling) functions available in the Extended IO Functions Module: XTOAL, XTOAR, ATOXL and ATOXR.

Maybe there are others that do the same or closer, available in some non-HP modules OR in the Advantage Module, but I do not know about them. About converting from HEXadecimal to DECimal, I can tell I created a program to do the job without any other function than the standard ones. It's a little byte-consuming, but does the job. Are you interested? If so, let me know and I'm posting the list in here as soon as I find it...

Cheers.

            
Re: 41CV functions
Message #3 Posted by Martin (UK) on 8 Sept 2002, 4:20 p.m.,
in response to message #2 by Vieira, Luiz C. (Brazil)

Yes, thanks, I'm interested.

Incidentally, on one project I had to convert my Hexadecimal values to Octal for visiting engineers from the States. They said they hardly ever used Hex. Perhaps this is why the base model doesn't have Hex to Dec as a standard function.

Regards, Martin

                  
Re: 41CV functions
Message #4 Posted by Les Bell (Sydney) on 8 Sept 2002, 10:04 p.m.,
in response to message #3 by Martin (UK)

The Hex/Octal thing basically depends on what types of computer one grew up with. While IBM documentation always used hex, DEC computers (such as the 12-bit PDP-8) and also HP machines were easier to work with in octal. Which is why the HP-65 and later machines supported decimal/octal conversion, of course.

As an example of why octal was sometimes more convenient, consider the Intel 8080. If you split the 8-bit opcode field into octal (from MSB to LSB), you wind up with a two-bit field, a three-bit field and a final three-bit field.

Now, if the two-bit field is 01, the remaining two three-bit fields represent the destination and source registers of a MOV, respectively, as shown in the following table:

A 7 B 0 C 1 D 2 E 3 H 4 L 5 M 6

So MOV A,D assembles into 0172. Knowing that the MVI (move immediate) opcode was 0x6, for example, it's obvious that 056 is a MVI L, instruction. And so on. There's tremendous orthogonality in the instruction set and opcodes that makes it very easy to assemble and disassemble using the Mark 1 human eye/brain combination - but it just doesn't work in hex.

I have here a couple of cardboard "slide rules": the "Tychon 8080 Octal Code Card" and the "Tychon 8080 Hex Code Card". As you slide the octal version, the patterns in the opcodes are obvious; as you slide the hex version, the patterns are much harder to see. The boundaries between hex nibbles just don't align with the opcode fields the processor actually works on, the way the octal digit fields do.

DEC and HP processors presumably had similar "octally-aligned" fields in their opcodes, while IBM didn't.

Of course, the complex instruction sets of modern microprocessors make it much more difficult to deal with instructions this way, and hardly anyone needs to identify opcodes by eye any more, so . . and in that case, you might just as well use hex.

Best,

--- Les Bell, CISSP [http://www.lesbell.com.au]

                  
Re: 41CV functions
Message #5 Posted by Chris Catotti (Florida) on 9 Sept 2002, 5:33 p.m.,
in response to message #3 by Martin (UK)

The Advantage Module handles Hexadecimal and Binary numbers easily.

The PPC Module has a program that converts Decimal to Base, and Base to Decimal, where the Base is any integer from 2 to 26. It uses synthetic programming but can be keyed in using a BYTE GRABBER, BYTE LOADER, copied from a PPC ROM, or I may have a BARCODE copy of it.

Email me if you like.

                        
Re: 41CV functions
Message #6 Posted by Martin (UK) on 10 Sept 2002, 1:53 p.m.,
in response to message #5 by Chris Catotti (Florida)

Thanks for your help, everyone. I guess I'll do it the easy way and get a cheap Advantage module sometime.

                              
Re: 41CV functions
Message #7 Posted by David Smith on 10 Sept 2002, 5:32 p.m.,
in response to message #6 by Martin (UK)

Lots of luck finding a cheap Advantage module. At one time they could be had fairly regularly for 20 bucks or less on Ebay. Then I saw one dufus bid over $100 for one (without the box). Now I bet everybody expects their modules to bring even more (at least for a while). Also they seem to be getting scarcer and scarcer as time goes on.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall