
Section 9: Subroutines 103
MAIN PROGRAM
Brings x
1
into X; x
2
into Y.
x
1
.
Return from s
Brings x
2
into X-register.
Transfer to subroutine with x
2
.
Recalls (x
2
– x
1
) from R
0
and
calculates (y
2
- y
1
)/(x
2
- x
1
).
Program end (return to line 000).
x
2
sin x, which equals y.
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.
Komentáře k této Příručce