Program Execution of X<nn?

Program Execution of X<nn?

Postby Karpurk » Tue Mar 25, 2025 11:10 pm

Hello, I'm working on a program where I need to use "X<nn?" where "nn" is the location of a previously stored number.

I have tried to key that line into my program using just the Alpha input method (pressing the ALPHA key and entering the string without pressing the XEQ key), and also the XEQ/Alpha input method. When my program gets to that line, the program halts and my HP-41 displays "NONEXISTANT". The issue seems to be the "nn" portion of the string. All non-"nn" conditional strings can be entered using the Alpha input method, and they work properly.

Thanks,
Larry Karpurk
Karpurk
..
..
 
Posts: 5
Joined: Sun Feb 09, 2025 6:41 pm

Re: Program Execution of X<nn?

Postby pcscote » Wed Mar 26, 2025 1:23 am

to enter or execute the function, do:
Code: Select all
[XEQ] [ALPHA] X<NN? [ALPHA]

Usage

Setup: put 20 in register 2
Code: Select all
20 [STO] 02

Display YES : compare 19 (in X) with the content of register 2 (indirect Y)
Code: Select all
2 [ENTER] 19 [XEQ] [ALPHA] X<NN? [ALPHA]

Display NO : compare 20 (in X) with the content of register 2 (indirect Y)
Code: Select all
2 [ENTER] 20 [XEQ] [ALPHA] X<NN? [ALPHA]
User avatar
pcscote
.......
.......
 
Posts: 36
Joined: Sat Oct 25, 2014 1:24 pm
Location: Québec/Canada

Re: Program Execution of X<nn?

Postby Karpurk » Wed Mar 26, 2025 4:04 am

Thank you for your response.

With data already in "STO 20"; I put [XEQ] [ALPHA] X<20? [ALPHA] in the program.

When the program runs this line it stops and displays "NONEXISTANT"

I am assuming that the way I have entered the command, the computer compares the X register to what I have stored in "STO 20" location. Is that correct?

(Please let me know if you can get these entries to work on your HP-41).

Best regards,
Larry
Karpurk
..
..
 
Posts: 5
Joined: Sun Feb 09, 2025 6:41 pm

Re: Program Execution of X<nn?

Postby Garth » Wed Mar 26, 2025 6:20 am

I put [XEQ] [ALPHA] X<20? [ALPHA] in the program.

The "NN" is part of the instruction's literal name, not a number like with STO 20.  At run time, X<NN? will compare the contents of X to the contents of a register pointed to by Y.
Garth
Moderator
Moderator
 
Posts: 305
Joined: Tue Jan 20, 2009 1:31 am

Re: Program Execution of X<nn?

Postby Karpurk » Wed Mar 26, 2025 1:57 pm

Thanks guys,

It works!
Karpurk
..
..
 
Posts: 5
Joined: Sun Feb 09, 2025 6:41 pm


Return to Programming

Who is online

Users browsing this forum: No registered users and 1 guest