Download Print this page

HP 35s User Manual page 3

Scientific calculator - programming using line numbers
Hide thumbs Also See for 35s:

Advertisement

hp calculators
HP 35s Programming using line numbers
In detail, the HP 35s handles changes in a program containing line number GTO and/or XEQ instructions as follows:
Edit performed
A step is inserted before a GTO or XEQ instruction
A step is deleted before a GTO or XEQ instruction
The step pointed to by a GTO or XEQ instruction is deleted
The HP 35s now offers the ability to take advantage of a large program memory capacity, limited only by a user's
imagination.
Example 1: Rewrite the program from page 14-4 of the HP 35s User's Guide to use only one label. Use line numbers
for all transfer instructions.
Solution:
The program as presented on page 14-4 looks like this:
S001 LBL S
S002 INPUT A
S003 INPUT B
S004 INPUT C
S005 INPUT D
S006 RCL D
S007 RCL C
Steps S011 through S013 would need to be changed to point at the step after S015 RTN. Since we will be
removing the LBL Q instruction, steps previously labeled Q002 through Q005 will now be right after step
S015 RTN. They would now be labeled S016 through S019. The XEQ instructions found at steps S011
through S013 should now point to step S016. The revised program using only one label is shown below.
S001 LBL S
S002 INPUT A
S003 INPUT B
S004 INPUT C
S005 INPUT D
S006 RCL D
S007 RCL C
The program is not only one total line shorter but uses only one label. Consistent use of line number GTO
and XEQ instructions allows for better utilization of the 26 letter labels.
hp calculators
HP 35s program dynamically changed so that
All GTO and XEQ instructions are renumbered to point to
the revised (higher step number) location
All GTO and XEQ instructions are renumbered to point to
the revised (lower step number) location
Any GTO or XEQ instructions continue to point to the
same instruction. The instruction that now fills the
previous step number is the destination of the transfer
instruction.
S008 RCL B
S009 RCL A
2
S010 X
S011 XEQ Q001
S012 XEQ Q001
S013 XEQ Q001
S014 SQRT
S008 RCL B
S009 RCL A
2
S010 X
S011 XEQ S016
S012 XEQ S016
S013 XEQ S016
S014 SQRT
- 3 -
S015 RTN
Q001 LBL Q
Q002 X <> Y
2
Q003 X
Q004 +
Q005 RTN
S015 RTN
S016 X <> Y
2
S017 X
S018 +
S019 RTN
HP 35s Programming using line numbers - Version 1.0

Advertisement

loading