Trailing-Edge
-
PDP-10 Archives
-
decuslib20-01
-
decus/20-0016/scan.mac
There are 38 other files named scan.mac in the archive. Click here to see a list.
00100 TITLE SCAN -- GENERAL PURPOSE ADAPTER FOR LISP SCANNER
00200
00300 ; MODIFIED JULY 6,1972 TO PERMIT:
00400 ; 1) SLASHIFIED COMMENT-CHAR.
00500 ; 2) COMMENT-CHAR AS LETTER W/I STRING.
00600
00700
00800 A=1
00900 B=2
01000 C=3
01100 T=6
01200 R=13
01300 P=14
01400
01500 CR=15
01600 LF=12
01700 TAB=11
01800
01900 IGCRLF=32
02000 INUM0=577777
02100
02200 EXTERNAL CHRTAB,IGSTRT,RATOM,OLDCH,FIX1A,NOINFG,SCNVAL,TYI
02300
02400 INTERNAL SCAN,UNTYI,SCANSET,SCANRESET,SCANINIT,LETTER,IGNORE,DISIGNORE
02500
02600
02700 TYID= TYI+11
02800 RATAB= RATOM+7
02900 IDTAB= RATOM+60
03000 RDFLD= IGSTRT+7
03100
03200
03300 OLDSCN: IGCRLF ;IGSTRT
03400 LF ;IGEND
03500 POINT 4,CHRTAB(A),5 ;RATFLD
03600 POINT 2,CHRTAB(A),10 ;STRFLD
03700 POINT 3,CHRTAB(A),13 ;IDFLD
03800
03900 IGST2: 0 ;IGSTRT
04000 IGEND2: 0 ;IGEND
04100 RATF2: POINT 4,CHRTAB(A),29 ;RATFLD
04200 STRF2: POINT 2,CHRTAB(A),31 ;STRFLD
04300 IDF2: POINT 3,CHRTAB(A),34 ;IDFLD
04400
04500 SCANINIT: SUBI A,INUM0
04600 SUBI B,INUM0
04700 SUBI C,INUM0
04800 SUBI C+1,INUM0
04900 SUBI C+2,INUM0
05000 MOVEM A,IGST2 ;IGSTRT
05100 MOVEM B,IGEND2 ;IGEND
05200 PUSH P,C ;STRBEG
05300 PUSH P,C+1 ;STREND
05400 PUSH P,C+2 ;SLASHIFY
05500 MOVEI B,2
05600 MOVEI C,3
05700 MOVEI A,176
05800 DPB B,RATF2
05900 DPB C,STRF2
06000 DPB B,IDF2
06100 SOJG A,.-3
06200 MOVE A,[XWD "A"-"Z"-1,"A"]
06300 MOVEI B,5
06400 MOVEI C,4
06500 DPB B,RATF2
06600 DPB C,IDF2
06700 AOBJN A,.-2
06800 MOVE A,[XWD "a"-"z"-1,"a"]
06900 DPB B,RATF2
07000 DPB C,IDF2
07100 AOBJN A,.-2
07200 MOVE A,[XWD "0"-"9"-1,"0"]
07300 MOVEI B,8
07400 DPB B,RATF2
07500 DPB C,IDF2
07600 AOBJN A,.-2
07700 POP P,A ;SLASHIFY
07800 MOVEI B,3
07900 DPB B,IDF2
08000 DPB C,RATF2
08100 POP P,A ;STREND
08200 MOVEI B,2
08300 DPB B,STRF2
08400 POP P,A ;STRBEG
08500 MOVEI B,9
08600 DPB B,RATF2
08700 MOVE A,IGST2 ;COMMENT-CHAR REMAINS A LETTER IN STRING.
08800 MOVEI B,0
08900 DPB B,RATF2
09000 DPB B,IDF2
09100 MOVEI A,0 ;NULL
09200 MOVEI B,1
09300 DPB B,RATF2
09400 DPB B,IDF2
09500 DPB B,STRF2
09600 MOVEI A,"."
09700 MOVEI B,7
09800 DPB B,RATF2
09900 JRST FALSE
10000
10100 SCANSET:
10200 MOVE A,[XWD IGST2,IGSTRT]
10300 MOVE B,[PUSHJ P,TYID]
10400 JRST ..SET
10500 SCANRESET:
10600 MOVE A,[XWD OLDSCN,IGSTRT]
10700 MOVE B,[PUSHJ P,TYI]
10800 ..SET: MOVEM B,RATAB+4 ;MODIFY RATAB &
10900 MOVEM B,IDTAB+3 ; IDTAB.
11000 BLT A,IGSTRT+4
11100 FALSE: MOVEI A,0
11200 POPJ P,
11300
11400
11500 LETTER: SUBI A,INUM0
11600 MOVEI B,5
11700 MOVEI C,4
11800 DPB C,IDF2
11900 LET2: DPB B,RATF2
12000 JRST FALSE
12100
12200
12300 DISIGNORE:
12400 SKIPA B,[2] ;A DELIMITER, NOT A LETTER.
12500 IGNORE: MOVEI B,3
12600 SUBI A,INUM0
12700 JRST LET2
12800
12900
13000 SCAN: SETOM NOINFG
13100 PUSHJ P,RATOM
13200 SKIPA
13300 PUSHJ P,FIX1A
13400 MOVEM A,SCNVAL
13500 MOVEI A,INUM0(R)
13600 POPJ P,
13700
13800 UNTYI: SUBI A,INUM0
13900 MOVEM A,OLDCH
14000 JRST FIX1A
14100
14200 END