Google
 

Trailing-Edge - PDP-10 Archives - tops10and20_integ_tools_v9_3-aug-86 - tools/crc/browse/vtmac.mac
There are no other files named vtmac.mac in the archive.
;<KEVIN>VTMAC.MAC.42, 17-Aug-83 14:34:27, EDIT BY KEVIN
;	Add fx$abt
;	Change def of VTSTOR to include TTY jfn
;<KEVIN>VTMAC.MAC.39, 16-Jul-82 12:15:12, EDIT BY KEVIN
;	Make common in VTSTOR work
;<KEVIN>VTMAC.MAC.34,  9-Dec-81 13:37:24, EDIT BY KEVIN
;<KEVIN>VTMAC.MAC.33,  2-Dec-81 17:00:47, EDIT BY KEVIN
;<KEVIN>VTMAC.MAC.32,  2-Dec-81 16:58:45, EDIT BY KEVIN
;<KEVIN>VTMAC.MAC.31,  1-Dec-81 15:01:37, EDIT BY KEVIN
UNIVERSAL	VTMAC - MACROS TO GENERATE TITLE AND ENTRIES FOR VT100
;
;	TWO MACROS ARE CONTAINED HERE. ONE, REGDEF ,GENERATES ACCUMULATOR
;	DEFINITIONS AND SEARCH STATEMENTS. THE OTHER, VTDEF$, PROVIDES A
;	FACILITY TO GENERATE ALL OTHER REQUIRED CALLS FOR THE SCREEN STUFF.
;	ONE ARGUMENT IS REQUIRED, WHICH IS USED IN AN NETRY AND TITLE STATEMENT.
;
;
;	Now also defined is FLXDEF, which defines the FLXSYS function codes
;	and error mnemonics.
;	Many others are now defined - a whole class of them to do with error
;	processing for VTSUBS, and others which provide a standard FORTRAN entry
;	point, and check various essential parameters for VTSUBS
;
;
	SEARCH	MONSYM,MACSYM
	DEFINE	REGDEF	<
	SALL
	SEARCH	MONSYM,MACSYM
	.REQUIRE	SYS:MACREL
	T1==1
	T2==2
	T3==3
	T4==4
	Q1==5
	Q2==6
	Q3==7
	Q4==10
	P1==11
	P2==12
	P3==13
	P4==14
	P5==15
	CX==16
	P=17
	.xcref t1,t2,t3,t4
>

	define	verno	(major,minor,edit,who)	,<
ifnb	<minor>,<byte (3) who(9) major (6) "'minor'"-"A"+1(18)^d'edit>
ifb	<minor>,<byte (3) who (9) major (6) 0 (18) ^d'edit>>

	DEFINE VTDEF$	(NAME)	<
	TITLE	NAME
	$$x=1
	ifidn	<$VTME> <NAME>,$$X=0
	ifidn	<$VTER> <NAME>, $$X=0
	ifn	$$X,	ENTRY	NAME,$'NAME
	ife	$$x,entry	name
	purge	$$x
	REGDEF
	vtedef			;;define error codes
	IFDIF	<VTDAT> <NAME>,	EXTERNAL	TERM$,TRMJFN
	IFDIF	<$VTME> <NAME>,	EXTERNAL	$VTME
	IFDIF	<$VTER>	<NAME>,	EXTERNAL	$VTER
	ESC=33
	LSQB="["
	LITLR="r"
	semic=";"
>
;
;	MACRO TO GENERATE IMPURE STORAGE FOR VTSUBS
;
	DEFINE	VTSTOR,	<
	ifndef	$titl,<	TITLE	VTDAT>
	INTERNAL vtdat,TERM$,VTIMP$,TERM$,JOBN,CURSH$,CLEOL$,VTLED$,PUT$
	INTERNAL	SCDT$,CLEOS$,vtver$,vted$,tbset$,tbclr$,trmjfn


	.COMMON VTERR[3]	;;ERROR CODE IN FORTRAN COMMON
	vted$==vterr+1		;;second word of common block contains error
				;;disposition code - 0=crash,1=return error
	term$==vted$+1
	VTVER==^d29		;;OUR VERSION NUMBER
	vtdat==0		;;dummy for reference

VTIMP$:
vtver$: vtver			;;version number of VTSUBS - checked by VTINIT
;TERM$:	BLOCK	1		;;TERMINAL TYPE CODE
JOBN:	0
CURSH$:	BLOCK	2
CLEOS$:	BLOCK	1
scdt$:	block	2
put$:	block 2
CLEOL$:	BLOCK	1
vtled$:	exp	0		;one word for escape sequence
tbset$:	block	2
tbclr$:	block	1
trmjfn:	.priou		;Initial output
	>

	define $verrs ,<

	$verr	0,vt$ver,<Incompatible version of VTSTOR and VTSUBS>
	$verr	1,vt$nst,<Terminal not a supported type>
	$verr	2,vt$scr,<Bad scrolling region parameters>
	$verr	3,vt$nin,<VTINIT not called>
	$verr	4,vt$n10,<Terminal is not a VT100 - cannot perform function>
	$verr	5,vt$neg,<Illegal negative parameter for cursor movement>

	>

	define	vterr (error),	<
	jrst	[movei	t1,error		;;get error code
		jrst	$vter]			;;call error processor
	>

	define	vtedef,	<

;;
;;	This definition of $verr defines the symbols for error codes.
;;	it is redefined in VTSUBS to store the error text
;;
	define	$verr (ernum,ersym,ertxt) ,<
	ersym==ernum		;;ignore error text for the moment
	>

		$verrs
>

	define efort,<
		;;now a null macro after fortran V6	>

	define	vtchk,<
	skipn	term$		;;has VTINIT initialised the terminal type ?
	 vterr	vt$nin		;;no, give an error
	>

;
;	This macro is used to generate parameterised or non-parameterised escape
;	sequence routines. The format is
;	SEQ	ADDR,<Char,char...>,parad,<char,char,...>
;
;	Where ADDR is the address of a buffer,the second parameter is a list
;	of characters to be the start of the sequence, parad is the (optional)
;	address of a numeric parameter, and the last optional sequence
;	is of further characters.The whole will be output to the screen
;	Example of use:
;	seq	$led,<esc,"[">,t2,"q"
;	to send LED sequence with led number in t2
;
	define	seq(imp,csi,param< >,trail< >),<

IFB	<param>,<			;no parameter ?
	hrroi	t2,[byte (7)csi,0]	;;yes, just point to fixed sequence
	move	t1,trmjfn		;;Point to output jfn
	setzb	t3,t4			;;write ASCIZ
	sout%				;;and output
		>

IFNB	<param>,<			;;parameters exist
	push	p,param			;;save par (may be in ac)
	move	t1,[point 7,imp]
	hrroi	t2,[byte (7) csi,0]	;;fixed sequence
	setz	t3,t4
	sout%				;;output ot impure store
	 ercal	$vtme
	pop	p,t2			;;restore numeric paramter
	movx	t3,^d10			;;radix 10
	nout%
	 ercal	$vtme
IFNB	<trail>,<			;;trailing sequence ?
	hrroi	t2,[byte (7)trail,0]
	setz	t3,t4
	sout%
	 ercal	$vtme
	>				;;end of trail conditional
	move	t1,trmjfn		;;Point to output TTY
	hrroi	t2,imp			;;point to sequence
	setzb	t3,t4			;;write ASCIZ
	sout%
		>>
	define flxdef,	<

;;
;;	function codes
;;
fx$sho==1		;;return one page packet with queue listing
fx$cls==2		;;close log file (privileged)
fx$rnm==3		;rename file to this name
fx$prt==5		;print file at remote node
fx$del==6		;delete queue entry
fx$int==7		;change sleep interval
fx$hld==10		;block all plots
fx$rel==11		;release all plots
fx$abt==12		;abort current plot
fx$tim==13		;change timeout interval
;;
;;	return codes
;;
f$$suc=100		;success
f$$jse=102		;Jsys error follows in next word
f$$ilu=106			;illegal unit number
f$$qfu=107			;queue is full
f$$ilf=101			;illegal function
f$$iid==110		;illegal request ID or insufficent privileges
f$$rad==111		;request already deleted
;;
;;	related definitions
;;
fx$sln==^d21			;maximum length of a message to FLXSYS
fx$rln==^d2			;maximum length of reply from FLXSYS
	>
	END