Help with a 41/42 program



#20

I'm trying to use this program in my 42s. It was ported from the 67 to the 41 but look at line 32 and 94 (and many others)... Is it really ported? Are these valid 41/42 tokens?


#21

Hi Raul,

these tokens only work with the 82104A card reader plugged in.
The card reader ROM has some functions which allow the usage of HP-67 programs on an HP-41 without the need to reprogram them, substituting some functions of the 67 which are not in the basic HP-41.

Line 32, 7DSZ is like DSE on the HP-41, maybe jou have to adjust the register usage.

AFAIK 7P<>S swaps the primary and secondary registers on a 67, for more information please take a look to the appriorate pages here in the museum, or on the museum CDs.

I think most of these adapted 67 functions an be rewritten or replaced by genuine HP-41 functions without too much work. Maybe a nicepuzzle for the easter days;-)

Regards,

Raymond

#22

As stated on the page you are referring those are 67/97 instructions translated by means of the 41 card reader.
As written this program will work only with a card reader plugged in (or with its ROM loaded in a Clonix module, for example).

Sorry,

Massimo


#23

I didn't know the card reader added new commands to the 41... As Raymond says, I'll take a look to the 67 manual...


#24

Hola, Raul; como estás?

Just to add a few info about the HP67/HP41/HP42 set.

as mentioned, the HP41 is added 36 new functions when the 82104A (Card Reader) is attached. Three of them are not programmable and 26 (all starting with "7___") are meant to provide HP67/97 compatibility.

The main characteristic present in both HP67/97 is the memory organization. Both offer 26 registers, but only 16 (1-nibble addressing?) can be directly accessed: R0 to R9, RA to RE and RI. R0 to R9 are named "Primary" registers, while the "hidden" set of extra ten register is called "Secondary". It's common to see Pn (n form 0 to 9) as a reference to a primary register and Sn (n from 0 to 9) as a reference to a secondary register. When using the HP41 to run HP67/97 applications, all 26 registers are available. The relation is:

 HP67/97       HP41
P0 to P9 R00 to R09
S0 to S9 R10 to R19
RA to RE R20 to R24
Index (RI) R25
The purpose of "7P<>S" in the HP41's Card Reader ROM is to exchange the contents of R00 to R09 (primary) for R10 to R19 (secondary). Both HP67 and HP97 have their equivalent to "7P<>S", and it actually exchanges primary with secondary contents. I think that an extra "7P<>S" program in an HP42S that allows this register contents changing might be a better (and faster) solution to run an HP41 "translated" programs in an HP42S. I also guess that GETM and PUTM are the best choices... d;^)

One interesting fact: statistic data is always saved in the "hidden" area, so you can use the "main register set" completely while collecting statistical data. I guess this is the main reason the HP41 stands for this particular statistic registers arrangement: from R11 to R16. It's necessary to keep in mind that programs written for the HP67/97 that use "P<>S" in order to access the statistics summations (S4 to S9) must be carefully inspected and updated. If you collect statistic data in the HP41 by using (SIGMA)+ and (SIGMA)- and execute "7P<>S", the statistic data will be positioned in the block from R01 to R06. When programs containing statistical functions are read from cards, the card reader automatically adds a "(SIGMA)REG 14" in order to set the statistical registers to the appropriate location. So , in order to keep the closest relationship between both calculators while dealing with statistics, it's necessary to manually execute "SIZE 026" and "(SIGMA)REG 14" prior to perform any manual operation.

Some important differences: GTO(i), GSB(i) and LBL

Both HP67/97 allow the use of 20 labels: LBL 0 to LBL 9, LBL A to LBL E and LBL a to LBL e. Each alpha label has its numeric equivalent for indirect purposes:

  LBL     GTO(i) GSB(i) (RI must contain)
A to E 10 to 14
a to e 15 to 19
The HP41 structure does not allow indirect addressing for local ALPHA labels (A to E and a to e). In order to allow the same functionality, the HP41 card reader firmware "translates" programs originally written to both HP67/97 and adds numeric equivalent labels before any HP67/97 alpha label when a program card is read. The translation process also replaces GTO IND 25 and XEQ IND 25 to GTO(i) and GSB(i), respectively.

Other minor differences are related to display control ("7DSP0" to "7DSP9", "7ENG", "7FIX" and "7SCI"), printing and automatic review functions, "7ISZ" and "7DSZ" and the rapid reverse branching/jumping. The HP67/97 allow the so called "rapid reverse branching", that accomplished when you store a negative number in RI and execute GTO(i) or GSB(i). This sort of jumping is not allowed in the HP41, and programs written for the HP67/97 that use this feature may be hard to be rewritten.

Well, this time I read some parts of the HP82104A and both HP67/97 manuals. I own an HP97 (no HP67) and sometimes I prefer using it to run its own programs.

I hope I did not confuse things up... And please, if there is anythign wrongly posted, let me know.

Cheers and success, Raul.

Luiz (Brazil)


Edited: 10 Apr 2004, 2:28 a.m. after one or more responses were posted


#25

Luiz:

While I have no specific knowledge of HP67/97 internals, I feel pretty sure about some of the instructions being chosen to be able to fit (at least most) instructions in one-byte opcodes. The usage of P<>S saves al least 60 opcodes (10 registers with RCL, STO, STO+, STO-, STOx, and STO/). Similarly, the usage of FIX, SCI, ENG, and DSPn allows to control the display with 13 opcodes, instead of the 30 which may be needed using FIXn, SCIn, and ENGn combinations.

As I have no complete reference of the 67/97 instruction set, I cannot confirm or deny if there are any two-byte instructions; but even the fixed number of available steps suggests there are no two-byte opcodes.

I recently analyzed the op-code space for the HP25 and HP29C (some registers cannot be addressed directly on this last model for these same reasons), and checked the one-byte hypothesis on them. By the way, GTO and GSB pointing to labels are not only justified for program structure and editing convenience; but also for saving opcodes. For instance, LBL, GSB and GTO with 15 possible label values requieres 45 op-codes, while GTOnn (as used in the HP25) requires as many opcodes as available steps are (50 in the HP25, even more in the more advanced models)


#26

Hey, Andrés;

thank you for your thoughtfull post.

Just to make sure my reasoning make sense as well: if we consider that all of these possible combinations mean ROM "entry points", than it would not be a mistake to consider that others exist, but they are used internally.

Let's consider that [FIX] and [DSP][4] cause the same effect as a nonexistent [FIX][4], but there are only ten direct [DSP] possibilities (not considering [DSP][(i)]) plus the other three [FIX], [ENG] and [SCI], right? But what code effectively uses less space? I mean, what does it actually happen in microcode? I guess [DSP]n is closer to current ROM contents than [FIX]n, [SCI]n and [ENG]n.

But I can't tell a line without guessing. I never stopped to consider an actual implementation. What actually goes on? And this is just display-format matters!

Just reasoning...

Cheers. And thank you again, Andrés!

Luiz (Brazil)


#27

Luiz:

You are right, perhaps I should explicitely refer to "user opcodes"

For instance, in the HP25 you have:

11 digit entry and decimal point
4 arithmetic functions
1 constant (pi)
6 Enter,x<>y, roll down, LastX, CHS, EEX
3 Clear (Reg, Stack, X)
48 store, store arithmetic and recall operations
6 trigonometrics
8 logarithmics and power: y^x, 1/x, sqrt, x^2
7 conversions (HMS, HR, INT, FRAC, ABS, R>P, P>R)
4 statistics (E+, E-, mean, sdev)
1 percentage
50 GTO (including GTO 00)
8 conditionals
3 program control (Stop, Pause, NOP)
30 display modes
3 angular modes

so there are 193 "user op-codes", well below 255 or 256.

There may be much more "sys op-codes" or ROM entry points, not available for the user.

Best regards!!

Edited: 10 Apr 2004, 8:47 a.m.

#28

You are correct, the HP-67 and HP-97 use only single-byte opcodes. They use 250 codes out of the possible 256. The extras include tantalizing "SF 4" and "CF 4" instructions, however there is no "FS? 4". All six extras appear to function as NOPs. This was all published in the PPC Journal
back in 1977-1979.

On the HP-25, many of the undefined opcodes will cause the calculator to hang. In order to conserve ROM space to keep the cost low, they had to put code in table entries that
would be used for decoding those opcodes. On the HP-25, if you somehow managed to get an undefined opcode into memory
and cause a hang, you could just turn if off then on again
to clear the memory. On the HP-25C you'd probably have to
remove the battery, possibly for a few minutes.

#29

Your post will be a great help (again!).

Thanks a lot, Luiz.

#30

Raul,

For a couple of programs that obtain roots of polynomials you can use those included in the SandMath-II ROM, posted on "the other site". They include:

- CVIETA, direct formulas for a cubic equation

- POLYN, iterative for a generic degree N, Real coefficients

- CPOLR, ditto with Real or Complex coefficients

They are almost self-explanatory, just follow your instinct...

Best, AM/


#31

Hi Angel, but sorry: I can't understand... what is "the other site"?

(sure it is obvious and I'm going to feel ashamed...)

Edited: 9 Apr 2004, 6:45 p.m.


#32

I assume most people are referring to the "other site" because:

There is kind of a "legal issue" between such "other site" and an important "company" (I just wonder if it is one which manufactured high quality scientific and financial calculators some years ago...),

and ...

... such legal issue prevents Dave Hicks from allowing the mere name of such "other site" to ever appear on *his* MoHPC site.

Otherwise ...

... he would get involved about the "legal issue" (it may be enough if any of us eventually posts here the 8-character domain name of the "other site", God forbid!).


Perplexing? Well, these are XXI-century-world rules (!)


#33

Perplexing? Really!
Would you email me? Thanks.


#34

Yes I would if I had your email address!

Alternatively just search Google for "v41 emulator" , and you'll be on "the other site"


#35

I have got the sandmath-ii.mod file but how can I list the POLYN program?
Thanks in advance.


Edited: 10 Apr 2004, 4:57 p.m.


#36

Raul, I sent you an email but it bounced back...

your address correct?


#37

Just drop "drop.all.this", so you get: pitquim AT yahoo DOT es


#38

Still bounces...


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP Prime: run a program in another program Davi Ribeiro de Oliveira 6 2,645 11-11-2013, 08:28 PM
Last Post: Davi Ribeiro de Oliveira
  Updated PPC DVD Version 2.10: HP-41 Searchable Program Files and Scannable Barcode Jake Schwartz 3 1,844 09-27-2013, 09:51 PM
Last Post: Olivier (Wa)
  Looking for PLTMX80 program for HP- 41 Ángel Martin 1 933 10-19-2012, 05:21 AM
Last Post: Ángel Martin
  New 41 model to use rom of "big" program Olivier De Smet 4 1,640 10-03-2012, 07:35 PM
Last Post: Brian Walsh
  HP-67's Flag 3 to HP-41/42 Equivalent Matt Agajanian 2 1,184 03-29-2012, 06:29 AM
Last Post: Dieter
  Editable PDF Docs for HP-41 Program Documentation? Namir 8 2,665 03-08-2012, 11:13 PM
Last Post: John Robinson
  HP-41 Ohms Law Program Jeff Davis 45 10,691 12-28-2010, 09:23 PM
Last Post: Ren
  HP-41: Sail boat parameter program Geir Isene 0 740 11-24-2010, 01:37 PM
Last Post: Geir Isene
  HP 82240B. Infra red printer for HP 42---HP 50g Stuart Sprott 20 4,690 04-29-2010, 01:52 PM
Last Post: Vieira, Luiz C. (Brazil)
  HP41/42 Unit Conversion Egan Ford 36 7,629 03-30-2009, 11:30 AM
Last Post: Martin Pinckney

Forum Jump: