Section 9: Subroutines 103
MAIN PROGRAM
|
¥
´
CLEAR
M
´
b
9
|
R
O
0
2
0
®
O
-
0
2
1
0
G
.3
Transfer to subroutine “.3” with
1
Return from subroutine “.3”.
”
1
®
G
.3
Transfer to subroutine with
2
Return from subroutine “.3”.
+
l
÷
0
2
1
0
calculates (y
− y
)/ (x
− x
).
|
n
Program end (return to line 000).
SUBROUTINE
´
b
.3
|
x
|
K
[
-
|
n
Return to origin in main program.
Calculate the slope for the following values of x
1
and x
2
: 0.52, 1.25; −1, 1;
0.81, 0.98. Remember to use G 9 (rather than ´ 9) when addressing
a routine with a digit label.
Answers: 1.1507; −0.8415; 1.1652.