41CV functions



#8

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


#9

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.


#10

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


#11

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]

#12

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.


#13

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


#14

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.


Possibly Related Threads...
Thread Author Replies Views Last Post
  [41CL] New Extra Functions version Monte Dalrymple 0 275 11-08-2013, 04:32 PM
Last Post: Monte Dalrymple
  HP Prime: in need of help with defining functions Alberto Candel 14 1,105 10-27-2013, 10:48 AM
Last Post: Alberto Candel
  HP Prime spreadsheet functions SanS 0 615 10-04-2013, 04:23 AM
Last Post: SanS
  Stats functions on the HP34S Nicholas van Stigt 5 524 09-24-2013, 02:45 AM
Last Post: Nick_S
  Trig Functions Howard Owen 11 890 09-16-2013, 02:53 PM
Last Post: Fred Lusk
  50g piecewise functions Kurt Fankhauser 6 535 09-15-2013, 08:01 PM
Last Post: Kurt Fankhauser
  Missing functions on the HP Prime!!!??? :-( Namir 6 552 08-22-2013, 08:40 AM
Last Post: Gilles Carpentier
  HP41 Functions Address Table (F.A.T.) Antoine M. Couëtte 6 539 07-21-2013, 02:48 AM
Last Post: Antoine M. Couëtte
  Trigonometric Functions (HP-17BII) Gerson W. Barbosa 2 414 04-09-2013, 11:57 PM
Last Post: Gerson W. Barbosa
  [41CL] Rescue from 'Lost Y Functions' Dan Grelinger 18 1,177 02-16-2013, 02:08 PM
Last Post: Diego Diaz

Forum Jump: