Starting HP25 programs with numbers
11-24-2017, 12:14 PM (This post was last modified: 11-24-2017 12:31 PM by Dieter.)
Post: #4
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
RE: Starting HP25 programs with numbers
(11-24-2017 11:26 AM)teenix Wrote:  I think this works ok.
if there is only zeros in the stack then the result will be 2.

The result should be independent of the stack content.

The user enters a number (in this case 1, 2 or 3), presses [R/S] and the program is supposed to calculate 2 minus that number, i.e. 1, 0 or –1.

(11-24-2017 11:26 AM)teenix Wrote:  If you enter 2 then R/S then the next [2] from line 01 from the program will be a continuation of a number entry. Eg 22

That's exactly the problem. The user enters "3", presses [R/S] and instead of calculating 2–3 the HP25 appends the "2", giving 32, and then calculates 32 minus what happens to be in Y.

(11-24-2017 11:26 AM)teenix Wrote:  The HP-67 (emulator) does exactly the same thing.

Which one ?-)

I am using the Panamatik HP25 and HP67 emulators which are supposed to run the original microcode. Here the bahaviour of both machines differs:

Enter the same four step program both in an HP25 and an HP67.

Code:
01 2
02 x<>y
03 -
04 R/S

Then run it on the HP67:
h[RTN]
3 [R/S] => –1

This works as I would have expected: [R/S] terminates number entry and so the "2" in the first line starts a new number, pushing the previous input "3" to Y, leading to 2–3=—1, as desired.

Now try this on an HP25:
GTO 00
3 [R/S] => 32  (assuming an otherwise empty stack)

Here [R/S] did not terminate number entry, instead the "2" is appended to the entered "3", giving 32. So finally 32–Y is calculated. Unlike other HPs I have used before. That's why I'm asking here.

So the HP25 program must not start with a number here, it requires an additional line that terminates number entry, e.g. ENTER or NOP or FIX 4 or whatever.

BTW, comparing both machines, it is nice to see what a difference one year makes: The 1976 HP67 already uses 13-digit internal precision while the HP25 still has to rely on merely 10 digits for internal intermediate results. Consequently the infamous 3201 example has only 6 (!) correct digits (after rounding).

Dieter
 « Next Oldest | Next Newest »

 Messages In This Thread Starting HP25 programs with numbers - Dieter - 11-24-2017, 09:38 AM RE: Starting HP25 programs with numbers - Paul Dale - 11-24-2017, 10:07 AM RE: Starting HP25 programs with numbers - teenix - 11-24-2017, 11:26 AM RE: Starting HP25 programs with numbers - Dieter - 11-24-2017 12:14 PM RE: Starting HP25 programs with numbers - Thomas Okken - 11-24-2017, 02:07 PM RE: Starting HP25 programs with numbers - PANAMATIK - 11-24-2017, 02:36 PM RE: Starting HP25 programs with numbers - Thomas Okken - 11-24-2017, 03:18 PM RE: Starting HP25 programs with numbers - PANAMATIK - 11-24-2017, 04:17 PM RE: Starting HP25 programs with numbers - teenix - 11-24-2017, 09:25 PM RE: Starting HP25 programs with numbers - Thomas Okken - 11-24-2017, 11:37 PM RE: Starting HP25 programs with numbers - PANAMATIK - 11-24-2017, 11:49 PM RE: Starting HP25 programs with numbers - teenix - 11-25-2017, 12:17 AM RE: Starting HP25 programs with numbers - Dieter - 11-25-2017, 12:49 PM RE: Starting HP25 programs with numbers - teenix - 11-24-2017, 09:11 PM RE: Starting HP25 programs with numbers - teenix - 11-24-2017, 10:01 PM RE: Starting HP25 programs with numbers - PANAMATIK - 11-24-2017, 10:07 PM RE: Starting HP25 programs with numbers - teenix - 11-24-2017, 11:06 PM RE: Starting HP25 programs with numbers - PANAMATIK - 11-24-2017, 11:18 PM RE: Starting HP25 programs with numbers - teenix - 11-24-2017, 11:21 PM RE: Starting HP25 programs with numbers - teenix - 11-24-2017, 11:28 PM RE: Starting HP25 programs with numbers - Dieter - 11-25-2017, 01:10 PM RE: Starting HP25 programs with numbers - PANAMATIK - 11-25-2017, 02:21 PM RE: Starting HP25 programs with numbers - rprosperi - 11-25-2017, 02:34 PM RE: Starting HP25 programs with numbers - PANAMATIK - 11-25-2017, 04:37 PM RE: Starting HP25 programs with numbers - Thomas Okken - 11-24-2017, 11:40 PM

User(s) browsing this thread: 1 Guest(s)