dos_compilers/RHA (Minisystems) ALGOL v55/ALIB.SRC

121 lines
2.3 KiB
Plaintext
Raw Normal View History

2024-07-06 18:53:43 +02:00
'DIRECTIVE' P;
'BEGIN'
'INTEGER''PROCEDURE' CPM(N,DE); 'VALUE' N,DE;
'INTEGER' N,DE; IOC(48);
'PROCEDURE' ERROR(L);
'LABEL' L; IOC(23);
'INTEGER' 'PROCEDURE' LOCATION(I);
'VALUE' I; 'REAL' I; IOC(24);
'INTEGER' 'PROCEDURE' RBLOCK(C,A,B,N);
'VALUE' C,A,B,N; 'INTEGER' C,A,B,N; IOC(26);
'INTEGER' 'PROCEDURE' WBLOCK(C,A,B,N);
'VALUE' C,A,B,N; 'INTEGER' C,A,B,N; IOC(27);
'INTEGER' 'PROCEDURE' FSPACE;
IOC(29);
'PROCEDURE' SETI(A);
'VALUE' A; 'INTEGER' A; IOC(30);
'PROCEDURE' SETO(A);
'VALUE' A; 'INTEGER' A; IOC(31);
'INTEGER' 'PROCEDURE' IPOINT;
IOC(32);
'INTEGER' 'PROCEDURE' OPOINT;
IOC(33);
'INTEGER' 'PROCEDURE' EXFLT(A,T);
'VALUE' A,T; 'INTEGER' A,T; IOC(34);
'PROCEDURE' BLMOVE(S,D,L);
'VALUE' S,D,L; 'INTEGER' S,D,L; IOC(35);
'INTEGER' 'PROCEDURE' SWLIST;
IOC(39);
'INTEGER' 'PROCEDURE' FINDINPUT(S);
'STRING' S;
'BEGIN' GETLIST(S); IOC(5);
FINDINPUT:=INPUT; IOC(1)
'END';
'INTEGER' 'PROCEDURE' FINDOUTPUT(S);
'STRING' S;
'BEGIN' GETLIST(S); IOC(3);
FINDOUTPUT:=OUTPUT; IOC(1)
'END';
'PROCEDURE' GETLIST(S);
'STRING' S;
'BEGIN' 'INTEGER' I;
IOC(0); IOC(1); TEXT(7,S);
CHOUT(7,0);
I:=CHIN(7);
'IF' I=&? 'THEN'
'BEGIN' 'FOR' I:=CHIN(7) 'WHILE'
I#0 'DO' CHOUT(1,I);
I:=CHIN(7)
'END';
IOC(0);
'END';
'PROCEDURE' OUT(C,V);
'VALUE' C,V; 'INTEGER' C,V; IOC(52);
'PROCEDURE' ATEXT(D,A);
'VALUE' D,A; 'INTEGER' D,A; IOC(53);
'INTEGER' 'PROCEDURE' TLEN(A);
'VALUE' A; 'INTEGER' A; IOC(54);
'INTEGER' 'PROCEDURE' SLOC(S);
'STRING' S; IOC(55);
'INTEGER' 'PROCEDURE' SMATCH(L,S);
'VALUE' L,S; 'INTEGER' L,S; IOC(56);
'PROCEDURE' POINT(X,Y,Z);
'VALUE' X,Y,Z; 'INTEGER' X,Y,Z; IOC(61);
'PROCEDURE' CHPOS(X,Y);
'VALUE' X,Y; 'INTEGER' X,Y; IOC(62);
'PROCEDURE' LINE(XC,YC,DX,DY,Z);
'VALUE' XC,YC,DX,DY,Z; 'INTEGER' XC,YC,DX,DY,Z;
'BEGIN' 'INTEGER' I,R,S,SX,SY,SXX,SYY,M,XX,YY;
DX:=DX-XC; DY:=DY-YC;
XX:=ABS(DX); YY:=ABS(DY);
SXX:=SIGN(DX); SYY:=SIGN(DY);
'IF' XX>YY 'THEN'
'BEGIN' M:=XX; R:=XX%2; S:=YY;
SX:=SXX; SY:=0;
'END' 'ELSE'
'BEGIN' M:=YY; R:=YY%2; S:=XX;
SX:=0; SY:=SYY;
'END' ;
POINT(XC,YC,Z);
'FOR' I:=1 'STEP' 1 'UNTIL' M 'DO'
'BEGIN' R:=R-S;
'IF' R<0 'THEN'
'BEGIN' XC:=XC+SXX;
YC:=YC+SYY;
R:=R+M
'END' 'ELSE'
'BEGIN' XC:=XC+SX;
YC:=YC+SY
'END' ;
POINT(XC,YC,Z)
'END'
'END' ;
'END''FINISH'