Trailing-Edge
-
PDP-10 Archives
-
decuslib20-04
-
decus/20-0115/twosid.bli
There are 2 other files named twosid.bli in the archive. Click here to see a list.
00100 MODULE TWOSID(VERSION=1(1),STACK)=BEGIN
00200
00300 ! .MEM to be able to use two sides of the paper (.LFT and .RGT)
00400 %(Revision History:
00500 0 28 Feb 77 Creation
00600 1 16 Mar 77 Allow /RIGHT:n
00700 )%
00800
00900 MACHOP IN=#56,OUTPUT=#67,OPEN=#50,CLOSE=#70,LOOKUP=#76,ENTER=#77,JRST=#254,
01000 % 1% TTCALL=#51, CALLI=#47;
01100 MACRO HALT(nil)=JRST(4,0)$,
01200 % 1% ?RESET.(nil)=CALLI(0)$,
01300 % 1% ?EXIT.(nil)=CALLI(0,10)$,
01400 % 1% complain(str)=(TTCALL(3,PLIT ASCIZ str); HALT())$,
01500 INCHWL(adr)=TTCALL(4,adr)$,
01600
01700 % 1% thenb=THEN BEGIN$, elseb=END ELSE BEGIN$, fi=END$,
01800 % 1% loop=DO BEGIN$, repeat=END$;
01900
02000 REGISTER ch; !The current character
02100
02200 OWN hI:hR:hL[3], !Buffer headers
02300 io[4], !For lookups and enters
02400 % 1% right; !For switch value /RIGHT:n
02500
02600 BIND pt=1,ct=2, !Within buffer header
02700 LF=#12,FF=#14,CR=#15, !Special characters
02800 I=0,R=1,L=2; !I/O channels
02900
03000 ROUTINE getchr= !Get a character from input
03100 BEGIN
03200 WHILE (hI[ct]_.hI[ct]-1) LSS 0
03300 loop IFSKIP IN(I)
03400 thenb CLOSE(I);
03500 CLOSE(R);
03600 CLOSE(L);
03700 ?EXIT.();
03800 fi;
03900 repeat;
04000 ch_SCANI(hI[pt])
04100 END;
04200
04300 ROUTINE putchR=
04400 BEGIN
04500 IF (hR[ct]_.hR[ct]-1) LEQ 0
04600 thenb OUTPUT(R)
04700 fi;
04800 REPLACEI(hR[pt],.ch)
04900 END;
05000
05100 ROUTINE putchL=
05200 BEGIN
05300 IF (hL[ct]_.hL[ct]-1) LEQ 0
05400 thenb OUTPUT(L)
05500 fi;
05600 REPLACEI(hL[pt],.ch)
05700 END;
05800
05900 ROUTINE overL= % 1 % !Space over /RIGHT distance
06000 BEGIN REGISTER j;
06100 j_.ch; ch_" ";
06200 DECR i FROM .right TO 1 DO
06300 putchL();
06400 ch_.j
06500 END;
06600
06700 ROUTINE overR= % 1 % !Space over /RIGHT distance
06800 BEGIN REGISTER j;
06900 j_.ch; ch_" ";
07000 DECR i FROM .right TO 1 DO
07100 putchR();
07200 ch_.j
07300 END;
07400
07500 ROUTINE pageR=
07600 loop getchr();
07700 % 1% IF ..hR[pt] EQL #12 !Line feed
07800 % 1% thenb IF .ch GEQ " " !then printable
07900 % 1% thenb overR();
08000 % 1% fi; fi;
08100 putchR();
08200 repeat WHILE .ch NEQ FF;
08300
08400 ROUTINE pageL=
08500 loop getchr();
08600 % 1% IF ..hL[pt] EQL #12 !Line feed
08700 % 1% thenb IF .ch GEQ " " !followed by printable
08800 % 1% thenb overL();
08900 % 1% fi; fi;
09000 putchL();
09100 repeat WHILE .ch NEQ FF;