[comp.sys.handhelds] hp42 mysteries

ralph_hempel@canrem.uucp (ralph hempel) (12/17/90)

Here is an interesting tidbit on the HP42S.

There are 3 undocumented functions that I have found in ROM. They are
1. [MAX] - Find max of currently indexed Matrix
2. [MIN] - Find min of currently idexed matrix
3. [FIND] - ?????

All three can be entered by normal keystrokes, no need for 41 type
synthetics. Are there any more things we should know about???

Cheers, Ralph Hempel
--
Canada Remote Systems.  Toronto, Ontario
NorthAmeriNet Host

grahamf@hparc0.HP.COM (Graham Fraser) (12/22/90)

________________________________________________________________________

HP 42S
Owner's Manual Addendum:   Hidden Matrix Functions
________________________________________________________________________

The HP 42S Owner's Manual fails to mention the existence of three useful
matrix functions.

[MIN]	Gets a column's smallest element
[MAX]	Gets a column's largest element
[FIND]	Searches a matrix for a given element

Since these functions are not mentioned in the manual,  it can be assumed
that they are not supported by Hewlett-Packard.  They were discovered
independently on November 9,  1988 by Joseph K. Horn,  who also wrote the
text of this addendum.

Do not contact the Hewlett-Packard Company regarding these unsupported
functions.  Further information about your HP42S may be obtained from
user clubs,  or this notes area.

The hidden matrix functions are described below.

__________________________________________________________________________


COLUMN MINIMUM

To find the value and location of the smallest element in one column of 
a matrix,  use the [MIN] function.  The matrix to be searched is specified
by the INDEX function  (see the Owner's Manaul,  page 223).  The column 
to be searched is specified by the value of the index J,  and the search
proceeds from index I to the bottom of the column.

To get a column's smallest element:

1:	Index the matrix:	INDEX (name)
2:	Set IJ to locate the beginning of the search:
	row  ENTER  column  STOIJ
3:	Execute [MIN]
4:	Find the elements value in the X-register,  and its row number in
	the Y-register.

The old X and Y are lifted to Z and T;  the old Z and T are lost.  Only
the elements row number is returned,  because only one column (set by
pointer J) is searched.

If the smallest element is found in more than one location,  [MIN]
returns the location of the LAST one found (nearest the bottom of the
column).

If you wish to search more than one column (for example to find the
smallest element of an entire matrix) you may redimension the matrix,  
search it,  then redimension it back again.  Redimensioning can be 
performed by the DIM function  (see page 217).

-------------------------------------------------------------------------

COLUMN MAXIMUM

The [MAX] function operates exactly like [MIN]  (see above),  except
that it returns the largest element in the column.

Combining these functions with the R<>R function allows rapid sorting
of the rows in a matrix into ascending or descending orderusing one
column as the sorting key.

-------------------------------------------------------------------------

MATRIX SEARCH

	To search for a particular value in a matrix and find out its location,  
you can use the [FIND] function.

1:	Index the matrix to be searched:	INDEX (name)
2:	Place the value to be searched for in the X-register.
3:	Execute [FIND]
4:	If performed from the keyboard,  YES indicates that the number
	was found,  and NO indicates that it was not found.
5:	If performed in a program,  the do-if-true rule is followed (see
	page 149);  that is,  if the value is NOT found,  then the next 
	program line is skipped.
6:	If the value is found,  then the pointers IJ are set to its
	location,  and the search immediately ends.  If the value is not
	found,  IJ are not affected.

_________________________________________________________________________


Graham Fraser
CocoNut => HalfNut => Titan => Paladin => Orlando => Charlemagne => ????

________________________________________________________________________
I am not employed by Hewlett-Packard,  I just get to use their equipment.
My comments are my own,  and do not necessarily reflect those of HP.
________________________________________________________________________