Google
 

Trailing-Edge - PDP-10 Archives - custsupcuspmar86_bb-x130b-sb - strdcl.mac
There are 27 other files named strdcl.mac in the archive. Click here to see a list.
	UNIVERSAL STRDCL
	SALL
	NOSYM

	SUBTTL   MACROS (USED BY THE LIBRARY ROUTINES)



;COPYRIGHT (C) 1974,1978,1979 BY
;DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
;
;
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
;ONLY  IN  ACCORDANCE  WITH  THE  TERMS  OF  SUCH LICENSE AND WITH THE
;INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE OR ANY  OTHER
;COPIES THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
;OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF THE  SOFTWARE  IS  HEREBY
;TRANSFERRED.
;
;THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT  NOTICE
;AND  SHOULD  NOT  BE  CONSTRUED  AS A COMMITMENT BY DIGITAL EQUIPMENT
;CORPORATION.
;
;DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY  OF  ITS
;SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DIGITAL.
;	USED TO GENERATE FORTRAN COMPAT. CALLS
;	3 TYPES OF ARGS
;	$1 = INDIRECT
;	$2 = CONSTANT COMPILE TIME LOCATION
;	NULL = REGISTER

; AS WRITTEN, DECR WILL CORRECTLY HANDLE ONLY 7-BIT BYTES
; IN NORMAL ALIGNMENT

	DEFINE DECR(INSTR,BYTE,BP) <

	IFN ANYSIZ,<
	SKIPGE	BP		;THIS IS IMPERFECT
	JRST	[HRLI	BP,RMBYTE	;HERE IF "440700" BP
		 SOJA	BP,.+1]
	INSTR	BYTE,BP
	CAML	BP,[MAXBP,,0]
	JRST	[HRLI	BP,RMBYTE
		 SOJA	BP,.+2]
	ADD	BP,[SIZ2PF,,0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ST(A) <$2,A>

	DEFINE ERROR (A,B) <
	IFNB <B>,<
	JRST	[PUSH	P,[B]
		 JRST	A]>
	IFB <B>,<
	PUSHJ	P,A>>

	DEFINE LOCSUB (A,B) <
	C.....=0
	IFNB <B>,< IRP B,<C.....=C.....+1
			 PUSH	P,B>>
	PUSHJ	P,A 
	IFN C.....,< SUB	P,[C.....,,C.....]>
>

	DEFINE STRARG(OFFS,REG,BP$,LEN$,MAX$) <
	LDB	R0,[TYPCOD+REG,,OFFS]

	MOVEI	R1,@OFFS(REG)
	LOCSUB	CANON$##
	IFNB <BP$>, <MOVEM	R0,BP$>
	IFNB <LEN$>, <HRRZM	R1,LEN$>
	IFE	BND.CH,<
	IFNB <MAX$>, <HLRZM	R1,MAX$>>
>

	DEFINE	FUNCT(A,B)<
;	SALL
	T.....=0
	ST....=1
	IF2,<IFNDEF A,<EXTERNAL A>>
	IFNB <B>,<
	PUSH	P,AP
	IRP	B,<IFIDN <B> <$1>, <ST....=0>
		   IFIDN <B> <$2>, <ST....=-1>
		   IFDIF <B> <$1>,<
			IFDIF <B> <$2>,<
			   IFG ST....,<PUSH	P,B
			   T.....=T.....+1
>
			   ST....=1>>>
	R.....=0
	   IRP  B,<IFIDN <B> <$1>, <ST....=0>
		   IFIDN <B> <$2>, <ST....=-1>
		   IFDIF <B> <$1>,<
			IFDIF <B> <$2>,<
			   IFE ST....,<T......=T......+1
				    PUSH	P,B>
			   IFL ST....,<T.....=T.....+1
				    PUSH	P,[B]>
			   IFG ST....,<T......=T......+1
					R.....=R.....+1
					HRRZI	AP,-T.....+R.....+1(P)
					PUSH	P,AP
>
			   ST....=1>>>>
	MOVEI	AP,-T.....+R.....+1(P)
	PUSHJ	P,A
	IFNB <B>,<
	SUB	P,[T.....,,T.....]
	POP	P,AP>>

	DEFINE SAVE (A)<
	IRP A,<	PUSH	P,A>>

	DEFINE RESTOR (A)<
	IRP A,<	POP	P,A>>


	DEFINE	SAVALL <
	HRRZ	R0,P
	ADD	R0,[2,,1]
	BLT	R0,16(P)
	ADD	P,D13D13##>

	DEFINE RETURN <
	JRST	RAX$##>

	DEFINE POPALL <
	SUB	P,D13D13##
	HRLZ	AP,P
	ADD	AP,[1,,2]
	BLT	AP,16>


;	DEFINE HELLO (A,B)<
;	SALL
;	IFNB <B>,<IFIDN <B>,<.>,<SIXBIT /A/
;				 ENTRY A'.
;				 A'.:>
;		  IFDIF <B>,<.>,<SIXBIT /B/
;				 ENTRY A
;				 A:>
	;MODULE WIDE NAMES

	R0=0	;FUNCT RET REG
	R1=1	;DITTO (FOR DP)
	R2=2	;MAXLEN IN EXPANDED (UBS) -- A TEMP
	BP1=3	;BYTE PTR (THE MORE PERM. IF A DIFFERENCE)
	LEN1=4	;LEN OF STRING 1
	ML1=5	;MAX LEN OF STR 1
	BP2=6
	POS1=BP2
	LEN2=7
	POS2=LEN2
	MODE=10	;CONTROL WORD
	CNT=11	;FOR VAR LEN ARG LISTS
	C1=12	;CHAR REG
	T1=13	;RENAMED AS NEEDED
	BASP=T1
	T0=14
	MASK=T0
	ST.IBP=T0
	CAP=T0	;CURR ARG PTR
	SVP=15	;SAVE PC REG, USED FOR SIDE ENTRY POINTS
	AP=16	;ARG LIST PTR (IN FORTRAN SENSE)
	P=17	;PDL PTR

	;BIT PATTERNS

	APPEND=1B35
	CHKPNT=1B34
	OCTAL=1B33
	PAD=1B32

	TRACE=1B35
	IGNORE=1B34
	EXACT=1B33
	MIXMODE=1B32

	IDX.E=1B35
	ANCHOR=1B34	;INTERNALLY ANCHOR IS HALF-IN-HALF-OUT
	HIHO=1B34	;HALF IN HALF OUT
	PARTIA=1B33
	ENTIRE=1B33	;SEE CODE FOR WHY SAME
	BAKWDS=1B32
	MORE.1=1B32
	WHICH=1B31
	RETUBS=1B30	;USED BY SIDE ENTRY POINTS

	TO.ASCII=1B35
	Z.PAD=1B34
	NOFILL=1B33
	ALWAYS=1B32

	TLATE=1B34
	LB.UB=1B33
	YES.IN=1B32

	;OTHER CONSTANTS

	TABSIZ=200	;TAZSTR AND TAOSTR ASSUME ASCII
	CPW=5	;CHARS PER WORD
	IPOSIZ=440700	;INITIAL POS/SIZE
	BYTSIZ=7
	BPPOS=360600
	BPSIZ1=300600
	BPSIZ2=300615	;INDEX OFF SVP IN REL$
	SIZ2PF=70000
	MAXBP=350000
	PAD.CH=40
	EQL=0
	TYPCOD=270400		;POSIT./SIZE OF ARG LIST TYPE CODE
	RMBYTE=010700

	;ASSEMBLY/LOAD PARAMETERS

	BND.CH=0
	ANYSIZ=0
	HIGH=1
	CHECK=0
	MESSAG=0
	STR.NW=:0

	END