.MCALL .MODULE .MODULE EDTMAC, VERSION=15, COMMENT=, LIB=YES .SbTtl ...CM. -- Copyright statement .MACRO ...CM. .REM % Copyright (c) 1998 by Mentec, Inc., Nashua, NH. All rights reserved This software is furnished under a license for use only on a single computer system and may be copied only 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 except for use on such system and to one who agrees to these license terms. Title to and ownership of the software shall at all times remain in Mentec, Inc. The information in this document is subject to change without notice and should not be construed as a commitment by Digital Equipment Corporation, or Mentec, Inc. Digital and Mentec assume no responsibility for the use or reliability of its software on equipment which is not supplied by Digital or Mentec, and listed in the Software Product Description. % .ENDM .MDelete ...CM. ;++ ; Facility: Monitor Macro Library ; ; Author: ; ; Abstract: ; ; ; Edit Who Date Description of modification ; ---- --- ---- --------------------------- ; 001 WLD 14-MAY-90 Changed comment references from ; STARTx.COM to STRT%%.COM. Added ; SUFX$T to monitor file block ; zero references. ; ; (015) MBG 06-Sep-90 Added new EMT error for use with multiterminal ; handler hooks. ; ;-- .SBTTL .ASTX - Exit from Completion Routine - XM Monitor Only ;+ ; .ASTX ; ; Exit from Completion Routine - XM Monitor only ;- .MACRO .ASTX EMT ^O356 .ENDM .ASTX .SBTTL ASCR50 - Converts ASCII Valued Three Bytes to One RAD50 Word ;+ ; ASCR50 CHAR1,CHAR2,CHAR3 ; ; Converts the ASCII valued 3 bytes into a single RAD50 valued word. ; ; The Rad50 value is put into ...V2 ;- .MACRO ASCR50 CHAR1,CHAR2,CHAR3 ...V2=0 .IRP X, ...V3=-1 .IIF EQ X-040,...V3=0 .IF GE X-'A .IIF LE X-'Z,...V3=1+X-'A .ENDC .IIF EQ X-'$,...V3=33 .IIF EQ X-'.,...V3=34 .IIF EQ X-'*,...V3=35 .IF GE X-'0 .IIF LE X-'9,...V3=36+X-'0 .ENDC .ASSUME ...V3 NE -1 MESSAGE=< X;Invalid RAD50 value > ...V2=...V2*50+...V3 .ENDR .ENDM ASCR50 .SBTTL BSS - Generate a Block of Words ;+ ; BSS COUNT,VAL ; ; Generate a block of words (Value 'VAL' or 0) of length 'COUNT' ;- .MACRO BSS COUNT,VAL=0 .REPT COUNT .WORD VAL .ENDR .ENDM BSS .SBTTL CSIERR - Generate an Error Within the CSI ;+ ; CSIERR TEXT,CODE ; ; Generate an error within the CSI ; 'TEXT' is the text of the message ; 'CODE' is the code designation ;- .MACRO CSIERR TEXT,CODE JSR R0,MSG .BYTE CODE .ASCIZ "TEXT" .EVEN .ENDM CSIERR .SBTTL DEFALT - Define Default Value for Symbol ;+ ; DEFALT SYM,VAL ; ; Define the default value 'VAL' for the symbol 'SYM' ; If VAL is 'FLAG', the default value is 0 and an error is ; given if the symbol is already defined and is not 0 or 1. ;- .MACRO DEFALT SYM,VAL,GLOBAL .DSABL CRF .IIF NB , .GLOBL SYM .IF IDN , .IIF NDF SYM, SYM = 0 .ASSUME < SYM & 177776 > EQ 0 MESSAGE= .IFF .IIF NDF SYM, SYM = VAL .ENDC .IRP X,<\SYM> .ENABL CRF SYM = X .ENDR .ENDM DEFALT .SBTTL DEV - Define a Device Slot in RMON Tables ;+ ; DEV NAME,S ; ; DEVice Slot Macro: the device macro allocates sysgen dependent ; information into the various device tables. ;- .MACRO DEV NAME,S .PSECT PNAME$ $SLOT == $SLOT +1 .IF NB NAME .RAD50 /NAME/ ;PNAME$ - DEVICE ->> NAME <<- .IFF .WORD 0 ;PNAME$ - DEVICE ->> EMPTY <<- .ENDC .IF NE UNI$64 .PSECT PNAM2$ .IF NB NAME .RAD50 /NAME/ ;PNAM2$ - DEVICE ->> NAME <<- .IFF .WORD 0 ;PNAM2$ - DEVICE ->> EMPTY <<- .ENDC .ENDC .PSECT STAT$ .IF NB S .WORD S ;STAT$ .IFF .WORD 0 ;STAT$ .ENDC .PSECT ENTRY$ .IF NB NAME .IIF IDN ,,BA.NUM==:2*<$SLOT-1> .IIF IDN ,,PI.NUM==:2*<$SLOT-1> .IF NE MMG$T .IIF IDN ,,UB.NUM==:2*<$SLOT-1> .ENDC .IF IDN NAME,TT .WORD TTLQE ;ENTRY$ - TT ENTRY POINT .IFF .IF IDN NAME,MQ .IF EQ SB .IF NE MQ$RES MSGENT::.WORD MQLQE .IFF MSGENT::.WORD 0 .ENDC .IFF .WORD 0 .ENDC .IFF .WORD 0 .ENDC .ENDC .IFF .WORD 0 ;ENTRY$ .ENDC .PSECT UNAM1$ .WORD 0 ;UNAM1$ .PSECT UNAM2$ .WORD 0 ;UNAM2$ .IF EQ SB .PSECT OWNER$ .WORD 0,0 ;OWNER$ .ENDC .PSECT HSIZE$ .WORD 0 .PSECT DVSIZ$ .WORD 0 .PSECT DVREC$ .WORD 0 ;DVREC$ .IF NE MMG$T ;DVINT$ .IF NE XM$FET .PSECT DVINT$ CALL INTPRO .WORD 0 .ENDC ;NE XM$FET .ENDC ;NE MMG$T .ENDM DEV .SBTTL EMTERx - EMT Error: Set Carry in User's PS, Set User Error Byte (53) ;+ ; EMTERx ; ; Sets carry in user's PS and sets error code in error byte ; ;+ .MACRO EMTER0 EMT <17*20>+0 .ENDM EMTER0 .MACRO EMTER1 EMT <17*20>+1 .ENDM EMTER1 .MACRO EMTER2 EMT <17*20>+2 .ENDM EMTER2 .MACRO EMTER3 EMT <17*20>+3 .ENDM EMTER3 .MACRO EMTER4 EMT <17*20>+4 .ENDM EMTER4 .MACRO EMTER5 EMT <17*20>+5 .ENDM EMTER5 .MACRO EMTER6 EMT <17*20>+6 .ENDM EMTER6 .SBTTL ENSYS - Enter System State (To Inhibit Context Switching) ;+ ; ENSYS ADR ; ; Switch from User State to System State, inhibiting Context Switching. ; When executed, it switches into System State and returns at PR0 to the code ; immediately after the Macro Call. R0-R4 are intact, R5 is random. ; The code after the Macro Call must eventually execute an RTS PC, which ; returns from System to User State and continues execution in User State ; at the address specified by ADR. ;- .MACRO ENSYS ADR JSR R5,$ENSYS .WORD ADR-.,PR7 .ENDM ENSYS .SBTTL GET - Move Word from User to Monitor ;+ ; GET SRC,DST,SPC=D ; ; Move a word from the User to the Monitor ; Generates a 'MOV' in FB ; Generates a MFPI, POP in XM ; Generates a MFPD/MFPI, POP in ZM ;- .MACRO GET SRC,DST,SPC=D .IF EQ MMG$T MOV SRC,DST .IFF .IF NE SUP$Y MFP'SPC SRC .IFF MFPI SRC .ENDC .IF DIF ,<-(SP)> MOV (SP)+,DST .ENDC .ENDC .ENDM GET .SBTTL MONERR - Generate Fatal Monitor Error Call ;+ ; MONERR CODE,LEVEL,FTL ; ; Generate a FATAL Monitor error call ; 'CODE' is the internal code for the error (from ERRMSG macro) ; 'LEVEL' is the severity of the error ; 'FTL' is a flag: if 'FATAL', the error is FATAL ;- .MACRO MONERR CODE,LEVEL,FTL EMT 376 .BYTE LEVEL .IF IDN , .BYTE ^C .IFF .BYTE CODE'.E .ENDC .ENDM MONERR .SBTTL PUT - Move Word from Monitor to User ;+ ; PUT SRC,DST,SPC=D ; ; Move a word from the Monitor to the User ; Generates a 'MOV' in FB ; Generates a PUSH, MTPI in XM ; Generates a PUSH, MTPD/MTPI in ZM ;- .MACRO PUT SRC,DST,SPC=D .IF EQ MMG$T MOV SRC,DST .IFF .IF DIF ,<(SP)+> .IF IDN ,<#0> CLR -(SP) .IFF MOV SRC,-(SP) .ENDC .ENDC .IF NE SUP$Y MTP'SPC DST .IFF MTPI DST .ENDC .ENDC .ENDM PUT .SBTTL SPL n - Change Priority to 'n'; For Use ONLY in RMON ;+ ; SPL PRIO ; ; Change priority to 'PRIO' - For use only in RMON ; 'PRIO' must be a number from 0 to 7 (not an arbitrary source) ;- .MACRO SPL PRIO .IF EQ MMG$T .IF NE PRIO MOV #PR'PRIO,-(SP) .IFF CLR -(SP) .ENDC JSR PC,$MTPS .IFF .IF NE PRIO MOVB #PR'PRIO,@#PS .IFF CLRB @#PS .ENDC .ENDC .ENDM SPL