Google
 

Trailing-Edge - PDP-10 Archives - bb-d868b-bm_tops20_v3a_2020_dist - 3a-sources/sbsmac.mac
There are 4 other files named sbsmac.mac in the archive. Click here to see a list.
UNIVER	SBSMAC  --  DECsystem 10/20 Subsystems Parameter File
SUBTTL	Larry Samberg - Chuck O'Toole /CER  6 Aug 76

	SEARCH	MACTEN			;SEARCH SYSTEM MACRO DEFINITIONS

	SALL				;SUPRESS MACRO EXPANSIONS

%%.SBS==1				;MAJOR CHANGE NUMBER OF SBSMAC


SBSVER==1				;MAJOR VERSION NUMBER
SBSMIN==0				;MINOR VERSION NUMBER
SBSWHO==0				;LAST EDITOR
SBSEDT==3				;EDIT NUMBER



;COPYRIGHT (C) 1976, 1977, 1978 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.


;THIS FILE CONTAINS SYMBOL AND MACRO DEFINITIONS WHICH ARE COMMON TO
;	ALL PROGRAMS DEVELOPED BY THE DECSYSTEM-10/20 SUBSYSTEMS
;	GROUP.  THESE PROGRAMS INCLUDE AT PRESENT:
;
;		1)ALL GALAXY COMPONENTS
;		2)PULSAR (TAPE LABEL PROCESS)
;
;THIS FILE ALSO ACTS AS THE ADMINISTRATION MODULE FOR OTHER COMMON
;	SUBSYSTEMS MODULES AS THEY ARE DEVELOPED.
SUBTTL	Table of Contents

;               TABLE OF CONTENTS FOR SBSMAC
;
;
;                        SECTION                                   PAGE
;    1. Table of Contents.........................................   2
;    2. Revision History..........................................   3
;    3. Accumulator Definitions...................................   4
;    4. Local UUOs for SBS??? Modules.............................   5
;    5. SYSPRM Macro..............................................   6
;    6. MIN and MAX Macros........................................   7
;    7. The SAVE Macro............................................   8
;    8. Macros To Work With The Data Structures...................   9
;    9. The STOPCD Macro..........................................  11
SUBTTL	Revision History


COMMENT	\

Edit	Module	Explanation

   1	SBSMAC	Create file from QSRMAC 1A(36).

   2	SBSMAC	Remove STOREZ macro, it was a bad idea.
		Define STOPCD macro to expand as a Local UUO.
			This requires any component that uses STOPCD's to provide
			a handler for Local UUOs.  If none, a HALT is executed.
		Reserve Opcodes 030-037 for SBS??? Modules.

   3	SBSCOM	Invent .ZPAGA and .ZPAGN to zero out pages.



\   ;End of Revision History
SUBTTL	Accumulator Definitions

;THE FOLLOWING ACCUMULATOR DEFINITIONS ARE STANDARD THROUGHOUT THE
;	SUB-SYSTEMS GROUP AND MAY NOT BE CHANGED.  THE ACCUMULATORS DEFINED ARE:

	TEMP==0			;AC 0 IS USED AS A TEMP AND CANNOT BE GUARANTEED

	S1==1			;S1 & S2 ARE ARGUMENTS TO I$xxxx ROUTINES
	S2==2			;AND ARE OTHERWISE SCRATCH

	T1==3			;T1 - T4 ARE TEMPORARY REGS
	T2==4
	T3==5
	T4==6

	P1==7			;P1 - P4 ARE PRESERVED REGS
	P2==10
	P3==11
	P4==12

	P==17			;PUSHDOWN POINTER

;THERE ARE COMMON ROUTINES IN THE SBSCOM MODULE TO SAVE/RESTORE THE
;	"T" REGS AND THE "P" REGS AS WELL AS OTHER USEFUL THINGS, THE READER
;	IS DIRECTED TO THAT MODULE.

;AC'S 13,14,15, & 16 ARE AVAILABLE TO THE COMPONENT AND MAY BE USED
;	TO ANY END.  COMMON CO-ROUTINES .SV13, .SV14, ETC... ARE INCLUDED
;	IN SBSCOM AND THE APPROPRIATE SAVE MACRO IS DEFINED HERE.
SUBTTL	Local UUOs for SBS??? Modules

;OPCODES IN THE RANGE OF 030 TO 037 ARE RESERVED FOR SUBSYSTEM GROUP MODULES.
;	THE MAIN MODULE MUST PROVIDE A LOCAL UUO HANDLER IF THEY ARE EXECUTED.

;THAT IS: ANY COMPONENT MAY HANDLE STOPCD'S AS IT SEES FIT BUT THERE IS
;	A STANDARD MECHANISM FOR "GENERATING" A STOPCD SIGNAL.


	OPDEF	.STCD.	[030B8]		;STOPCD CALL
SUBTTL	SYSPRM Macro

;THE SYSPRM MACRO IS USED TO DEFINE A SYMBOL WHOSE VALUE IS DIFFERENT
;	DEPENDING ON THE OPERATING SYSTEM WHICH THE PROGRAM IS
;	BEING ASSEMBLED FOR.
;
;	THE CALL IS:
;
;	  SYSPRM   'SUBSYSTEM-NAME' , 'TOPS10 VALUE' , 'TOPS20 VALUE'


DEFINE	SYSPRM(SYMBOL,UUOS,JSYS),<
	IFNB <UUOS>,<IFN FTUUOS,<SYMBOL==UUOS>>
	IFNB <JSYS>,<IFN FTJSYS,<SYMBOL==JSYS>>
>  ;END DEFINE SYSPRM
SUBTTL	MIN and MAX Macros

;THE MIN AND MAX MACROS FIND THE MIN OR MAX OF THE ITEMS IN THE FIRST
;	ARGUMENT LIST.  THE SYMBOL NAMED BY THE SECOND ARGUMENT WILL BE
;	DEFINED AS THE MIN OR MAX OF THE LIST.  IF THE SECOND ARGUMENT
;	IS MISSING, "MINSIZ" OR "MAXSIZ" IS DEFINED.

DEFINE	MAX(A,B),<
	IFB <B>,<MAXSIZ==0
		IRP A,<IFG <A-MAXSIZ>,<MAXSIZ==A>>>
	IFNB <B>,<B==0
		IRP A,<IFG <A-B>,<B==A>>>
>  ;END OF DEFINE MAX

DEFINE	MIN(A,B),<
	IFB <B>,<MINSIZ==377777,,777777
		IRP A,<IFG <MINSIZ-A>,<MINSIZ==A>>>
	IFNB <B>,<B==377777,,777777
		IRP A,<IFG <B-A>,<B==A>>>
>  ;END OF DEFINE MIN
SUBTTL	The SAVE Macro

;THE SAVE MACRO IS USED TO CALL THE CORRECT CO-ROUTINE IN SBSCOM TO
;	SAVE/RESTORE THE SPECIFIED ACCUMULATOR.  THIS OPERATION IS
;	THE SAME AS THE STANDARD ".SAVE1" TYPE CALL.

DEFINE	SAVE(AC),<.SAVE.(\AC)>

DEFINE	.SAVE.(AC),<EXTERN .SV'AC
		    PUSHJ P,.SV'AC>
SUBTTL	Macros To Work With The Data Structures

DEFINE	PG2ADR(AC),<LSH AC,^D9>

DEFINE	ADR2PG(AC),<LSH AC,-^D9>

DEFINE	LOAD(A,B,C),<.LDST.(A,B,C,HRRZ,HLRZ,LDB,MOVE)>

DEFINE	STORE(A,B,C),<.LDST.(A,B,C,HRRM,HRLM,DPB,MOVEM)>

DEFINE	INCR(A,B),<.INDR.(A,B,AOS)>

DEFINE	DECR(A,B),<.INDR.(A,B,SOS)>
DEFINE	.LDST.(A,B,C,D,E,F,G),<
	IFNB	<C>,<..T==0
		IFE	C-777777,<..T==1
			D	A,B>
		IFE	C-777777000000,<..T==1
			E	A,B>
		IFE	C-777777777777,<..T==1
			G	A,B>
		IFE	..T,<F	A,[POINTR(B,C)]>>
	IFB	<C>,<G	A,B>
>  ;END OF DEFINE .LDST.

DEFINE	.INDR.(A,B,C),<
	IFNB	<B>,<..T==0
		IFE	B-777777,<..T==1
			C	A>
		IFE	B-777777777777,<..T==1
			C	A>
		IFE	..T,<LOAD(TEMP,A,B)
				  XLIST
				  C	TEMP
				  STORE(TEMP,A,B)
				  LIST
				  SALL>>
	IFB	<B>,<C	A>
>  ;END OF DEFINE .INDR.

DEFINE	ZERO(A,B),<
	IFNB	<B>,<..T==0
		IFE	B-777777,<..T==1
			HLLZS	A>
		IFE	B-777777000000,<..T==1
			HRRZS	A>
		IFE	B-777777777777,<..T==1
			SETZM	A>
		IFE	..T,<MOVX	TEMP,B
			     XLIST
			     ANDCAM	TEMP,A
			     LIST
			     SALL>>
	IFB	<B>,<SETZM	A>
>  ;END OF DEFINE ZERO
SUBTTL	The STOPCD Macro

; THE STOPCD MACRO GENERATES A LOCAL UUO AND IS THEREFORE ALWAYS SKIP'ABLE

;A GLOBAL SYMBOL "S..xxx" IS DEFINED TO ENSURE UNIQUE STOPCD CODES

;	STOPCD	( 'CODE' , 'TYPE' )

;WHERE	CODE = A UNIQUE 3 CHARACTER INDICATION OF THE STOPCD
;	TYPE = ONE OF
;		FATAL - FOR A FATAL MESSAGE AND TERMINATION
;		TRACE - FOR A REPORT OF A CONTINUING (DEBUG) CONDITION

	.SCFAT==1	;FATAL STOPCD
	.SCTRA==2	;TRACE MESSAGE

DEFINE	STOPCD(COD,TYP),<
S..'COD:: .STCD. .SC'TYP,(SIXBIT/COD/)
>  ;END OF DEFINE STOPCD
	END