comment A1;
procedure open(dv); value dv; integer dv;
kdf9 2/1/1/0;
{dv}; JSP293; exit
P293V40; ( Open );
V0 = Q 0/AV1/AV40;
SET20; NEV; J1=Z; EXIT1; (+ interim version only devs 20 and 30 allowed );
1; V0; =Q15; SET2; SET5; OUT; =C15; (+ Max amount of data is 320 chars );
PREQ15; PARQ15; C15; SET6; OUT;
I15; =RM15; M-I15; Q15; =V0P295;
EXIT1;
P295V0; ( General Character and Basic Symbol Handling );
4; (+ initialise basic symbol fetch );
ERASE; EXIT1; (+ assume dv = 20 );
6; ZERO; SET6; SET5; J109P299; (+ fetch basic symbol );
8; ZERO; SET8; SET5; J109P299; (+ freeze basic symbol fetch );
10; SET10; SET5; J109P299; (+ retain basic symbol );
3; (+ initialise character fetch );
ERASE; (+ assume dv = 20 );
V0; DUP; JP299=Z;
=Q15; EXIT1;
5; J52C15NZ; (+ fetch character );
M+I15; SET-48; =C15;
52; SET6; =+C15; M0M15; SHLC15; SETB77; AND;
EXIT1;
7; (+ freeze character fetch );
Q15; =V0; EXIT1;
9; SET9; SET5; J108P299; (+ retain character );
11; SET11; SET5; J108P299; (+ initialise character output );
12; SET12; SET5; J108P299; (+ initialise basic symbol output );
13; SET13; SET5; J108P299; (+ output character );
14; ZERO; SET14; SET5; J108P299; (+ output basic symbol );
15; ZERO; SET15; SET5; J108P299; (+ freeze character output );
16; SET16; SET5; J108P299; (+ freeze basic symbol output );
18; SET18; SET5; J108P299; (+ output editing symbol );
116;SET116; SET5; J108P299; (+ output characters with automatic case management );
algol
procedure close(dv); value dv; integer dv;
kdf9 2/0/1/0;
{dv}; JSP292; exit (+ P292 is missing from KQX9101, so it is in runtime2.txt );
algol
comment A4;
real procedure read(dv); value dv; integer dv;
kdf9 12/9/14/0;
{dv}; JSP294; exit
P294V1; ( Read Number );
V1=F0.1;
JS3P295; (+ initialise character fetch );
SETB2014; =V0; ZERO;
1; ERASE; JS5P295; SETB35; J2=; SETB36; J3=; SETB37; J4=;
SETB20; -; DUP; J1<Z; (+ skip space etc );
DUP; SET10; -; J1>=Z; (+ skip non-digits );
ZERO;
5; ERASE;
51; JS5P295; SETB20; -; DUP; J5<Z; (+ skip spaces etc );
DUP; SET10; -; J6>=Z; (+ non-digits terminate );
REV; SET10; ×D; CONT; +; J51;
3; SETB6000; = V0;
2; ERASE; ZERO; J51;
6; SETB17; NEV; J7=Z; (+ decimal point );
SET47; FLOAT;
8; V0; SHC-12; ×F; ; (+ incorporate sign );
J7P295; (+ freeze character fetch and exit );
4; ERASE; ZERO; (+ starts with decimal point );
7; SET47; FLOAT;
SETB2014; SHC-12; ZERO; ZERO; (+ N1/2 rubbish, N3 multiplier of previous digit, N4 accumulated number );
9; ERASE; ERASE;
10; V1; ×F; DUP; PERM; JS5P295;
SETB20; -; DUP; J9<Z; (+ skip space etc );
DUP; SET10; -; J11>=Z; (+ terminator );
SET47; FLOAT; ×F; +F;
REV; J10;
11; ERASE; ERASE; REV; ERASE; J8;
algol
real procedure read boolean(dv); value dv; integer dv;
kdf9 12/9/14/0;
{dv}; SET4; SET99; JP299; exit
algol
comment A5;
real procedure write(dv, form, value); value dv, form, value;
integer dv, form; real value;
kdf9 12/9/14/0;
{value}; {form}; {dv}; JSP291; exit
P291V12; ( Write );
(+ interim version -- ignores format info );
V3=Q0/AV0/AV2;
V4=B2020203720200200;
V5=B1212120112120101;
V6=100;
V7=B2037202020200200;
V8=B1201121212120101;
V9=10000;
V10=F10.0;
V11=F0.1;
V12=B7777774535202002;
ERASE; ERASE; (+ remove dv and form );
SETB30; =V0;
M0TOQ15; DUP; ABSF; V10; -F;
J1>=Z; SET3; =M15;
1; DUP;
V5M15; REV; DUP;
STR; NEG; SETB35; +; (make sign);
REVD; ABSF; FIX;
=C15; V6M15; ×D; SHADC15;
ROUND; FRB; J2V;
V4M15; OR; REV; SHLD-6; ERASE; =V1;
V3; NEG; NOT; SET8; OUT; ERASE; ERASE; EXIT1;
2; ( big number );
ERASE; PERM; ERASE; (num in N1, sign in N2);
C0TOQ15; ABSF;
3; V11; ×F; DC15; DUP; V10; -F; J3>=Z;
V5; C15; NEG; FRB; SHL-6; V12; OR; =V2; (Exponent);
FIX; =C15; V9; ×D; SHADC15;
ROUND; V8; REV; FRB; V7; OR; REV; SHLD-6; ERASE; SETB77; OR; =V1;
V3; SET8; OUT;
EXIT1;
algol
integer procedure format(layout);
string layout;
kdf9 12/9/14/6;
exit ( reault is ignored at present );
algol
procedure output(dv, v);
comment intial version to print numbers with 6 digits or less;
value dv, v;
integer dv; real v;
kdf9 12/9/14/0;
V0=B0013573703034651;
{v}; V0; {dv}; JSP291; exit
algol
procedure write boolean(dv, boolean);
value dv, boolean;
integer dv; boolean boolean;
kdf9 12/9/14/0;
{boolean}; {dv}; SET1; SET99; JP299; exit
algol
comment A15;
procedure writetext(dv, s);
value dv;
integer dv; string s;
kdf9 12/9/14/0;
{s}; {dv}; JSP288; exit
P288; ( write text );
ERASE; (+ ignore device number for new );
SETB30; =Y0M2; (+ always output on stream 30 for now );
SETAY0; M2; +; DUP; PERM; NOT; NEG;
JSP700;
=I15;
C0TOQ15; Q15; SET8; OUT; EXIT1;
algol
**** library incorporation ends here, because we get crashes with too many routines -- or something
comment A14;
procedure copytext(indv, outdv, fromto);
value indv, outdv;
integer indv, outdv; string fromto;
kdf9 12/9/14/0;
{fromto}; {outdv}; {indv}; MRWDQ0; exit
algol
comment this next lot is just for mag tape;
comment or are they specific to KQX910103APU;
comment or were they in library A30;
comment A7;
procedure find(dv, name); value dv;
integer dv; string name;
kdf9 12/9/14/0;
{name}; {dv}; MRWDQ0; exit
algol
procedure interchange(dv); value dv;
integer dv;
kdf9 12/9/14/0;
{dv}; MRWDQ0; exit
algol
procedure dataskip(dv); value dv;
integer dv;
kdf9 12/9/14/0;
{dv}; MRWDQ0; exit
algol
procedure rewind(dv); value dv;
integer dv;
kdf9 12/9/14/0;
{dv}; MRWDQ0; exit
algol
boolean procedure btc(dv); value dv;
integer dv;
kdf9 12/9/14/0;
{dv}; MRWDQ0; exit
algol
boolean procedure etw(dv); value dv;
integer dv;
kdf9 12/9/14/0;
{dv}; MRWDQ0; exit
algol
comment A8;
procedure read binary(dv, array, name); value dv;
array array; string name; integer dv;
kdf9 12/9/14/0;
{name}; {array}; {dv}; MRWDQ0; exit
algol
procedure skip(dv, value); value dv, value;
integer dv, value;
kdf9 12/9/14/0;
{value}; {dv}; MRWDQ0; exit
algol
comment A9;
procedure write binary(dv, array, name); value dv;
array array; string name; integer dv;
kdf9 12/9/14/0;
{name}; {array}; {dv}; MRWDQ0; exit
algol