HP Forums
program problems with HP67/97 - 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: program problems with HP67/97 (/thread-94216.html)



program problems with HP67/97 - Bob Priddle - 06-13-2006

Hi,

I am trying to reverse engineer a formula from from an HP67 programme. Most of it is pretty clear, however I don't understand what the following program steps from 38 to 45 are doing so can anybody help:

037
038 STO1
039 CHS
040 2
041 ENT
042 Pi
043 x
044 +
045 STO2
046

Thanks,

Bob


Re: program problems with HP67/97 - Steve Borowsky - 06-13-2006

It looks like whatever is in X gets stored to register 01 then X is sign-changed, added to 2pi and stored to register 02.


Re: program problems with HP67/97 - Valentin Albillo - 06-13-2006

Hi, Bob:

    Assuming you've got a value, say N, in the display (X register)
    at the beginning, after you execute these steps you'll have:
        In Register 1:      

    N

    In both Register 2 and the display (X register):

    -N + 2*Pi

    but you should delete step 041 ENT, (assuming you mean ENTER),
    because ENTER isn't needed to separate the numeric entry "2"
    from the constant value "Pi".
Best regards from V.


Re: program problems with HP67/97 - Howard Owen - 06-13-2006

Quote:
but you should delete step 041 ENT, (assuming you mean ENTER),
because ENTER isn't needed to separate the numeric entry "2"
from the constant value "Pi".

Doesn't that ENTER mean that you would have

  • R1 = N
  • X = 2Pi+2
  • Y = -N
  • R2 = 2Pi +2

I'm on the opposite North American coast from my 67, but I have my 41 with me. That distribution is what I get when I run the following program:

  • 01 LBL 'TST
  • 02 STO 01
  • 03 CHS
  • 04 2
  • 05 ENTER^
  • 06 PI
  • 07 *
  • 08 +
  • 09 STO 02

Regards,
Howard


Re: program problems with HP67/97 - Valentin Albillo - 06-14-2006

Hi, Howard:

Howard posted:


"Doesn't that ENTER mean that you would have

  R1 = N 
X = 2Pi+2
Y = -N
R2 = 2Pi +2

    It depends on whether [ENTER] disables stack lift for the
    following numeric entry (so that it overwrites the contents
    of the X register) *AND* [PI] is considered a numeric entry
    key in the HP-67, which I can't test right now.

    I assumed that either that's the case (so that [ENTER], [PI]
    does overwrite X) or the original coder wrongly thought it
    did, because frankly I find much more plausible that he is trying to compute:

             -N + 2*Pi
    which is frequently seen as part of many computations, than:
              2*Pi + 2
    which seems pretty useless to me.
Best regards from V.


Re: program problems with HP67/97 - Marcus von Cube, Germany - 06-14-2006

Quote:
It depends on whether [ENTER] disables stack lift for the following numeric entry (so that it overwrites the contents of the X register) *AND* [PI] is considered a numeric entry key in the HP-67, which I can't test right now.

That's exactly the case on my 97 so it should be the same for the 67.

Marcus


Thanks, Marcus ! :-) [No text] - Valentin Albillo - 06-14-2006

Best regards from V.