This chapter contains 20 programs for your HP-28S. These programs
are useful and, more importantly, they demonstrate a variety of pro-
gramming techniques. For each program you'll find the following
• Stack Diagram. A stack diagram is a two-column table showing
"Arguments" and "Results". "Arguments" shows what must be on
the stack before the program is executed; "Results" shows what the
program leaves on the stack.
The stack diagram doesn't show everything; a program that
changes user memory or displays objects might have no effect on
• Techniques. This is the most interesting part. When you understand
how a technique is used in this chapter, you can use it in your own
• Required Programs. Some programs call others as subroutines. You
can enter the required programs and the calling program in any
order, but you must enter all of them before executing the calling
• Program and Comments. This chapter formats the program listing
to show a program's structure and process. You don't need to fol-
low the format of the listing when you enter a program. However,
be sure to key in spaces where they appear in the listing or be-
tween objects appearing on separate lines.
You can key in a program character by character, or you can use
the menus to key it in command by command.
makes no differ-
ence as long as the result matches the listing.
28: Programming Examples