Google
 

Trailing-Edge - PDP-10 Archives - decuslib20-02 - decus/20-0035/algol4.met
There are 2 other files named algol4.met in the archive. Click here to see a list.
00100	.SUBSYNTAX BUILTIN
00200	
00300	.INTERNAL BLTINPROC,BLTININT,BLTINSTR,BLTINBOOL
00400	.EXTERNAL AC,STRTMP,STRSTORE,STREXPR,INTEXPR
00500	
00600	ERROR: "(" STREXPR ")"
00700	 .OUT("ERROR"-"%0");
00800	
00900	OPENIN: "(" INTEXPR "," [AC:=1] STREXPR ")"
01000	 .OUT("OPENI"-"%2,%0") .OUT("JUMP");
01100	
01200	OPENOUT: "(" INTEXPR "," [AC:=1] STREXPR ")"
01300	 .OUT("OPENO"-"%2,%0") .OUT("JUMP");
01400	
01500	CLOSE: "(" INTEXPR ")"
01600	 .OUT("CLOSEF"-"%0");
01700	
01800	LENGTH: "(" [*:=AC+1] %2 [AC:=(AC+2)/2*2-1] STREXPR ")"
01900	 .OUT("HLRZ"-"%"^2%2*",%"[*:=AC]*"+1") ^2 [AC:=*];
02000	
02100	LINENO: "(" INTEXPR ")"
02200	 .OUT("GETLN"-"%"[*:=AC]*",%"*);
02300	
02400	DATE: [AC:=AC+1] .IF(AC.LE.7)
02500	 .OUT("DATE"-"%"[*:=AC]*",");
02600	
02700	MSTIME: [AC:=AC+1] .IF(AC.LE.7)
02800	 .OUT("MSTIME"-"%"[*:=AC]*",");
02900	
03000	RUNTIME: [AC:=AC+1] .IF(AC.LE.7)
03100	 .OUT("MOVEI"-"%"[*:=AC]*",0")
03200	 .OUT("RUNTIM"-"%"*",");
03300	
03400	JOBNO: [AC:=AC+1] .IF(AC.LE.7)
03500	 .OUT("PJOB"-"%"[*:=AC]*",");
03600	
03700	PPNO: [AC:=AC+1] .IF(AC.LE.7)
03800	 .OUT("GETPPN"-"%"[*:=AC]*",")
03900	 .OUT("JUMP");
04000	
04100	OUTLINE: "(" INTEXPR "," INTEXPR ")"
04200	 .OUT("PUTLN"-"%1,%0");
04300	
04400	STATUS: "(" [*:=AC+1] %2 (.IF(AC.LT.0) [AC:=0]/.EMPTY) INTEXPR ")"
04500	 .OUT("JUMPLE"-"%"[*:=AC]*",.+2") .OUT("CAILE"-"%"*",^D25")
04600	 .OUT("ERROR"-"[EXP <POINT 7,[ASCII/STATUS SUBSCRIPT > 25 OR < 1/]>,"
04700	  "<XWD ^D28,0>]")
04800	 .OUT("MOVE"-"%"^2%2*",%STAT-1(%"[*:=AC]*")") ^2 [AC:=*];
04900	
05000	OUTPUT: "(" INTEXPR "," [AC:=1] STREXPR ")"
05100	 .OUT("WRITE"-"%2,%0");
05200	
05300	INPUTS: "(" [AC:=AC+2] INTEXPR "," INTEXPR ")" [AC:=AC-3]
05400	 .IF(AC.LE.4) .OUT("MOVSI"-"%"[*:=AC]*",(POINT 7,0)")
05500	 .OUT("HRLZI"-"%"*"+1,(%"[*:=AC+3]*")")
05600	 .OUT("ASTRG"-"%"[*:=AC]*)
05700	 .OUT("READV"-"%"*",%"[*:=AC+2]*);
05800	
05900	INPUTB: "(" [AC:=AC+2] INTEXPR "," INTEXPR ")" [AC:=AC-3]
06000	 .IF(AC.LE.4) .OUT("MOVSI"-"%"[*:=AC]*",(POINT 1,0)")
06100	 .OUT("HRLZI"-"%"*"+1,(%"[*:=AC+3]*")")
06200	 .OUT("ASTRG"-"%"[*:=AC]*)
06300	 .OUT("READV"-"%"*",%"[*:=AC+2]*);
06400	
06500	BREAK: "(" [AC:=AC+2] INTEXPR [AC:=AC-2] ")"
06600	 .OUT("MOVSI"-"%"[*:=AC]*",(POINT 7,0)")
06700	 .OUT("MOVSI"-"%"*"+1,1")
06800	 .OUT("ASTRG"-"%"*)
06900	 .OUT("GETBK"-"%"*",%"[*:=AC+2]*);
07000	
07100	SLEEP: "(" INTEXPR ")"
07200	 .OUT("SLEEP"-"%0,");
07300	
07400	RUN: "(" STREXPR ")"
07500	 .OUT("ADDI"-"%"[*:=AC]*",(%"*"+1)")
07600	 .OUT("PUSH"-"%P,%"*)
07700	 .OUT("PUSH"-"%P,%"*"+1")
07800	 .OUT("HLRZS"-"(%P)")
07900	 #1"%RUN" ^1 .LOOK .SET 23
08000	 .OUT("CALLUO"-"$"B#"."S#);
08100	
08200	SETBREAK: "(" INTEXPR .OUT("CLRBK"-"%0") [AC:=1]
08300	 "," STREXPR .OUT("BKIGNR"-"%2,%0") [AC:=1]
08400	 "," STREXPR .OUT("BKKEEP"-"%2,%0") [AC:=1]
08500	 "," STREXPR ")" .OUT("BKLEAV"-"%2,0");
08600	
08700	STRBIT: "(" STREXPR ")" STRSTORE [AC:=AC+1] .IF(AC.LE.4)
08800	 .OUT("TRZ"-"%"[*:=AC]*"+1,777777")
08900	 .OUT("IMULI"-"%"*"+1,7")
09000	 .OUT("MOVSI"-"%"*",(POINT 1,0)")
09100	 .OUT("ASTRG"-"%"*) ^1 .LOOKC [STRTMP:=STRTMP-1]
09200	 .OUT("SMOVE"-"%"[*:=AC]*",$"B#"."S#"(%B)")
09300	 .OUT("HLLZS"-"$"B#"."S#"(%B)");
09400	
09500	INTBIT: "(" INTEXPR "," INTEXPR ")" [AC:=AC-1]
09600	 .IF(AC.LE.4) .OUT("PUSH"-"%P,%"[*:=AC]*)
09700	 .OUT("PUSH"-"%P,[POINT 1,(%"*"+1)]")
09800	 .OUT("PUSH"-"%P,%"*"+1")
09900	 .OUT("HRLZS"-"%"*"+1")
10000	 .OUT("MOVSI"-"%"*",(POINT 1,0)")
10100	 .OUT("ASTRG"-"%"*)
10200	 .OUT("CALLUO"-"%INTBI");
10300	
10400	BITSTR: "(" STREXPR ")" STRSTORE [AC:=AC+1] .IF(AC.LE.4)
10500	 .OUT("ADD"-"%"[*:=AC]*"+1,[XWD 6,0]")
10600	 .OUT("IDIVI"-"%"*"+1,7")
10700	 .OUT("TRZ"-"%"*"+1,777777")
10800	 .OUT("MOVSI"-"%"*",(POINT 7,0)")
10900	 .OUT("ASTRG"-"%"*) ^1 .LOOKC [STRTMP:=STRTMP-1]
11000	 .OUT("SMOVE"-"%"[*:=AC]*",$"B#"."S#"(%B)")
11100	 .OUT("HLLZS"-"$"B#"."S#"(%B)");
11200	
11300	BITINT: "(" [*:=AC+1] %2 [AC:=(AC+2)/2*2-1] STREXPR ")"
11400	 .OUT("ADDI"-"%"[*:=AC]*",(%"*"+1)")
11500	 .OUT("PUSH"-"%P,%"*)
11600	 .OUT("PUSH"-"%P,%"*"+1")
11700	 .OUT("HLRZS"-"(%P)")
11800	 .OUT("CALLUO"-"%BITIN") ^2 [AC:=*]
11900	 .OUT("POP"-"%P,%"*);
12000	
12100	INTSTR: "(" INTEXPR "," INTEXPR ")" [AC:=AC-1]
12200	 .IF(AC.LE.4) .OUT("PUSH"-"%P,%"[*:=AC]*)
12300	 .OUT("PUSH"-"%P,[POINT 7,(%"*"+1)]")
12400	 .OUT("PUSH"-"%P,%"*"+1")
12500	 .OUT("HRLZS"-"%"*"+1")
12600	 .OUT("MOVSI"-"%"*",(POINT 7,0)")
12700	 .OUT("ASTRG"-"%"*)
12800	 .OUT("CALLUO"-"%INTST");
12900	
13000	STRINT: "(" [*:=AC+1] %2 [AC:=(AC+2)/2*2-1] STREXPR ")"
13100	 .OUT("ADDI"-"%"[*:=AC]*",(%"*"+1)")
13200	 .OUT("PUSH"-"%P,%"*)
13300	 .OUT("PUSH"-"%P,%"*"+1")
13400	 .OUT("HLRZS"-"(%P)")
13500	 .OUT("CALLUO"-"%STRIN") ^2 [AC:=*]
13600	 .OUT("POP"-"%P,%"*);
13700	
13800	ENTRY: [AC:=AC+1] .IF(AC.LE.7)
13900	 .OUT("MOVE"-"%"[*:=AC]*",%ENTRY");
14000	
14100	ENDFILE: "(" INTEXPR ")"
14200	 .OUT("EFILE"-"%"[*:=AC]*)
14300	 .OUT("TLZA"-"%"*",777777")
14400	 .OUT("TLO"-"%"*",777777");
14500	
14600	OPEN: "(" INTEXPR ")"
14700	 .OUT("PUSH"-"%P,%"[*:=AC]*)
14800	 .OUT("CALLUO"-"%OPENT")
14900	 .OUT("TLZA"-"%"*",777777")
15000	 .OUT("TLO"-"%"*",777777");
15100	
15200	BLANKS: "(" INTEXPR ")" [*:=AC] 
15300	 .OUT("MOVSI"-"%"*"+1,(%"*")") .OUT("MOVSI"-"%"*",(POINT 7,0)")
15400	 .OUT("ASTRG"-"%"*) .OUT("SMOVE"-"%"*",[EXP <POINT 7,0>,0]");
15500	
15600	ZEROES: "(" INTEXPR ")" [*:=AC]
15700	 .OUT("MOVSI"-"%"*"+1,(%"*")") .OUT("MOVSI"-"%"*",(POINT 1,0)")
15800	 .OUT("ASTRG"-"%"*);
15900	
16000	COPY: "(" STREXPR ")" STRSTORE [AC:=AC+1] [*:=AC]
16100	 .OUT("TRZ"-"%"*"+1,777777") .OUT("AND"-"%"*",[XWD 7700,0]")
16200	 .OUT("TLO"-"%"*",440000") .OUT("ASTRG"-"%"*)
16300	 .OUT("SMOVE"-"%"*",$"B#"."S#"(%B)")
16400	 .OUT("HLLZS"-"$"B#"."S#"(%B)") [STRTMP:=STRTMP-1];
16500	
16600	BLTINPROC:
16700	 .CHECK 26 SET ERROR / .CHECK 27 SET OUTPUT /
16800	 .CHECK 28 SET OPENIN / .CHECK 29 SET OPENOUT /
16900	 .CHECK 30 SET CLOSE / .CHECK 31 SET SETBREAK /
17000	 .CHECK 32 SET OUTLINE / .CHECK 33 SET SLEEP /
17100	 .CHECK 34 SET RUN ;
17200	
17300	BLTININT:
17400	 .CHECK 26 SET LINENO / .CHECK 27 SET LENGTH /
17500	 .CHECK 28 SET STRINT / .CHECK 29 SET STATUS /
17600	 .CHECK 30 SET BITINT / .CHECK 31 SET DATE /
17700	 .CHECK 32 SET MSTIME / .CHECK 33 SET RUNTIME /
17800	 .CHECK 34 SET JOBNO / PPNO ;
17900	
18000	BLTINSTR:
18100	 .CHECK 26 SET BREAK / .CHECK 27 SET BITSTR /
18200	 .CHECK 28 SET STRBIT / .CHECK 29 SET INTBIT /
18300	 .CHECK 30 SET INPUTS / .CHECK 31 SET INTSTR /
18400	 .CHECK 32 SET INPUTB / .CHECK 33 SET BLANKS /
18500	 .CHECK 34 SET ZEROES / COPY ;
18600	
18700	BLTINBOOL:
18800	 .CHECK 26 SET ENTRY / .CHECK 27 SET ENDFILE /
18900	 .CHECK 28 SET OPEN ;
19000	
19100	.END