Dc b a – HP 35s Scientific Calculator User Manual

Page 213

Advertising
background image

Programming Techniques

14-3

MAIN program
(Top level)

End of program

Attempting to execute a subroutine nested more than 20 levels deep causes an 
 error.

Example:

A Nested Subroutine.

The following subroutine, labeled S, calculates the value of the expression

as part of a larger calculation in a larger program. The subroutine calls upon
another subroutine (a nested subroutine), labeled Q, to do the repetitive squaring
and addition. This saves memory by keeping the program shorter than it would be
without the subroutine.

2

2

2

2

d

c

b

a

+

+

+

Advertising