`
P2 符号つき長語の小数印刷ルーチン
P2 Print one signed decimal in 0oL (without layout or round off)
`Closed; Self setting; 36 storage locations;
Time is determined by typing speed.
Prints the signed number in 0oL to H places of decimals, leaving R
10^{H}
in R register where R is the remainder. H is determined by a preset
parameter. Each number is preceded by a decimal point and followed by
a sign.
__Preset parameter:__
0h = H Number of digits to be printed.
Notes: 1. For example, 0 is printed, if H is 10, as
.0000000000+
and -0.5 as
.5000000000-.
-1 will be printed as
.0000000000-.
2. Before P2 is called in, digit position r_{0}$ must be cleared.
3. The output tape perforated by P2 less than ten digits may
be used as an input tape for use with R1. In this case,
however, no space should be placed between numbers.
Author: WADA, E.
Date: 58-09-16
0p: a 12r
1 CR t Print a decimal point
2 x 35r Plant link
3 plo ┐Load the number in
4 rl 35 ┘R register
5 kl 18r Test sign
6 nlo Change sign
7 rl 35 Load the number in
8 p 9r R register
9 jl 19r
10 | 139264 ┐
11 | 143360 │table of
12 | J 2 │characters
13 | s 10 x 2^{-4}
14 | g ( ) Counter │
15 | LTRS h │
16 | 155648 │
17 | f 10r Base order│
18 p 22r Store address to select
19 x 33r a code of sign┘
20 p 15r
21 x 14r Store counter
22 q 22r Shift the number to acc.
23 v 13r ┐Multiply by 10 x 2^{-17}
24 rl 13 ┘
25 a 17r Add base order
26 x 27r ┐Select the code
27 a ( ) ┘
28 CR t Print a digit
29 rl 18 Store fraction in R register
30 a 14r Subtract 1 from counter
31 z 33r Test count
32 jl 21r
33 a ( ) Print sign
34 CR t &
35 jl ( )} Link