Google
 

Trailing-Edge - PDP-10 Archives - decuslib10-01 - 43,50073/alvine.mac
Click 43,50073/alvine.mac to see without markup as text/plain
There are 5 other files named alvine.mac in the archive. Click here to see a list.
00010		TITLE ALVINE ,SON OF,
00020	
00030	
00040	MLON
00050	INTERNAL ALVINE
00060	P=14
00070	ALVINE:	INIT 17
00080		SIXBIT /DSK/
00090		0
00100		HALT
00110		ENTER NAME
00120		HALT
00130		OUTPUT [IOWD 1,LST	;OUTPUT LENGTH OF FILE
00140			0]
00150		OUTPUT LST
00160		STATZ 740000
00170		HALT
00180		RELEASE 
00190		POPJ P,
00200	
00210	LST:	IOWD EDEND-EDX+1,EDXX
00220		0
00230	NAME:	SIXBIT /LISP/
00240		SIXBIT /ED/
00250		0
00260		0
00270		0
00280	
00290	VAR
00300	LIT
00310	EDXX:
00320	
00330	
00340	
00350	
00360	TENEX==0
00370	DECUS==1-TENEX		;SOLELY FOR PROPER ALTMODE...
00380	
00390	IFN DECUS,<ALTMOD=33>
00400	IFN TENEX,<ALTMOD=175>
00410	
00420	PHASE 0
00430	EDX:	JRST ED(R)
00440		JRST RD2(R)	;RETURN FOR BELL
00450		JRST GRNDEF(R)
00460	
00470	MESS:	0
00480	
00490	CMER1:	ASCII /   ? /
00500	MER7:	ASCII /*UDI /
00510	MER1:	ASCII /*EDR /
00520	MER2:	ASCII /*EDN /
00530	MER4:	ASCII /*UBP /
00540	MER5:	ASCII /*IPF /
00550	MER6:	ASCII /*UBP /
00560	MER3:	ASCII /*NSM /
00570	MER8:	ASCII /*FNF /
00580	LPNAME:	ASCII / %LP /
00590	RPNAME:	ASCII / %RP /
00600	DT:	ASCII /  %D /
00610	LMBD:	ASCII /   LAMBDA /
00620	PRG:	ASCII /PROG /
00630	LAMB=LMBD+1
00640	LPS:	ASCII / LPS /
00650	RPS:	ASCII / RPS /
00660	BAL:	ASCII / BAL /
00670	PC:	ASCII /   % /
00680	STR:	ASCII /%STR /
00690	PCL:	ASCII /%%%L /
00700	TRC:	ASCII /    TRACE /
00710	DEF:	ASCII /  DEFPROP /
00720	GRI:	ASCII /  GRINDEF /
00730	SPR:	ASCII /   SPRINT /
00740		ASCII /%DPSPRINT /
00750	DPYSPR=.-1
00760	VALU:	ASCII /    VALUE /
00770	VALUE=VALU+1
00780	FEXP:	ASCII /    FEXPR /
00790	FEXPR=FEXP+1
00800	EXPR:	ASCII/EXPR /
00810	FSUBA:	ASCII /    FSUBR /
00820	FSUBR=FSUBA+1
00830	SUBR:	ASCII /SUBR /
00840	
00850	GLS:	ASCII /(FEXPR EXPR VALUE MACRO SPECIAL   )/
00860	FLO:	ASCII /   FLONUM /
00870	FLONUM=FLO+1
00880	FIX:	ASCII /   FIXNUM /
00890	SETQ:	ASCII /SETQ /
00900	QUO:	ASCII /    QUOTE /
00910		ASCII /NIL /
00920	
00930	EXTERN NCONC,PRINT,READ,READP1,TYO,ATOM,PUTPROP,GETL
00940	EXTERN XCONS,RATOM,APPEND,OUTC,EVAL,OUTPUT,TYO
00950	EXTERN INC,INPUT,SET,GET,TERPRI,UNBOUND,MEMQ
00960	EXTERN PRIN1,FLATSIZE,CHRCT,LENGTH,LAST,TYI
00970	EXTERN PSAV1
00980	
00990	QUOTE=	QUO+1
01000	FIXNUM=	FIX+1
01010	DEFPROP=DEF+1
01020	GRINDEF=GRI+1
01030	SPRENT=	SPR+1
01040	GLST=	FLO-1
01050	TRACE=	TRC+1
01060	NCONS=	XCONS-1
01070	
01080		A=	1
01090		B=	2
01100		C=	3
01110		AR1=	4
01120		AR2A=	5
01130		T=	6
01140		R=	10
01150		S=	11
01160		P=	14
01170		F=	15
01180		SP=	17
01190	
01200	INTERN ED
01210	
01220	ED:	PUSH P,A
01230	RD1:	MOVEI A,TTYI(R)
01240		PUSHJ P,READP1
01250		JUMPE A,RD2A(R)
01260		MOVEM A,@J(R)
01270		JRST RD1(R)
01280	
01290	TTYI:	ILDB A,J(R)
01300		POPJ P,0
01310	
01320	J:	POINT 7,MESS(R)
01330	
01340	RD2A:	MOVE C,SUBR(R)
01350		MOVEI B,SPRINT(R)
01360		MOVE A,SPRENT(R)
01370		PUSHJ P,PUTPROP
01380		MOVEI B,DPSPR(R)
01390		MOVE C,SUBR(R)
01400		MOVE A,DPYSPR(R)
01410		PUSHJ P,PUTPROP
01420	RD2B:	MOVE B,GLST(R)
01430		MOVE A,PCL(R)
01440		PUSHJ P,SET
01450		MOVE B,[JRST EDN(R)](R)
01460		MOVEM B,ED(R)
01470		POP P,A
01480	EDN:	JUMPN A,FALSE(R)
01490		MOVEM P,PSAV2#(R)
01500		PUSH P,[0](R)	;%B
01510		PUSH P,[0](R)	;SRCH STRNG
01520		PUSH P,[0](R)	;%STR
01530		PUSH P,[0](R)	;%1
01540		PUSH P,[0](R)	;%2
01550		PUSH P,[0](R)	;%REM
01560		PUSH P,[0](R)	;%NEW
01570		SETZM BK1#(R)
01580		MOVE A,STR(R)
01590		MOVE B,VALUE(R)
01600		PUSHJ P,GET
01610		JUMPE A,.+4(R)
01620		HRRZ A,(A)
01630		MOVEM A,-6(P)
01640		MOVEM A,-4(P)
01650		MOVE B,VALUE(R)
01660		MOVE A,PCL(R)
01670		PUSHJ P,GET
01680		HRRZ A,(A)
01690		MOVEM A,GLST(R)
01700		MOVEM P,PSAV1
01710	
01720	RD2:
01730		PUSHJ P,TERPRI
01740	RD3:	SETZM OLDCH
01750		PUSHJ P,TYI
01760		CAIN A,"^"
01770		JRST UPARR(R)
01780		CAIE A,12
01790		CAIN A,15
01800		JRST RD3(R)
01810		CAIN A,ALTMOD
01820		JRST RD3(R)
01830		CAIN A,"G"
01840		JRST ED1(R)
01850		CAIN A,"P"
01860		JRST ED2(R)
01870		CAIN A,"Q"
01880		JRST ED2X(R)
01890		CAIN A,"B"
01900		JRST ED5(R)
01910		CAIN A,"W"
01920		JRST ED14(R)
01930		CAIN A,"A"
01940		JRST ED4(R)
01950		CAIN A,"V"
01960		JRST ED13(R)
01970		CAIN A,"U"
01980		JRST ED16(R)
01990		CAIN A,"F"
02000		JRST ED9(R)
02010	
02020		MOVEI B,1
02030		MOVEM B,CNT#(R)
02040	DSP1:	CAIN A,"S"
02050		JRST ED10(R)
02060		CAIN A,"I"
02070		JRST ED8(R)
02080		CAIN A,"R"
02090		JRST ED3(R)
02100		CAIN A,"M"
02110		JRST ED15(R)
02120		CAIN A,"E"
02130		JRST EDEX(R)
02140		CAIN A,"D"
02150		JRST EDDL(R)
02160		CAIN A,">"
02170		JRST ED11(R)
02180		CAIN A,"<"
02190		JRST ED12(R)
02200		CAIN A,"C"
02210		JRST SPC(R)
02220		CAIG A,"9"
02230		CAIGE A,"0"
02240		JRST ER1(R)
02250		JRST NMB(R)
02260	
02270	
02280	ER1:	MOVE A,CMER1(R)
02290		PUSHJ P,PRINT
02300		JRST RD2(R)
02310	
02320	SPC:	MOVE A,CNT(R)	;C - COUNT
02330		MOVEM A,PCNT(R)
02340		JRST RD2(R)
02350	PCNT:	3
02360	NMB:	SETZM CNT(R)
02370	NM1:	SUBI A,"0"
02380		MOVE B,CNT(R)
02390		MULI B,12
02400		ADD A,C
02410		MOVEM A,CNT(R)
02420		PUSHJ P,TYI
02430		CAIG A,"9"
02440		CAIGE A,"0"
02450		JRST DSP1(R)
02460		JRST NM1(R)
02470	
02480	
02490	ERED1:	MOVE A,MER7(R)
02500		JRST ER1+1(R)
02510	
02520	UPARR:	SETZM PSAV1
02530		MOVE P,PSAV2(R)
02540		JRST FALSE(R)
02550	
02560	ED1:	PUSHJ P,READ	;G - GET
02570		JUMPE A,RD2(R)
02580		PUSH P,A
02590		MOVE B,TRACE(R)
02600		PUSHJ P,GET
02610		JUMPE A,ED1D(R)
02620		HRRZ A,(A)
02630		MOVEM A,(P)
02640	ED1D:	MOVE A,(P)
02650		MOVE B,GLST(R)
02660		PUSHJ P,GETL
02670		JUMPE A,ERED1(R)
02680		HRRZ C,(A)
02690		HLRZ A,(A)
02700		CAME A,VALUE(R)
02710		JRST ED1B(R)
02720		HLRZ A,(C)
02730		HRRZ A,(A)
02740		PUSHJ P,NCONS
02750		MOVE B,QUOTE(R)
02760		PUSHJ P,XCONS
02770		PUSHJ P,NCONS
02780		POP P,B
02790		PUSHJ P,XCONS
02800		MOVE B,SETQ(R)
02810		JRST ED1C(R)
02820	ED1B:	PUSHJ P,NCONS
02830		HLRZ B,(C)
02840		PUSHJ P,XCONS
02850		POP P,B
02860		PUSHJ P,XCONS
02870		MOVE B,DEFPROP(R)
02880	ED1C:	PUSHJ P,XCONS
02890		PUSHJ P,MKLPRP(R)
02900	ED1A:	MOVEM A,-4(P)
02910		MOVEM A,-6(P)
02920		SETZM BK1(R)
02930		MOVE B,A
02940		MOVE A,STR(R)
02950		PUSHJ P,SET
02960		JRST RD2(R)
02970	
02980	ED2X:	MOVE A,-4(P)	;Q -- PUT ON ORIGINAL NAME
02990		HRRZ A,(A)
03000		HRRZ A,(A)
03010		HLRZ A,(A)
03020		JRST ED2+1(R)
03030	
03040	ED2:	PUSHJ P,READ
03050		PUSH P,A	;P -- PUT
03060		MOVE B,TRACE(R)
03070		PUSHJ P,GET
03080		JUMPE A,ED2A(R)
03090		HRRZ A,(A)
03100		MOVEM A,(P)
03110	ED2A:	MOVE A,-5(P)
03120		PUSHJ P,UNMK(R)
03130		JUMPE A,RD2(R)
03140		HRRZ B,(A)
03150		POP P,C
03160		HRLM C,(B)
03170		PUSHJ P,EVAL
03180		JRST RD2(R)
03190	
03200	ED3A:	SETZM -2(P)
03210		JRST EDB(R)
03220	
03230	ED3R:	MOVE C,T
03240		JUMPN C,ED3R2(R)
03250		MOVE A,(P)
03260		JRST ED1A(R)
03270	
03280	ED3R2:	CAME T,BK1(R)
03290		JRST ED3R1(R)
03300		MOVE B,(P)
03310		MOVEM B,-6(P)
03320		JRST ED3R3(R)
03330	
03340	ED8A:	SKIPE RSW#(R)
03350		JRST ER1(R)
03360		PUSHJ P,EDREAD(R)
03370		MOVE B,-6(P)
03380	ED85:	PUSHJ P,.NCONC(R)
03390		MOVEM A,-6(P)
03400		SOSLE CNT(R)
03410		JRST EDB1(R)
03420		SKIPN BK1(R)
03430		JRST ED1A(R)
03440		HRRM A,@BK1(R)
03450		JRST RD2(R)
03460	
03470	EDB1:	MOVE A,(P)
03480		JRST EDB(R)
03490	
03500	EDE1:	HRRM A,-4(P)
03510		JRST ED1A+2(R)
03520	ED8C:	SKIPE RSW(R)
03530		JRST ER1(R)
03540		PUSHJ P,EDREAD(R)
03550		JRST ED1A(R)
03560	ED8:	TDZA C,C	;I - INSERT
03570	ED3:	SETOM C		;R - REPLACE
03580		MOVEM C,RSW(R)
03590		SETZM NEWFLG#(R)
03600		PUSHJ P,EDREAD(R)
03610		JUMPE A,ED8A(R)
03620		MOVEM A,-3(P)
03630		HLRZ A,(A)
03640		CAMN A,PC(R)
03650		JRST ED8C(R)
03660		PUSHJ P,EDREAD(R)
03670		JUMPN A,ED3A(R)
03680		PUSHJ P,EDREAD(R)
03690		MOVEM A,-2(P)
03700		PUSHJ P,EDREAD(R)
03710	
03720	EDB:	MOVEM A,(P)
03730		MOVEM A,LNEW#(R)
03740		HRRZ A,(A)
03750		JUMPN A,.-2(R)
03760	
03770		HLRZ@ A,(P)
03780		CAMN A,PC(R)
03790	ED3N:	SETOM NEWFLG(R)
03800		MOVE A,-6(P)
03810		MOVE B,-3(P)
03820		MOVE T,BK1(R)
03830		PUSHJ P,SRCH(R)
03840		JUMPE A,ED33(R)
03850		MOVE B,-2(P)
03860		JUMPE B,ED31(R)
03870		MOVEM T,BK2#(R)
03880		PUSHJ P,SRCH(R)
03890		JUMPE A,ED34(R)
03900		MOVE T,BK2(R)
03910	ED31:	SKIPE NEWFLG(R)
03920		JRST ED32(R)
03930		HRRM@ A,LNEW(R)
03940	ED34:	MOVE C,BK3(R)
03950		SKIPE RSW(R)
03960		JRST ED3R(R)
03970	ED3R1:	MOVE B,(P)
03980	ED3R3:	HRRM B,@C
03990		JRST RD2(R)
04000	ED32:	JUMPE T,ED1A(R)
04010		HRRM A,@T
04020		JRST RD2(R)
04030	ED33:	SKIPE -2(P)
04040		JRST SER1(R)
04050		SKIPN NEWFLG(R)
04060		JRST ED34(R)
04070		HRRZ T,(T)
04080		MOVEM T,BK3(R)
04090		JRST ED37(R)
04100	
04110	ED4:	MOVE A,-4(P)	;A - ALL
04120		PUSH P,A
04130		PUSHJ P,TERPRI
04140		POP P,A
04150		PUSHJ P,EDGRIN(R)
04160		JRST RD2(R)
04170	
04180	EDDL:	MOVE A,-6(P)	;D - DELETE
04190		MOVEM A,BK3(R)
04200		HRRZ A,(A)
04210		JUMPE A,EDDL2(R)
04220		SOSLE CNT(R)
04230		JRST EDDL+1(R)
04240	EDDL1:	PUSH P,A
04250		PUSHJ P,PRINTC(R)
04260		POP P,A
04270		JRST ED85+1(R)
04280	
04290	ED5:	MOVE A,-4(P)	;B - BALANCED
04300		PUSHJ P,PARSRCH(R)
04310		CAMN A,B
04320		JRST ED51(R)
04330		PUSH P,B
04340		ADDI A,MAGNO
04350		PUSHJ P,PRINT
04360		MOVE A,LPS(R)
04370		PUSHJ P,PRIN1
04380		POP P,A
04390		ADDI A,MAGNO
04400		PUSHJ P,PRINT
04410		MOVE A,RPS(R)
04420		PUSHJ P,PRIN1
04430		JRST RD2(R)
04440	ED51:	MOVE A,BAL(R)
04450		JRST ED51-2(R)
04460	
04470	EDDL2:	MOVEI A,07
04480		PUSHJ P,TYO
04490		SKIPN BK1(R)
04500		JRST ER1(R)
04510		MOVE A,-6(P)
04520		MOVEM A,BK3(R)
04530		MOVE A,-4(P)
04540		HRRZ C,(A)
04550		CAMN C,BK3(R)
04560		JRST ED37B(R)
04570		JUMPE C,RD2(R)
04580		TDZA AR1,AR1
04590	ED37:	SETOM AR1
04600		MOVE A,-4(P)
04610		MOVEM A,BK2(R)
04620		HRRZ A,(A)
04630		HRRZ C,(A)
04640		CAME C,BK3(R)
04650		JRST .-4(R)
04660	ED37A:	HLRM A,(A)
04670		JUMPN AR1,RD2(R)
04680		MOVEM A,-6(P)
04690		PUSHJ P,PRINTC(R)
04700		MOVE A,BK2(R)
04710		MOVEM A,BK1(R)
04720		JRST RD2(R)
04730	
04740	ED37B:	HLRM A,(A)
04750		JRST ED1A(R)
04760	
04770	
04780	ED11:	MOVE A,-6(P)	;> - RIGHT
04790		MOVE B,CNT(R)
04800		SKIPN B
04810		MOVEI B,7777
04820		MOVEM A,C
04830		HRRZ A,(A)
04840		JUMPE A,ED11A(R)
04850		MOVEM A,-6(P)
04860		MOVEM C,BK1(R)
04870		SOJG B,.-5(R)
04880		JRST ED11B(R)
04890	ED11A:	MOVEI A,07
04900		PUSHJ P,TYO
04910		JRST RD2(R)
04920	
04930	ED11B:
04940		PUSHJ P,PRINTC(R)
04950		JRST RD2(R)
04960	
04970	ED12:	SETZM C		;< - LEFT
04980		SKIPN CNT(R)
04990		JRST ED12C(R)
05000		MOVE A,-4(P)
05010	ED12A:	CAMN A,-6(P)
05020		JRST ED12B(R)
05030		AOS C
05040		HRRZ A,(A)
05050		JUMPN A,ED12A(R)
05060		JRST ERR3(R)
05070	ED12B:	MOVE A,CNT(R)
05080		SUBM A,C
05090		SKIPL C
05100		JRST ED12C(R)
05110		MOVE A,-4(P)
05120		MOVEM A,BK1(R)
05130		HRRZ A,(A)
05140		AOJL C,.-2(R)
05150		MOVEM A,-6(P)
05160		JRST ED12D(R)
05170	ED12C:	MOVEI A,07
05180		PUSHJ P,TYO
05190		MOVE A,-4(P)
05200		MOVEM A,-6(P)
05210		SETZM BK1(R)
05220	ED12D:	PUSHJ P,PRINTC(R)
05230		JRST RD2(R)
05240	
05250	ED14:	MOVE A,-6(P)	;W - WHERE
05260		JRST ED12D(R)
05270	
05280	ERR3:	MOVE A,MER1(R)
05290		JRST ER1+1(R)
05300	
05310	ED10:	PUSHJ P,EDREAD(R)	;S - SEARCH
05320		SKIPN A
05330		MOVE A,-5(P)
05340		MOVEM A,-5(P)
05350		MOVE B,A
05360		MOVE A,-6(P)
05370		MOVE T,BK1(R)
05380	ED10C:	PUSHJ P,SRCH1(R)
05390		JUMPE A,ED10B(R)
05400		MOVEM A,-6(P)
05410		MOVE B,BK3(R)
05420		MOVEM B,BK1(R)
05430		SOSG CNT(R)
05440		JRST ED10D(R)
05450		MOVE B,-5(P)
05460		JRST ED10C(R)
05470	ED10B:	MOVEI A,07
05480		PUSHJ P,TYO
05490	ED10D:	MOVE A,-6(P)
05500		PUSHJ P,PRINTC(R)
05510		JRST RD2(R)
05520	
05530	;SRCH RETURNS END IN A
05540	;SETS T AND BK3
05550	;STARTS WITH STRING IN A
05560	;AND SEARCH-STRING IN B
05570	;STRING-1 IN T
05580	;SRCH1 RETURNS 0 IN A IF NOT FOUND,SRCH CALL ERROR
05590	
05600	SRCH1:	TDZA AR2A,AR2A
05610	SRCH:	SETOM AR2A
05620		MOVEM B,STRB#(R)
05630	
05640	SR1:	HLRZ AR1,(B)
05650		HLRZ C,(A)
05660		CAMN AR1,C
05670		JRST SR2(R)
05680		PUSHJ P,SRNUM(R)
05690		MOVEM A,T
05700		HRRZ A,(A)
05710		JUMPN A,SR1+1(R)
05720	SR3:	SKIPN AR2A
05730		POPJ P,
05740		POP P,A
05750	SER1:	MOVE A,MER3(R)
05760		JRST ER1+1(R)
05770	
05780	SR2:	MOVEM A,BK3#(R)
05790		HRRZ A,(A)
05800		HRRZ B,(B)
05810		JUMPE A,SR4(R)
05820		SKIPN B
05830		POPJ P,
05840		HLRZ C,(A)
05850		HLRZ AR1,(B)
05860		CAMN C,AR1
05870		JRST SR2(R)
05880		PUSHJ P,SRNUM(R)
05890		MOVE T,BK3(R)
05900		MOVE B,STRB(R)
05910		JRST SR1(R)
05920	
05930	SR4:	JUMPN B,SR3(R)
05940		POPJ P,
05950	EDEX1:	MOVE A,-7(P)
05960	
05970	
05980		HLRZ B,(A)
05990		CAMN B,LPNAME(R)
06000		JRST ED15B(R)
06010		CAME B,RPNAME(R)
06020		CAMN B,DT(R)
06030		JRST ED15A-1(R)
06040		POPJ P,0
06050	
06060	ED15:	PUSHJ P,EDEX1(R)	;M - MATCH
06070	ED15D:	MOVEM A,B
06080		HRRZ A,(A)
06090		JUMPE A,ED15A(R)
06100		MOVEM B,BK1(R)
06110		MOVEM A,-6(P)
06120		SOSLE CNT(R)
06130		JRST ED15(R)
06140		PUSHJ P,PRINTC(R)
06150		JRST RD2(R)
06160	
06170	ED15B:	SETZM AR1
06180	ED15C:	AOS AR1
06190	ED15E:	HRRZ A,(A)
06200		JUMPE A,ED15A-1(R)
06210		HLRZ B,(A)
06220		CAMN B,LPNAME(R)
06230		JRST ED15C(R)
06240		CAMN B,RPNAME(R)
06250		SOJE AR1,ED15-1(R)
06260		JRST ED15E(R)
06270		POP P,A
06280	ED15A:	MOVEI A,07
06290		PUSHJ P,TYO
06300		JRST RD2(R)
06310	
06320	ED13:	MOVE A,-6(P)	;V - VOMIT
06330		PUSHJ P,PARSRCH(R)
06340		MOVE A,-6(P)
06350		CAMGE B,AR1
06360		JRST ED4+1(R)
06370		HLRZ B,(A)
06380		CAME B,LPNAME(R)
06390		JRST ED4+1(R)
06400		HRRZ@ A,-6(P)
06410		MOVEM A,AR2A
06420		PUSHJ P,UNMK1(R)
06430	OPDEF CALLF [36B8]
06440		CALLF 1,@DPYSPR(R)
06450		JRST RD2(R)
06460	
06470	DPSPR:	MOVEI C,0
06480		MOVEI B,2
06490		PUSHJ P,SPRNT2(R)
06500		JRST TERPRI
06510	
06520	UNER1A:
06530	UNER1B:	MOVE A,MER2(R)
06540		JRST EDGER+1(R)
06550	
06560		MOVEM A,-6(P)
06570	EDEX:	PUSHJ P,EDEX1(R)	;E - EXPLUGE
06580		HRRZ A,(A)
06590		JUMPE A,ED15A(R)
06600		SOSLE CNT(R)
06610		JRST EDEX-1(R)
06620		JRST EDDL1(R)
06630	
06640	UNMK1:	PUSHJ P,EDGET(R)
06650		CAMN A,LPNAME(R)
06660		JRST UN3(R)
06670		CAMN A,RPNAME(R)
06680		JRST UN2(R)
06690		CAMN A,DT(R)
06700		JRST UN1(R)
06710		PUSH P,A
06720		PUSHJ P,UNMK1(R)
06730		POP P,B
06740		PUSHJ P,XCONS
06750		POPJ P,
06760	UN1:	PUSHJ P,EDGET(R)
06770		CAMN A,LPNAME(R)
06780		JRST UN4(R)
06790		CAME A,RPNAME(R)
06800		CAMN A,DT(R)
06810		JRST UNER1A(R)
06820	UN5:	PUSH P,A
06830		PUSHJ P,EDGET(R)
06840		CAME A,RPNAME(R)
06850		JRST UNER1B(R)
06860		POP P,A
06870		POPJ P,0
06880	UN3:	PUSHJ P,UNMK1(R)
06890		PUSH P,A
06900		PUSHJ P,UNMK1(R)
06910		POP P,B
06920		PUSHJ P,XCONS
06930		POPJ P,
06940	UN2:	SETZM A
06950		POPJ P,
06960	UN4:	PUSHJ P,UNMK1(R)
06970		JRST UN5(R)
06980	
06990	
07000	EDGET:	SKIPN AR2A
07010		JRST EDGER(R)
07020		HLRZ A,(AR2A)
07030		HRRZ AR2A,(AR2A)
07040		POPJ P,
07050	EDGER:	MOVE A,MER4(R)
07060		PUSHJ P,PRINT
07070		MOVE P,PSAV(R)
07080		SUB P,[XWD 2,2](R)
07090		JRST RD2(R)
07100	
07110	CNT1:	0
07120	
07130	PRINTC:	PUSH P,A
07140		PUSHJ P,TERPRI
07150		POP P,A
07160		MOVE C,PCNT(R)
07170		MOVEM C,CNT1(R)
07180		JUMPE A,PRN3(R)
07190	PRN1:	PUSH P,A
07200		SETZM AR1
07210		HLRZ A,(A)
07220		CAMN A,LPNAME(R)
07230		MOVEI AR1,"("
07240		CAMN A,RPNAME(R)
07250		MOVEI AR1,")"
07260		CAMN A,DT(R)
07270		MOVEI AR1,"."
07280		SKIPE AR1
07290		JRST PRN2(R)
07300		PUSHJ P,PRIN1
07310		MOVEI AR1," "
07320	PRN2:	MOVE A,AR1
07330		PUSHJ P,TYO
07340		POP P,A
07350		HRRZ A,(A)
07360		SOSLE CNT1(R)
07370		JUMPN A,PRN1(R)
07380	PRN3:	POPJ P,
07390	
07400	ED9:	PUSHJ P,READ	;F - FILE
07410		PUSH P,A
07420		PUSHJ P,READ
07430		PUSH P,A
07440		PUSHJ P,READ
07450		PUSHJ P,NCONS
07460		POP P,B
07470		PUSHJ P,XCONS
07480		PUSHJ P,OUTPUT
07490		PUSHJ P,OUTC
07500		MOVE A,(P)
07510		PUSHJ P,ATOM
07520		JUMPE A,ED9A(R)
07530		MOVE B,VALUE(R)
07540		MOVE A,(P)
07550		PUSHJ P,GET
07560		HRRZ A,(A)
07570		JRST .+2(R)
07580	ED9A:	POP P,A
07590		PUSHJ P,GRNDEF(R)
07600		MOVEI A,0
07610		MOVEI B,1
07620		PUSHJ P,OUTC
07630		JRST RD2(R)
07640	
07650	EDGRIN:	MOVEI C,7777
07660		JRST PRN1-2(R)
07670	
07680	PARSRCH:	SETZB AR1,B
07690	PAR1:	HLRZ C,(A)
07700		CAMN C,LPNAME(R)
07710		AOS AR1
07720		CAMN C,RPNAME(R)
07730		AOS B
07740		HRRZ A,(A)
07750		JUMPN A,PAR1(R)
07760		MOVE A,AR1
07770		POPJ P,
07780	
07790	
07800	MKLPRP1:	PUSH P,[0](R)	;A
07810		PUSH P,A	;X,B
07820		PUSHJ P,ATOM
07830		JUMPN A,MLP1(R)
07840		MOVE A,LPNAME(R)
07850		PUSHJ P,NCONS
07860		MOVEM A,-1(P)
07870	L1:	HLRZ@ A,(P)
07880		PUSHJ P,MKLPRP1(R)
07890		MOVE B,A
07900		MOVE A,-1(P)
07910		PUSHJ P,.NCONC(R)
07920		MOVEM A,-1(P)
07930		HRRZ@ A,(P)
07940		JUMPE A,MLP2(R)
07950		PUSHJ P,ATOM
07960		JUMPN A,MLP3(R)
07970		HRRZ@ A,(P)
07980		MOVEM A,(P)
07990		JRST L1(R)
08000	MLP1:	POP P,A
08010		PUSHJ P,NCONS
08020		MOVE B,A
08030		POP P,A
08040		PUSHJ P,.NCONC(R)
08050		POPJ P,0
08060	MLP2:	MOVE A,RPNAME(R)
08070		PUSHJ P,NCONS
08080	MLP4:	POP P,B
08090		MOVE B,A
08100		POP P,A
08110		JRST .NCONC(R)
08120	MLP3:	MOVE A,RPNAME(R)
08130		PUSHJ P,NCONS
08140		HRRZ@ B,(P)
08150		PUSHJ P,XCONS
08160		MOVE B,DT(R)
08170		PUSHJ P,XCONS
08180		JRST MLP4(R)
08190	
08200	PSAV:	0
08210	UNMK:	MOVEM P,PSAV(R)
08220		HLRZ B,(A)
08230		CAME B,LPNAME(R)
08240		JRST UNER1(R)
08250		HRRZ A,(A)
08260		MOVEM A,AR2A
08270		PUSHJ P,UNMK1(R)
08280		SKIPE AR2A
08290		JRST UNER2(R)
08300		POPJ P,
08310	
08320	UNER1:	MOVE A,MER5(R)
08330		PUSHJ P,PRINT
08340		MOVE P,PSAV1
08350		JRST RD2(R)
08360	UNER2:	MOVE A,MER6(R)
08370		JRST UNER1+1(R)
08380	
08390	.NCONC:	MOVNI 6,2
08400		PUSH P,A
08410		PUSH P,B
08420		JRST NCONC
08430	
08440	ED16:	PUSHJ P,READ	;U - UNFILE
08450		PUSH P,A
08460		PUSHJ P,READ
08470		PUSH P,A
08480		PUSHJ P,READ
08490		PUSHJ P,NCONS
08500		POP P,B
08510		PUSHJ P,XCONS
08520		PUSHJ P,INPUT
08530		PUSHJ P,INC
08540		MOVE A,(P)
08550		PUSHJ P,ATOM
08560		JUMPE A,ED16A(R)
08570		MOVE B,VALUE(R)
08580		MOVE A,(P)
08590		PUSHJ P,GET
08600		HRRZ A,(A)
08610	ED16D:	MOVEM A,(P)
08620	ED16A:	PUSHJ P,READ
08630		MOVE T,A
08640		PUSHJ P,ATOM
08650		JUMPN A,ED16A(R)
08660		HRRZ A,(T)
08670		HLRZ A,(A)
08680		SKIPE B,(P)
08690		PUSHJ P,MEMQ
08700		JUMPE A,ED16A(R)
08710		MOVE A,T
08720		PUSHJ P,EVAL
08730		SKIPE (P)
08740		PUSHJ P,PRINT
08750		JRST ED16A(R)
08760		JRST ER1+1(R)
08770		TT=7
08780		D=12
08790	SRNUM:	CAIGE C,INUMIN	;NUMBER COMPARES
08800		CAIL AR1,INUMIN
08810		POPJ P,
08820		HRRZ C,(C)
08830		HLRZ TT,(C)
08840		CAME TT,FIXNUM(R)
08850		CAMN TT,FLONUM(R)
08860		SKIPA D,(AR1)
08870		POPJ P,0
08880		HLRZ S,(D)
08890		CAME TT,S
08900		POPJ P,0
08910		HRRZ C,(C)
08920		HRRZ D,(D)
08930		MOVE D,(D)
08940		MOVE C,(C)
08950		CAME D,C
08960		POPJ P,0
08970		POP P,TT
08980		JRST SR2(R)
08990	EXTERN OLDCH,LINL,CHCT
09000	
09010	EDRD1:	CLEARB A,...FLG(R)
09020		POPJ P,0
09030	...FLG:	0
09040	EDREAD:	SKIPE ...FLG(R)
09050		JRST EDRD1(R)
09060		PUSHJ P,READ1(R)
09070		JUMPL A,.-1(R)
09080		POPJ P,0
09090	
09100	READ1:	PUSHJ P,RATOM
09110		JRST READ1A(R)
09120	READ2:	ADDI B,(R)
09130		XCT EDTAB(B)
09140	READ1A:	PUSH P,A
09150		PUSHJ P,READ1(R)
09160	READ3:	POP P,B
09170		JUMPL A,READ1(R)	;RUBOUT
09180		JRST XCONS
09190	
09200	EDTAB:	MOVE A,LPNAME(R)	;0 (
09210		MOVE A,RPNAME(R)	;1 )
09220		MOVE A,LPNAME(R)	;2 [
09230		JRST READ4(R)	;3 ],$
09240		JRST EDRD3(R)	;4 .
09250		SKIP
09260		SETOM A		;6 RUBOUT
09270		POPJ P,
09280	
09290	READ4:	CAIN A,ALTMOD
09300		JRST FALSE(R)	;ALTMODE
09310		MOVE A,RPNAME(R)
09320		JRST READ1A(R)
09330	
09340	EDRD5:	SUB P,[XWD 2,2](R)
09350		JRST EDRD32(R)
09360	
09370	EDRD4:	SUB P,[XWD 2,2](R)
09380		JRST READ1(R)
09390	
09400	EDRD3:	PUSH P,DT(R)
09410		PUSH P,[READ3](R)
09420		ADDM R,(P)
09430	EDRD32:	PUSHJ P,RATOM
09440		JRST READ1A(R)	;ATOM
09450		CAIN A,177
09460		JRST EDRD4(R)	;RUBOUT
09470		CAIE A,"."
09480		JRST READ2(R)
09490		PUSH P,DT(R)
09500		PUSH P,[READ3](R)
09510		ADDM R,(P)
09520		PUSHJ P,RATOM
09530		JRST READ1A(R)	;ATOM
09540		CAIN A,177
09550		JRST EDRD5(R)	;RUBOUT
09560		CAIE A,"."
09570		JRST READ2(R)
09580		SUB P,[XWD 4,4](R)
09590		MOVEM A,...FLG(R)
09600	FALSE:	MOVEI A,0
09610	CPOPJ:	POPJ P,0
09620	
09630	;GRINDEF AND FRIENDS
09640	;THESE FUNCTIONS KNOW ABOUT INUMS
09650	MAGNO=577777
09660	INUMIN=400000
09670	
09680	PANL:	PUSH P,A
09690		PUSHJ P,ATOM
09700		JUMPN A,PNL3(R)
09710		HRRZ@ A,(P)
09720		PUSHJ P,ATOM
09730		JUMPE A,PNL1(R)
09740	PNL3:	MOVEI A,15
09750		EXCH A,(P)
09760		JRST PNL2(R)
09770	
09780	PNL1:	HRRZ A,@(P)
09790		HLRZ A,(A)
09800		PUSHJ P,PANL(R)
09810		EXCH A,(P)
09820		HLRZ A,(A)
09830	PNL2:	PUSHJ P,FLATSIZE
09840		SUBI A,MAGNO
09850		POP P,B
09860		ADD A,B
09870		ADDI A,2
09880		POPJ P,
09890	
09900	
09910	HUNZ1:	AOS C,-2(P)
09920		JRST HUNZ3(R)
09930	HUNZ2:	MOVE A,(P)
09940		PUSHJ P,FLATSIZE
09950		SUBI A,MAGNO
09960		ADD A,-2(P)
09970		ADDI A,4
09980		MOVE C,A
09990		JRST HUNZ3(R)
10000	
10010	HUNOZ:	PUSH P,C
10020		PUSH P,B
10030		PUSH P,A
10040		HLRZ S,(A)
10050		HRRZ A,(A)
10060		MOVEM A,(P)
10070		JUMPE A,HUNZ1(R)
10080		PUSHJ P,ATOM
10090		JUMPN A,HUNZ2(R)
10100		MOVEI C,0
10110	HUNZ3:	MOVE B,-1(P)
10120		MOVE A,S
10130		PUSHJ P,SPRNT2(R)
10140		POP P,A
10150		JUMPE A,HUNZ4(R)
10160		PUSHJ P,ATOM
10170		JUMPE A,HUNZ4(R)
10180		MOVEI A," "
10190		PUSHJ P,TYO
10200		MOVEI A,"."
10210		PUSHJ P,TYO
10220		MOVEI A," "
10230		PUSHJ P,TYO
10240	HUNZ4:	SUB P,[XWD 2,2](R)
10250	EXIT:	POPJ P,
10260	GR1:	0
10270	
10280	GRN1:	POP P,B
10290		HRRZ B,(B)
10300		JUMPN B,GRN2(R)
10310		POP P,A
10320		SKIPE GR1(R)
10330		JRST GRN4(R)
10340	GRN5:	HRRZ A,(A)
10350		JUMPE A,TERPRI
10360	
10370	GRNDEF:	SETZM GR1(R)
10380		PUSH P,A
10390		MOVE B,TRACE(R)
10400		HLRZ A,(A)
10410		PUSHJ P,GET
10420		JUMPE A,GRN2-1(R)
10430		HLRZ@ AR1,(P)
10440		HRRZ B,(AR1)
10450		PUSH SP,B
10460		HRRZ A,(A)
10470		MOVE B,GLST(R)
10480		PUSHJ P,GETL
10490		HRRM A,(AR1)
10500		HRRZ C,(A)
10510		MOVEM C,GR1(R)
10520		HLRZ D,D
10530		HRRZ D,(D)
10540		HRRZ D,(D)
10550		HRRZ D,(D)
10560		HRRM D,(C)
10570		MOVE B,GLST(R)
10580	GRN2:	HLRZ@ A,(P)
10590		PUSH P,B
10600		HLRZ B,(B)
10610		PUSHJ P,GET
10620		JUMPE A,GRN1(R)
10630		PUSH P,A
10640		PUSHJ P,ATOM
10650		JUMPN A,GRNFOO(R)
10660		POP P,A
10670		HRRZ B,(A)
10680		CAIN B,UNBOUND
10690		JRST GRN1(R)
10700		PUSH P,A
10710	GRNFOO:	PUSHJ P,TERPRI
10720		PUSHJ P,TERPRI
10730		MOVEI A,"("
10740		PUSHJ P,TYO
10750		MOVE A,DEF+1(R)
10760		PUSHJ P,PRIN1
10770		MOVEI A," "
10780		PUSHJ P,TYO
10790		HLRZ@ A,-2(P)
10800		PUSHJ P,PRIN1
10810		MOVEI A," "
10820		PUSHJ P,TYO
10830		PUSHJ P,TERPRI
10840		MOVEI C,0
10850		MOVEI B,2
10860		POP P,A
10870		PUSHJ P,SPRNT2(R)
10880		MOVEI A," "
10890		PUSHJ P,TYO
10900		PUSHJ P,TERPRI
10910		MOVEI B,1
10920		MOVEI C,1
10930		HLRZ@ A,(P)
10940		PUSHJ P,SPRNT2(R)
10950		MOVEI A,")"
10960		PUSHJ P,TYO
10970		JRST GRN1(R)
10980	GRN4:	POP SP,B
10990		HLRZ C,(A)
11000		HRRM B,(C)
11010		HRRZ C,GR1(R)
11020		HLRM C,(C)
11030		JRST GRN5(R)
11040	
11050	TAB:	SKIPN %%TBFLG#(R)
11060		JRST TYO
11070		MOVEI A,40
11080		MOVEI B,10
11090		PUSHJ P,TYO
11100		SOJG B,.-1(R)
11110		POPJ P,
11120	
11130	PPOS:	SUBI A,MAGNO
11140		PUSHJ P,SPR1+1(R)
11150		MOVEI A,0
11160		POPJ P,
11170	
11180	SPRINT:	SUBI B,MAGNO
11190		SUBI C,MAGNO
11200		JRST SPRNT2(R)
11210	
11220	SPR1:	SOS A,-2(P)
11230		PUSH P,A
11240		PUSH P,A
11250		CAIGE A,1
11260		JRST PPL1(R)
11270		MOVE A,LINL
11280		SUB A,CHCT
11290		CAMLE A,-1(P)
11300	PPL1:	PUSHJ P,TERPRI
11310	PPL2:	MOVE A,LINL
11320		SUB A,CHCT
11330		ADDI A,10
11340		CAMLE A,-1(P)
11350		JRST PPL3(R)
11360		MOVEI A,11
11370		PUSHJ P,TAB(R)
11380		JRST PPL2(R)
11390	
11400	PPL3:	SUBI A,10
11410		SUB A,-1(P)
11420		MOVNM A,(P)
11430	PPL4:	SOSGE (P)
11440		JRST PPL5(R)
11450		MOVEI A," "
11460		PUSHJ P,TYO
11470		JRST PPL4(R)
11480	
11490	PPL5:	SUB P,[XWD 2,2](R)
11500		POPJ P,
11510	
11520	SPRNT2:	PUSH P,AR2A
11530		PUSH P,C
11540		PUSH P,B
11550		PUSH P,A
11560		HRRZ A,LINL
11570		MOVEM A,AR2A
11580	SPR2:	PUSHJ P,CHRCT
11590		SUBI A,MAGNO
11600		SUBI A,1(AR2A)
11610		MOVNM A,A
11620		CAMGE A,-1(P)
11630		PUSHJ P,SPR1(R)
11640		MOVE A,(P)
11650		PUSHJ P,ATOM
11660		JUMPN A,SPR3(R)
11670		MOVE A,(P)
11680		PUSHJ P,FLATSIZE
11690		SUBI A,MAGNO
11700		ADD A,-2(P)
11710		MOVEM A,AR1
11720		PUSHJ P,CHRCT
11730		SUBI A,MAGNO
11740		CAML AR1,A
11750		JRST SPR4(R)
11760	SPR3:	POP P,A
11770		MOVE AR2A,-2(P)
11780		SUB P,[XWD 3,3](R)
11790		JRST PRIN1
11800	SPR4:	MOVEI A,"("
11810		PUSHJ P,TYO
11820		MOVE A,(P)
11830		PUSHJ P,LENGTH
11840		SUBI A,MAGNO
11850		CAIG A,1
11860		JRST SPR5(R)
11870		MOVE A,(P)
11880		PUSHJ P,LAST
11890		PUSH P,A
11900		PUSHJ P,FLATSIZE
11910		SUBI A,MAGNO
11920		EXCH A,(P)
11930		PUSHJ P,PANL(R)
11940		SUB A,(P)
11950		EXCH A,(P)
11960		MOVE A,-1(P)
11970		PUSHJ P,FLATSIZE
11980		SUBI A,MAGNO
11990		ADDM A,(P)
12000		PUSHJ P,CHRCT
12010		SUBI A,MAGNO
12020		POP P,B
12030		ADDI B,1
12040		CAML B,A
12050		JRST SPR5(R)
12060	SPR41:	HLRZ@ A,(P)
12070		PUSHJ P,PRIN1
12080		MOVEI A," "
12090		PUSHJ P,TYO
12100		HRRZ @A,(P)
12110		HRRZ B,(A)
12120		MOVEM A,(P)
12130		JUMPN B,SPR41(R)
12140		PUSHJ P,CHRCT
12150		MOVEI B,-MAGNO(A)
12160		MOVE C,-2(P)
12170		MOVE A,(P)
12180		PUSHJ P,HUNOZ(R)
12190	SPREND:	MOVEI A,")"
12200		PUSHJ P,TYO
12210		MOVEI A,0
12220	SPND1:	MOVE AR2A,-3(P)
12230		SUB P,[XWD 4,4](R)
12240		POPJ P,
12250	
12260	SPR5:
12270		MOVE A,(P)
12280		PUSHJ P,LENGTH
12290		SUBI A,MAGNO
12300		CAIG A,2
12310		JRST SPR6(R)
12320		MOVE A,(P)
12330		PUSHJ P,PANL(R)
12340		MOVE AR1,A
12350		PUSHJ P,CHRCT
12360		SUBI A,MAGNO
12370		CAMG A,AR1
12380		JRST SPR6(R)
12390		HLRZ@ A,(P)
12400		PUSHJ P,PRIN1
12410		PUSH P,[0](R)
12420		CAMN A,PRG(R)
12430		SETOM 0(P)
12440		HLRZ@ A,-1(P)
12450		MOVEI AR1,-5(AR2A)
12460		CAME A,LAMB(R)
12470		MOVEI AR1,2(AR2A)
12480		PUSHJ P,CHRCT
12490		SUBI A,MAGNO
12500		SUB AR1,A
12510		MOVEM AR1,-2(P)
12520	SPRA:	HRRZ@ A,-1(P)
12530		HLRZ A,(A)
12540		MOVE B,A
12550		PUSHJ P,ATOM
12560		JUMPE A,SPRA1(R)
12570		MOVEI A," "
12580		PUSHJ P,TYO
12590		JUMPE B,SPRA1(R)
12600		MOVNI B,5
12610		SKIPN 0(P)
12620	SPRA1:	MOVEI B,0
12630		ADD B,-2(P)
12640		HRRZ@ A,-1(P)
12650		MOVE C,-3(P)
12660		PUSHJ P,HUNOZ(R)
12670		JUMPE A,SPRA2(R)
12680		HRRZ@ A,-1(P)
12690		HRRZ A,(A)
12700	SPRA3:	PUSHJ P,PRIN1
12710		POP P,A
12720		JRST SPREND(R)
12730	SPRA2:	HRRZ@ A,-1(P)
12740		MOVEM A,-1(P)
12750		HRRZ A,(A)
12760		JUMPE A,SPRA3+1(R)
12770		PUSHJ P,CHRCT
12780		SUBI A,MAGNO
12790		SUBI A,1(AR2A)
12800		MOVNM A,A
12810		CAML A,-2(P)
12820		PUSHJ P,TERPRI
12830		JRST SPRA(R)
12840	SPR6:	PUSHJ P,CHRCT
12850		SUBI A,MAGNO
12860		SUBI A,1(AR2A)
12870		MOVNM A,-1(P)
12880	SPR6B:	MOVE B,-1(P)
12890		MOVE A,(P)
12900		MOVE C,-2(P)
12910		PUSHJ P,HUNOZ(R)
12920		JUMPE A,SPR6A(R)
12930		HRRZ@ A,(P)
12940		JRST SPRA3A(R)
12950	SPR6A:	HRRZ@ A,(P)
12960		JUMPE A,SPREND(R)
12970		MOVEM A,(P)
12980		PUSHJ P,TERPRI
12990		JRST SPR6B(R)
13000	SPRA3A:	PUSHJ P,PRIN1
13010		JRST SPREND(R)
13020	
13030		VAR
13040		LIT
13050	EDEND:
13060	DEPHASE
13070	END