Post Reply 
(35S) Fibonacci Fun for the HP35s and the number phi
01-22-2015, 10:56 AM
Post: #4
RE: Fibonacci Fun for the HP35s and the number phi
Keeping your program structure but optimizing it for the 35s feature set, you can do:

Code:
F001  LBL F
F002  0.002               ( this sets up DSE counter register mantissa – step is 1 by default
F003  STO C               ( iterative counter
F004  CLSTK
F005  4                   ( default  nth  Fibonacci number (3)   1 1 2 3
F006  STOP                ( get operator a chance to change the default
F007  STO+ C              ( sets the final counter   4.00201
F008  CLx
F009  1                   (begin  1 1  setup
F010  REGX
F011  REGX+REGY           (calculate Fn+1   
F012  DSE C               (decrement the counter and prepare to loop back
F013  GTO F011            (loop
F014  STOP                (display nth Fibonacci ;   stack holds last four Fibs
F015  REGX+REGY           (begin automated continue with PSE
F016  PSE
F017  GTO F015            (loop ad infinitum, or until boredom
  • Step F002: for the DSE counter step is 1 by default, no need to specify it
  • Step F004: by moving the CLSTK here you don’t need anymore the CLx
  • Step F010 is to duplicate register X : REGX is accessed by [YellowShift][Mem][RDN] then select X with the left Arrow and [ENTER]
  • Step F011 and step F015 are entered as equations: [EQN][enter REGX as explained above][+][enter REGY][ENTER], they replace XEQ F020 and the subroutine.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Fibonacci Fun for the HP35s and the number phi - Didier Lachieze - 01-22-2015 10:56 AM



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