HP Forums
Comparing X with Indirect Y - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: Comparing X with Indirect Y (/thread-80438.html)



Comparing X with Indirect Y - James F. Chumbley - 10-26-2005

In the HP-41CX Manual, Volume II, Page 305, under the topic "Comparisons," is given a list of six functions (X < NN?, X<=NN?, X=NN?, [X not= NN?], X>=NN?, X>NN?) which are said to compare the contents of the X register with the contents of the register whose name is contained in the Y register (Y Indirect).

The part I don't understand is this statement of HP's: Place the address from 00 through 319 OR THE SINGLE LETTER X, Y, Z, T, OR L in the Y register.

How do you put either an X, Y, Z, T or L into the Y register?

Thanks,
Jim Chumbley


Re: Comparing X with Indirect Y - donald wallace - 10-26-2005

Hi,

You just put the letter in "alpha" register and execute an "ASTO Y".

e.g. using Z into Y using decimal point as a stack operator signifier:

[ALPHA]Z [ASTO][.]Y {command executes} [ALPHA] {leave ALPHA mode}

DW


Re: Comparing X with Indirect Y - James F. Chumbley - 10-26-2005

Thanks, Don,
I appreciate the explanation.
Jim


Re: Comparing X with Indirect Y - Geir Isene - 10-27-2005

Interestingly pointless to put "X" or "Y" in the Y-register...


Re: Comparing X with Indirect Y - donald wallace - 10-27-2005

Hi Jim,

No worries. Anytime.

dw


Re: Comparing X with Indirect Y - donald wallace - 10-27-2005

Hi Geir,

How are you doin'?

x<>x is one way to get a time burning "no-op". ;-)

(used in the "old days" to check machine speed or burn up some time in a loop which didn't mess with data...)


Re: Comparing X with Indirect Y - Karl Schneider - 10-27-2005

Jim --

Your question revealed to me an error in the 41CX Vol. II manual, as well as several insights about the functionality:

Functionality:

  • All HP-41 models lack the X>=0? and X>=Y? comparisons, for some strange reason. This deficiency was rectified in the HP-42S. (Even the HP-15C offered X>=Y? as TEST 9.)

  • The indirect comparisons you mention on p. 305 are specific to the HP-41CX, listed in the "-CX EXT FCN" catalog. They were not offered in the HP-41C or HP-41CV, and were not carried over to the HP-42S.

Error:

  • The five color-coded function names under "Comparing X with Y" on p. 304 of the Vol. II HP-41CX manual (Aug 1983 version) lists the nonexistent X>=Y? in place of the actually-present X/=Y?

-- KS




Re: Comparing X with Indirect Y - Doug Wilder - 10-28-2005

Those missing relational functions can be had by use of another byte in program:

for X>=0? one can use

X<=0?
X=0?
doiftrueline

and for X>=Y?

X<=Y?
X=Y?
doiftrueline

Best


Edited: 28 Oct 2005, 3:36 a.m.


Synthesizing X>=0? and X>=Y? - Karl Schneider - 10-29-2005

Doug --

Quote:
for X>=0? one can use

X<=0? X=0? doiftrueline

and for X>=Y?

X<=Y? X=Y? doiftrueline



Yes -- this is an elegant solution. Maybe the designers of the HP-41 knew about it, and figured that it wasn't a big problem for users to program one additional instruction in order to effect a certain conditional test. However, I'm still a bit surprised that X>=0? and X>=Y? were omitted in the first place, even if lack of ROM space was an issue.

During the same era, the HP-10C and HP-12C had only two of the twelve possible conditional tests; the HP-34C, HP-11C, and HP-16C had eight; only the HP-15C had all twelve. With GOTO-dependent logic, it's a hassle to synthesize conditonal tests in this manner.

-- KS


Re: Synthesizing X>=0? and X>=Y? - Doug Wilder - 10-31-2005

Hi Karl,

I'm agreeing except i believe the problem was that the byte table was full!

There are five lines for single byte functions, 80 of them, and no extras. Probably this is because the 41 has an Alpha register and needs a few slots to support it (CLA,PROMPT,AVIEW,AON,AOFF,ASHF).

A couple of functions would have had to be left out, SDEV and MEAN possibly? I never use these yet the financial types around here would want E^X-1 and LN1+X left out i suppose.

There are a couple of spares (AF&B0) yet they are in the two byte area of the byte table (would make the mainframe flowchart look all weird).

Best