Google
 

Trailing-Edge - PDP-10 Archives - LCG_Integration_Tools_Clearinghouse_T20_v7_30Apr86 - tools/tvaxv2/tvmacros.mar
There are 5 other files named tvmacros.mar in the archive. Click here to see a list.
.MACRO	WROUTDEF	X
	.SAVE
	.PSECT	DATA,LONG,NOWRT,SHR
...TMPA=.
	.ASCII	\             \
.=...TMPA
	.NARG	ARGCNT
	.IF	EQ	ARGCNT
	.ASCII	\SYS$OUTPUT\
	.IF_FALSE
	.ASCII	\X\
	.ENDC
	.RESTORE
	PUSHAL	...TMPA
	CALLS	#1,G^GENR18D
.ENDM
.MACRO	CVTCLP	X,Y,Z
	MOVB	#^A'+',-Y-1(SP)
	MOVC3	#Y,X,-Y(SP)
	CVTSP	#Y,-Y-1(SP),#15,-9-Y(SP)
	CVTPL	#15,-9-Y(SP),Z
.ENDM
.MACRO	IF.	CND
	.IF	EQ	INITSW.&<1@1>
IF_MAX.=0
INITSW.=INITSW.!<1@1>
IF_LEV.=0
	.ENDC
	.IF	EQ	IF_LEV.
IF_STAT.=0
IF_USE.=0
IF_CNT.=0
IF_STRT.=IF_MAX.
	.ENDC
IF_CNT.=IF_CNT.+1
IF_MAX.=IF_MAX.+1
IF_LEV.=IF_LEV.+1
	IFC.	<CND>
IF_STAT.=IF_STAT.!<1@IF_CNT.>
.ENDM
.MACRO	IFC.	C
	.IF	EQ	%LOCATE(C,<*EQ>)
	IFL.	BEQL,\IF_MAX.
	.MEXIT
	.ENDC
        .IF     EQ      %LOCATE(C,<*GT>)
        IFL.    BGTRU,\IF_MAX.
        .MEXIT
        .ENDC
        .IF     EQ      %LOCATE(C,<*OVERFLOW>)
        IFL.    BVS,\IF_MAX.
        .MEXIT
        .ENDC
        .IF     EQ      %LOCATE(C,<*GTS>)
        IFL.    BGTR,\IF_MAX.
        .MEXIT
        .ENDC
        .IF     EQ      %LOCATE(C,<*NE>)
        IFL.    BNEQ,\IF_MAX.
        .MEXIT
        .ENDC
        .IF     EQ      %LOCATE(C,<*ZERO>)
        IFL.    BEQL,\IF_MAX.
        .MEXIT
        .ENDC
        .IF     EQ      %LOCATE(C,<*LE>)
        IFL.    BLEQU,\IF_MAX.
        .MEXIT
        .ENDC
	.IF	EQ	%LOCATE(C,<*LES>)
	IFL.	BLEQ,\IF_MAX.
	.MEXIT
	.ENDC
        .IF     EQ      %LOCATE(C,<*LT>)
        IFL.    BLSSU,\IF_MAX.
        .MEXIT
        .ENDC
	.IF	EQ	%LOCATE(C,<*LTS>)
	IFL.	BLSS,\IF_MAX.
	.MEXIT
	.ENDC
        .IF     EQ      %LOCATE(C,<*ON>)
        IFL.    BNEQ,\IF_MAX.
        .MEXIT
        .ENDC
        .IF     EQ      %LOCATE(C,<*OFF>)
        IFL.    BEQL,\IF_MAX.
        .MEXIT
        .ENDC
        .IF     EQ      %LOCATE(C,<*NONZERO>)
        IFL.    BNEQ,\IF_MAX.
        .MEXIT
        .ENDC
        .IF     EQ      %LOCATE(C,<*GE>)
        IFL.    BGEQU,\IF_MAX.
        .MEXIT
        .ENDC
        .IF     EQ      %LOCATE(C,<*GES>)
        IFL.    BGEQ,\IF_MAX.
        .MEXIT
        .ENDC
        .IF     EQ      %LOCATE(C,<*OVER>)
        IFL.    BVS,\IF_MAX.
        .MEXIT
        .ENDC
	.IF	EQ	%LOCATE(C,<*ERROR>)
	IFL2.	\IF_MAX.
	.MEXIT
	.ENDC
	.IF	EQ	%LOCATE(C,<*NOERROR>)
	IFL3.	\IF_MAX.
	.MEXIT
	.ENDC
	.ERROR	1;WRONG CONDITION IN IF;
.ENDM
.MACRO	IFL.	BI,LL,?L1
	BI	L1
	BRW	IF.'LL
IF_RTC.=1
L1:
.ENDM
.MACRO	IFL2.	LL,?L1
	BLBC	R0,L1
	BRW	IF.'LL
IF_RTC.=1
L1:
.ENDM
.MACRO	IFL3.	LL,?L1
	BLBS	R0,L1
	BRW	IF.'LL
IF_RTC.=1
L1:
.ENDM
.MACRO	ENDIF.
	LOCAT.
	.IIF	EQ	IF_I.,.MEXIT
	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
	ADDL2	R10,R9
	MOVAB	LLK,GTAP(R9)		;STORE ADDR OF LOCK
	SUBL2	R10,GTAP(R9)		;MAKE IT OFFSET
	ADDW2	#1,1+LLK
L1:	ADDL3	R10,GTSWA(R9),R0
	MOVB	#3,(R0)		;STORE WAIT INDICATION
	BBCS	#0,LLK,L2
	$HIBER_S
	BRW	L1
L2:	ADDL3	R10,GTSWA(R9),R0
	MOVB	#0,(R0)
	DECW	1+LLK		;WAIT COUNT
	SUBL2	R10,R9
L3:	MOVL	R9,3+LLK		;PTR TO TCB
.ENDM
.MACRO	UNLOCKG	LLK,?L1
	CMPL	R9,3+LLK
	BNEQ	L1		;BR IF NOT OWNER
	CLRL	3+LLK
	MOVB	#0,LLK
	TSTW	1+LLK
	BEQL	L1		;BR IF NOBODY WAITING
	MOVAB	LLK,R1
	CALLS	#0,G^GADI09
L1:
.ENDM
.MACRO	ABEND	TXTLL,TXT
	.NARG	ARGCNT
	.IF	EQ	ARGCNT-1
	WROUT	<TXTLL>
	.IF_FALSE
	WROUT	TXTLL,TXT
	.ENDC
	$EXIT_S
.ENDM
.MACRO	ABEND0	TXTLL,TXT
	PUSHL	R0
	.NARG	ARGCNT
	.IF	EQ	ARGCNT-1
	WROUT	<TXTLL>
	.IF_FALSE
	WROUT	TXTLL,TXT
	.ENDC
	POPL	R0		;RELOAD R0
	$EXIT_S R0
.ENDM
.MACRO	SDCATDEF
	.SHOW	ME
;
;	CATALOG LAYOUT;
;;
CDBNAM=0			;DATABASE NAME;
CDBREF=CDBNAM+10		;REL DB NR;
CDBAFA=CDBREF+2			;ADDR FIRST AREA;
CDBAFR=CDBAFA+4			;ADDR FIRST RECORD;
CDBOPEN=CDBAFR+4		;OPEN MODE;
CDBIMPT=CDBOPEN+1		;IMPART MODE;
CDBRECA=CDBIMPT+1		;RECORD SAVE AREA;
;;
;	AREA ENTRY;
;;
CANAM=0				;AREA NAME;
CABUF=CANAM+54			;NUMBER OF BUFFERS;
CANBPGE=CABUF+2			;NUMBER OF PAGES;
CASZPGE=CANBPGE+4		;PG SIZE IN BYTES;
CALIMIT=CASZPGE+2		;FREE SPACE LIMIT;
CAREF=CALIMIT+2			;AREA REFERENCE;
CATYP=CAREF+2			;AREA TYPE;
CALL=CATYP+1			;LENGTH;
;;
;	RECORD ENTRY;
;;
RECORD=0;
CRNAM=0				;RECORD NAME;
CRREF=CRNAM+10			;RECORD REFERENCE;
CRLNG=CRREF+2			;RECORD LENGTH;
CRAREF=CRLNG+2			;AREA REFERENCE;
CRAFACC=CRAREF+2		;ADDR FIRST ACCESS PATH;
CRAFREL=CRAFACC+4		;ADDR FIRST RELATION;
CRLL=CRAFREL+4			;LENGTH;
;;
;	ACCESS PATH;
;;
CPNAM=0				;ACCESS PATH NAME;
CPREF=CPNAM+30			;ACCESS PATH REFERENCE;
CPMRELAD=CPREF+2		;ADDRESS MATCHED RELATION;
CPSRT=CPMRELAD+4		;ACCESS PATH KIND;
CPSKETS=CPSRT+1			;NR OF ENTRIES IN SELECT KEY;
CPLL=CPSKETS+2			;LENGTH;
;;
;	RELATION ENTRY;
;;
RELAT=0;
CSOREF=0			;OWNER RECORD REF;
CSOKETS=CSOREF+2		;NR OF ENTRIES IN OWNER KEY;
CSSRT=CSOKETS+2			;RELATION MODE (OPT/MAND);
CSXMAN=^X01			;OBLIGED;
CSXEBC=^X02			;EBCDIC KEY SEQUENCE;
CSDUPL=CSSRT+1			;DUPLICATES OPTION;
CSIAREF=CSDUPL+1		;INDEX AREA REF;
CSIRREF=CSIAREF+2		;INDEX RECORD REF;
CSAFKEY=CSIRREF+2		;ADDR FIRST INDEX KEY;
CSLL=CSAFKEY+4			;LENGTH;
;;
;	INDEX KEY ENTRY;
;;
INDKEY=0;
CKDSP=0				;KEY DISPLACEMENT;
CKLNG=CKDSP+2			;KEY LENGTH;
CKLL=CKLNG+2			;LENGTH;
;;
;	LAYOUT SULM;
;;
;	LOGICAL SDMS PART;
;;
CGRECOP=0			;ADDR RECORD OCCURRENCE;
CGSAVDBK=CGRECOP+4		;DB KEY SAVE AREA;
CGDBK=CGSAVDBK+4		;DATABASE KEY;
CGKEY1=CGDBK+4+2		;LOGICAL INDEX KEY;
CGKEY2=CGKEY1+254		;OLD KEY;
CGKEY3=CGKEY2+254		;NEW KEY;
CGRELTAB=CGKEY3+254		;ROLLBACK TABLE;
CGSAVRTC=CGRELTAB+<10*4>		;SAVE RETURN CODE;
CGREMREF=CGSAVRTC+2		;SAVE RECORD REF;
CGSAVRP=CGREMREF+2		;SAVE RECORD PTR;
CGSPREL=CGSAVRP+4		;ADDR SPECIFIC RELATION;
CGKLL=CGSPREL+4			;LENGTH OF SELECT OR OWNER KEY;
CGKTLL=CGKLL+2			;TOTAL LENGTH INDEX KEY;
;;
;	PARAMETER AREA LOGICAL SDMS;
;;
CGPARAM=CGKTLL+2			;PAR AREA;
CPAFNR=CGPARAM			;FUNCTION;
CPADBNR=CPAFNR+2		;DB NR;
CPAANR=CPADBNR+2		;AREA NR;
CPARNR=CPAANR+2			;RECORD TYPE;
CPARLL=CPARNR+2			;RECORD LENGTH;
CPARTN=CPARLL+2			;RETURN CODE;
CPADBA=CPARTN+2			;DB CATALOG ADDR;
CPADBK=CPADBA+4			;DATABASE KEY;
CPARECA=CPADBK+4		;ADDR RECORD;
CPACTWA=CPARECA+4		;ADDR CURRENCY AREA;
;;
;	LAYOUT INTERFACE CB TO GSBI50;
;;
CIFNR=0				;FUNCTION;
CIACCRF=CIFNR+2			;ACCES PATH REF;
CICATA=CIACCRF+2		;CATALOG ADDR;
CIRECA=CICATA+4			;RECORD ADDR;
CIACCA=CIRECA+4			;ACC PATH ADDR;
CIRECP=CIACCA+4			;RECORD ENTRY ADDR;
CISAVP=CIRECP+4			;ADDR CURRENCY AREA;
CIRTC=CISAVP+4			;RETURN CODE;
CILL=CIRTC+2			;LENGTH;
	.NOSHOW	ME
	.PAGE
.ENDM
.MACRO	INIT	NAME
	.PSECT	NAME,QUAD,NOSHR,WRT
	.ENTRY NAME,^M<R2,R3,R4,R5,R6,R7,R8,R9,R10,R11>
INITSW.=0
.ENDM
.MACRO	WROUT	P1,P2
	.NARG	ARGCNT
	.IF	EQ	ARGCNT-1
	.SAVE
	.PSECT	DATA,LONG,NOWRT,SHR
...TMPA=.
	.ASCII	\P1\
...TMPL=.-...TMPA
...TMPP=.
	.ADDRESS	...TMPL
	.ADDRESS	...TMPA
	.RESTORE_PSECT
	PUSHAL	...TMPP
	CALLS	#1,G^GENR18O
	.IF_FALSE
	.SAVE
	.PSECT	DATAW,LONG,WRT,NOSHR
...TMPP=.
	.BLKL	2
	.RESTORE_PSECT
	MOVAB	P2,...TMPP+4
	MOVZWL	P1,...TMPP
	PUSHAL	...TMPP
	CALLS	#1,G^GENR18O
	.ENDC
.ENDM
.MACRO	ON_ERROR	DEST,?L
	BLBS	R0,L
	BRW	DEST			;BR WITH WORD OFFSET
L:
.ENDM
.MACRO	RDATA	TEXT
	.SAVE_PSECT
	.PSECT	DATA,LONG,NOWRT,SHR
...TMPA=.
	.BYTE	13,10			;CR LF
	.ASCII	\TEXT\
...TMPL=.-...TMPA			;LENGTH
...TMPP=.
	.ADDRESS	...TMPL
	.ADDRESS	...TMPA
	.RESTORE_PSECT
	.SAVE_PSECT
	.PSECT	DATAW,LONG,WRT,NOSHR
...TMPI=.
	.BLKL	2
	.RESTORE_PSECT
	PUSHAL	...TMPI
	PUSHAL	...TMPP
	CALLS	#2,G^GENR18I
	MOVZWL	...TMPI,R1
	MOVL	...TMPI+4,R2	;ADDR INPUT
.ENDM
.MACRO	EDIT	SRC,LL,DEST
	.IF	EQ	INITSW.&<1@2>
EDIT_P.=0			;FIRST TIME
INITSW.=INITSW.!<1@2>
	.ENDC
	CVTLP	SRC,#LL,-8(SP)
	.IF	EQ	EDIT_P.&<1@LL>	;PATTERN NOT DEFINED
	.SAVE_PSECT
	.PSECT	DATA,LONG,NOWRT,SHR
	EDITP	LL
	.RESTORE_PSECT
EDIT_P.=EDIT_P.!<1@LL>
	.ENDC
	EDITPC	#LL,-8(SP),EDITP'LL,DEST
.ENDM
.MACRO	EDITP	LL
	.IF	EQ	LL-1
EDITP'LL:
	.BYTE	3,^X91,^X04,^X00
	.MEXIT
	.ENDC
	.IF	EQ	LL-2
EDITP'LL:
	.BYTE	^X91,3,^X91,4,0
	.MEXIT
	.ENDC
	.IF	EQ	LL-3
EDITP'LL:
	.BYTE	^X92,3,^X91,4,0
	.MEXIT
	.ENDC
	.IF	EQ	LL-4
EDITP'LL:
	.BYTE	^X91,^X44,^X2C,^X92,3,^X91,4,0
	.MEXIT
	.ENDC
	.IF	EQ	LL-5
EDITP'LL:
	.BYTE	^X92,^X44,^X2C,^X92,3,^X91,4,0
        .MEXIT
        .ENDC
        .IF     EQ      LL-6
EDITP'LL:
        .BYTE   ^X93,^X44,^X2C,^X92,3,^X91,4,0
        .MEXIT
        .ENDC
        .IF     EQ      LL-7
EDITP'LL:
        .BYTE   ^X91,^X44,^X2C,^X93,^X44,^X2C,^X92,3,^X91,4,0
        .MEXIT
        .ENDC
        .IF     EQ      LL-8
EDITP'LL:
        .BYTE   ^X92,^X44,^X2C,^X93,^X44,^X2C,^X92,3,^X91,4,0
        .MEXIT
        .ENDC
        .IF     EQ      LL-9
EDITP'LL:
        .BYTE   ^X93,^X44,^X2C,^X93,^X44,^X2C,^X92,3,^X91,4,0
        .MEXIT
        .ENDC
        .IF     EQ      LL-10
EDITP'LL:
        .BYTE   ^X91,^X44,^X2C,^X93,^X44,^X2C,^X93,^X44,^X2C,^X92,3,^X91,4,0
        .MEXIT
        .ENDC
	.MERROR	1	;WRONG PARAMETER VALUE;
.ENDM
.MACRO	SFUNC
OPEN=0
CLOSE=1
READUNI=2
READNXT=3
WRITE=4
REWRITE=5
DELETE=6
LOCKUPD=7
DEPART=8
LOCKEXCL=9
WRITEDU=10
IMPART=11
CHECKPT=12
.ENDM
.MACRO	SRTCS
NOIMPT=1
IMPTDONE=2
KEYWRONG=3
DUPLIC=4
NORDDONE=5
ACTOWNR=6
NOTFOUND=7
NOTNEXT=8
NOOWNREC=9
.ENDM
.MACRO	PLOAD	LL,ADR,?L1,?L2
	.IF	EQ	INITSW.&<1@3>
	.SAVE_PSECT
	.PSECT	DATAW,LONG,WRT,NOSHR
INITSW.=INITSW.!<1@3>			;SET FIRST TIME
PLOADIN:	.LONG	512,512
PLOADRET:	.LONG	0,0
PLOADFAB:	$FAB	FOP=UFO,DNM=<.EXE>
	$SECDEF
	.RESTORE_PSECT
	.ENDC
	MOVB	LL,PLOADFAB+FAB$B_FNS
	MOVAB	ADR,PLOADFAB+FAB$L_FNA
	$OPEN	FAB=PLOADFAB
	ON_ERROR	L1
	$CRMPSC_S INADR=PLOADIN,RETADR=PLOADRET,-
		FLAGS=#SEC$M_CRF!SEC$M_EXPREG!SEC$M_WRT,-
		CHAN=PLOADFAB+FAB$L_STV,-
		PAGCNT=#0,VBN=#2
	ON_ERROR	L1
;	$CLOSE	FAB=PLOADFAB
;	ON_ERROR	L1
	MOVL	PLOADRET,R1		;RETURN START ADDR
L1:
.ENDM