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
|
|||
|
|||
RE: Starting HP25 programs with numbers
(11-24-2017 11:26 AM)teenix Wrote: I think this works ok. 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 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 »
|
User(s) browsing this thread: 1 Guest(s)