.MCALL .MODULE .MODULE INDMLB,VERSION=22,COMMENT=,LIB=YES ; 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. .SBTTL FDBDF - Define file descriptor block ;+ ; FDBDF$ Define file definition block offsets ; ; The format of the file description block is: ; ; +---------------+---------------+ ; | F$FLGS | F$CHAN | ; +---------------+---------------+ ; | F$DNAM | ; +-------------------------------+ ; | F$FNAM | ; |- - - - - - - - - - - - - - - -| ; | | ; +-------------------------------+ ; | F$TYPE | ; +-------------------------------+ ; | F$STAT | ; +-------------------------------+ ; | F$ERR | ; +-------------------------------+ ; | F$BLKM | ; +-------------------------------+ ; | F$BLKN | ; +-------------------------------+ ; | F$BUFP | ; +-------------------------------+ ;- .MACRO FDBDF$ .MCALL .ASSUME .NLIST F$CHAN = 0 ;Channel number F$FLGS = 1 ;File flags F$DNAM = 2 ;Device name (RAD50) F$FNAM = 4 ;File name (RAD50) F$TYPE = 10 ;File type (RAD50) F$STAT = 12 ;Device status F$ERR = 14 ;File service error code F$BLKM = 16 ;Maximum block number in file F$BLKN = 20 ;Current block number in file F$BUFP = 22 ;Current buffer pointer F$SIZE = 24 ;Size of file entry ;+ ;File flags (F$FLGS) definitions ;- F.OPNR = 1 ;File opened for read (1=YES) F.OPNW = 2 ;File opened for write (1=YES) F.ESC = 4 ;Set in $RDTRM (RDREC) if recieved escape char ;+ ;Device status (F$STAT) definitions. ;- VARSZ$ = 400 ;Device is variable size ABTIO$ = 1000 ;Used in combo with HNDLR$ SPFUN$ = 2000 ;Handler accepts SPFUN requests HNDLR$ = 4000 ;Used in combo with ABTIO$ SPECL$ = 10000 ;Non RT-11 directory structured WONLY$ = 20000 ;Write-only device RONLY$ = 40000 ;Read-only device FILST$ = 100000 ;Random-access device DEV.TT =: 4 ;TT device code .LIST .ENDM FDBDF$ .SBTTL FERDF - File error definitions ;+ ;FERDF$ define file service error codes ;- .MACRO FERDF$ .NLIST IS.SUC = 001. ;Success IE.NOS = -06. ;No room to FETCH handler IE.EOF = -10. ;End-of-file detected IE.DAO = -13. ;Data overrun IE.DFU = -23. ;Device full IE.NSF = -26. ;No such file IE.WAC = -29. ;File accessed for write IE.RER = -32. ;Device read error IE.WER = -33. ;Device write error IE.NLN = -37. ;No file accesed on channel IE.NBK = -41. ;File exceeds space allocated IE.BTP = -43. ;Bad record type (non-ASCII) IE.RAC = -44. ;File accessed for read IE.PRO = -50. ;Protection violation on file deletion IE.FOP = -53. ;File already open IE.BNM = -54. ;Bad file name IE.IDU = -92. ;No room to fetch device handler .LIST .ENDM FERDF$ .SBTTL GCLDF - Command line definitions ;+ ;Macro to GCML offsets ;- .MACRO GCLDF$ GBL .MCALL .ASSUME .NLIST .IF NDF F$SIZE .MCALL FDBDF$ FDBDF$ ;Define FDB offsets .ENDC .IF IDN , .GLOBL G.ERR,G.MODE,G.PSDS,G.CMLD,G.CDEP,G.MDEP .GLOBL G.PPTR,G.RBUF,G.DPRM,G.SIZE .GLOBL GE.COM,GE.IND,GE.CLO,GE.LC,GE.CON,GE.SIZ .GLOBAL GE.MCP,GE.IEF,GE.RWD,GE.FOP .GLOBL GE.IOR,GE.OPR,GE.BIF,GE.MDE,GE.EOF,GE.RBG .ENDC ;+ ;GCML block offsets ;- G.ERR = F$SIZE ;Error return code byte G.MODE = G.ERR+01. ;Status and mode control byte G.PSDS = G.MODE+01. ;Prompt string descriptor pointer ;Address and length G.CMLD = G.PSDS+04. ;Command line descriptor pointer ;Address and length G.CDEP = G.CMLD+04. ;Current push down depth G.MDEP = G.CDEP+01. ;Maximum push down depth G.PPTR = G.MDEP+01. ;Push down storage pointer G.RBUF = G.PPTR+02. ;Record buffer pointer G.SIZE = G.RBUF+02. ;Size of GCML block ;+ ;G.MODE flag definitions ;- GE.COM = 1 ;Indicates that a command line having a ;leading semi-colon (;) is to be treated as a ;comment. GE.IND = 2 ;Indicates that a command line containing a ;leading at sign (@) is to be treated as an ;explicit indirect command file specifier. GE.CLO = 4 ;Indicates that the command file currently ;being read is to be closed after each ;issuance of the GCML$ macro call. GE.LC = 10 ;Indicates that lower case characters in the ;command line are to be passed to the user ;program without conversion to upper case. GE.CON = 20 ;Indicates that the continuation mechanism is ;in effect. GE.IEF = 20 ;Indicates that an intermediate end-of-file ; was found. GE.SIZ = 40 ; GE.RWD = 40 ;Indicates that the file is to rewound on ;reaching end-of-file. GE.FOP = 100 ;Indicates exit after opening file. GE.DCL = 200 ;Indicates that the top level is from KMON. ;+ ;G.ERR definitions ;- GE.IOR = -1 ;Indicates that an I/O error occurred during ;the input of a command line. GE.OPR = -2 ;Indicates that GCML was unable to open or ;reopen the specified command file. GE.IDU = -3 ;Indicates that the specified device or unit ;was incorrect. GE.MDE = -4 ;Indicates that an attempt was made to exceed ;the maximum permissable nesting level depth ;for an indirect command file. GE.EOF = -10. ;Indicates that the end-of-file (EOF) on the ;first command file was detected. GE.RBG = -40. ;Indicates that the command line input buffer ;was too small for the total command line. .LIST .ENDM GCLDF$ .SBTTL GCMLB - Define command line block ;+ ;Macro to define get command line block ;- .MACRO GCMLB$ MAXD,UBUF,LUN,PDL,SIZE=80. .NLIST .MCALL FDBDF$,GCLDF$ FDBDF$ ;Define FDB offsets .WORD LUN ;GCML FDB .BLKB F$SIZE-2 GCLDF$ ;Define GCML block offsets .BYTE 0 ;G.ERR - error return code byte .IF LE .BYTE GE.COM!GE.IND!GE.CLO!GE.SIZ ;G.MODE - status and control mode .IFF .BYTE GE.COM!GE.IND!GE.CLO!GE.CON!GE.SIZ .ENDC .BLKW 2 ;G.PSDS - prompt string descriptor .BLKW 2 ;G.CMLD - command line descriptor .BYTE -1 ;G.CDEP - current push down depth .BYTE MAXD ;G.MDEP - maximum push down depth .IF B .WORD PDL1 ;G.PPTR - push down storage pointer .IFF .WORD PDL ;G.PPTR - push gown storage pointer .ENDC .IF NB .WORD UBUF ;G.RBUF - record buffer pointer .IFF .WORD BUF ;G.RBUF - record buffer pointer .ENDC G.LPDL=* .IF B PDL1: .BLKB G.LPDL ;Push down list .ENDC .IF B BUF: .BLKB SIZE+2. ;Record buffer .ENDC .LIST .ENDM GCMLB$ .SBTTL RT5DF - V5 definitions ;+ ;RT11 V5.0 resident monitor definitions ;- .MACRO RT5DF$ .NLIST ...RT5=0 ;+ ;RT specific ;- HOMBLK = 1 ;Home block for device DK.VID = 730 ;Offset of start of disk volid in HOMBLK DK.VSZ = 14 ;Size of VOLID on disks MT.VID = 4 ;Offset of start of magtape volid in HOMBLK MT.VSZ = 6 ;Size of VOLID on magtape and cassette TTDEV = 4 ;Device code for TT BADEV = TTDEV ;and BA DLDEV = 5 ;Device code for DL DYDEV = 6 ;Device code for DY LDDEV = 46 ;Device code for LD DUDEV = 50 ;Device code for DU XLDEV = 57 ;Device code for XL XCDEV = XLDEV ;and XC MUDEV = 60 ;Device code for MU NCDEV = 61 ;Device code for NC, NQDEV = NCDEV ;NQ, and NUDEV = NCDEV ;NU SDDEV = 62 ;Device code for SD STDEV = 63 ;Device code for ST $APR2 == 2 ;PAR 2 P.STS = 16 ;IGTDUS status offset ILHARD = -5. ;Illegal device, from IGTDUS ILNOHD = -14. ;No such handler, from IGTDUS INVUNT = -21. ;Invalid Unit, from IGTDUS ;+ ;System communication area. ;- $EMT = 30 ;EMT processor vector TTWIDT = -10 ;Width offset FILCHR = -7 ;Fill character offset FILCTR = -6 ;Number of fills OUTCHR = -5 ;Number of characters to output offset LINPOS = -4 ;Current line position TTCNFG = -2 ;Configuration word ;+ ;Job status word and its bit definitions. ;- $JSW = 44 ;Job status word GTLIN$ = 10 ;Non-terminating .GTLIN flag TCBIT$ = 100 ;Inhibit TT wait flag HLTER = 200 ;Error halt flag SPXIT$ = 40 ;Chain exit without KMON buffer kill CHAIN$ = 400 ;Chain flag CHNIF$ = 4000 ;Pass line to KMON flag TTSPC$ = 10000 ;Special mode terminal flag TTLC$ = 40000 ;Lower-case enable flag TRAPPC = 34 ;Trap vectors - PC TRAPPS = 36 ;Trap vectors - PS ERRBYT = 52 ;EMT error byte location USERRB = 53 ;User error byte SUCCS$ = 1 ;Success WARN$ = 2 ;Warning ERROR$ = 4 ;Error FATAL$ = 10 ;Fatal UNCON$ = 20 ;Unconditional SYSPTR = 54 ;Pointer to beginning of resident monitor ;+ ;Resident monitor fixed offsets. ;- $BLKEY = 256 ;Directory block number in memory $SUNIT = 275 ;Unit number of the system device (byte) SYSVER = 276 ;Version number of running system (byte) ;+ ;Configuration word and its bit definitions. ;- $CONFG = 300 ;RT-11 configuration word FBMON$ = 1 ;0 = SJ, 1 = FB HWDSP$ = 4 ;1 = VT11 or VS60 graphics display present BATCH$ = 10 ;1 = BATCH is in control of the background CLK50$ = 40 ;0 = 60 cycle clock, 1 = 50 cycle clock HWFPU$ = 100 ;1 = FP11 hardware exists FJOB$ = 200 ;1 = Foreground or system job in memory GTLNK$ = 400 ;1 = User is linked to graphics scroller USR$ = 1000 ;1 = USR is permenently resident (NOSWAP) QUEUE$ = 2000 ;1 = The queue program is running LSI11$ = 4000 ;1 = Processor is an LSI KT11$ = 10000 ;1 = System is mapped (XM monitor) LKCS$ = 20000 ;1 = The system clock has a status register KW11P$ = 40000 ;1 = A KW11-P clock exists and is useable CLOCK$ = 100000 ;1 = There is a system clock ;+ ; Configuration word 2 and its bit definitions ;- $CNFG2 = 370 ;RT-11 Extension Configuration Word CACHE$ = 1 ;CACHE MEMORY MPTY$ = 2 ;PARITY MEMORY SWREG$ = 4 ;SWITCH REGISTER (READ ONLY) LIGHT$ = 10 ;LIGHT REGISTER (WRITE ONLY) LDREL$ = 20 ;A handler has been removed from memory XITSW$ = 40 ;user code should be swapped on exit CIS$ = 200 ;Commercial instruction set EIS$ = 400 ;EIS VS6$0 = 1000 ;VS60 (VT48) DISPLAY PROCESSOR GSCCA$ = 10000 ;Global SCCA support PDP70$ = 40000 ;PROCESSOR IS PDP-11/70 PDP60$ = 100000 ;PROCESSOR IS PDP-11/60 ;+ ;Sysgen word and its bit definitions. ;- $SYSOP = 372 ;System generation features word SYSGEN = 372 ;System generation features word OP$ELG = 1 ;1 = error logging feature is present OP$MMG = 2 ;1 = memory management feature is present OP$DTO = 4 ;1 = device timeout feature is present RTEM$ = 10 ;1 = RTEM monitor OP$MKT = 2000 ;1 = timer support is present OP$MLT = 10000 ;1 = multi-terminal feature is present OP$SJB = 20000 ;1 = systems jobs feature is present $ERRLV = 376 ;Error severity byte for dcls indirect $PNPTR = 404 ;Offset to $PNAME table from start of RMON $MNAM1 = 406 ;Off. to RMON for 1st RAD50 word of mon. name $MNAM2 = 410 ;Off. to RMON for 2nd RAD50 word of mon. name $INDER = 416 ;KMON exit status byte (offset into RMON) $INDIR = 417 ;Indirect file status byte (offset into RMON) $WILDDF = 454 ;Low byte offset to get $JOBS byte in offset $JOBS = 455 ;Number of job slots (RMON offset) $CNFG3 = 466 ;Configuration word 3 and relevant bits (offset) CF3.HI = 40000 ;Hardware support for ID space present CF3.SI = 100000 ;Software support for ID space present ;+ ;IND status bit definitions (in high byte). ;- CC$IND = 4 ;Set indicates IND control/c disable CC$ALL = 17 ;Sum of all global SCCA bits LN$IND = 40 ;Set indicates that current line passed by IND IN$RUN = 100 ;Bit set runs IND from KMON IN$IND = 200 ;Bit set means IND active $SINDX = 364 ;Index into device tables for system device $INDDV = 426 ;Area to store device and unit number IND is ;running from ;+ ;DVSTAT (Device Status) definitions for .TESTDEVICE/.VOL ; ; The intent of this flag word is two fold. First to provide a mechanism ; of tracking device status, and second to allow for general clean-up of ; .TESTDEVICE, .VOL, and possibly .STRUCTURE. What should happen is various ; tests be made to determine the values for and then set the values ; for . This mechanism will take up less space, be faster and be more ; general. ;- MNTFLG = 4 ;Mounted/Dismounted UNKFLG = 10 ;Unknown status (LP,LS,SP etc) ONLFLG = 20 ;Online/offline LOAFLG = 100 ;Loaded/Unloaded ATTFLG = 200 ;Attached/Detached FCHFLG = 400 ;1= device can be fetched LOKFLG = 1000 ;1= want NFS LOOKUP with GETHDL MSCPFG = 2000 ;Device is MSCP TAPEFG = 4000 ;Device is a MAGTAPE NSDFLG = 100000 ;No Such Device exists ;+ ;Miscellaneous definitions. ;- $CHTSK = 500 ;Chain task name area $CHAIN = 510 ;KMON chain area OVLYEN = 1776 ;Maximum overlay size MTBITS =: 172400 ; DSTAT bit mask for magtape MTDEVC =: 012000 ; DSTAT magtape code .LIST .ENDM RT5DF$ .SBTTL DEFIN - General definitions of interest .ENABL LC .MACRO DEFIN$ .NLIST ;+ ;Success/error codes. ;- EX$SUC == 1 ;Success bit EX$ERR == 2 ;Error bit ;+ ;Equated symbols. ;- NDATF = 4 ;Maximum number of data files which can be ;open simultaneously. MAXD = 4 ;The maximum depth of command files SSIZE = 6 ;Size of symbol (in ASCII format for errors) MAXSND = 9. ;Maximum # of items to store at each ;subroutine nesting depth IN$CHN = 16 ;Channel 16 used internally. Nothing else ;should use it NDALAB = 20. ;Number of direct access labels to "remember" PMTSZ = 80. ;Valid number of characters in a ASKn prompt STRLEN = 135. ;Max length of string (incl +1) ASKBL = 135. ;Length of ask buffer (incl +1) MAXBEG = 64. ;Maximum depth level (for BEGIN) LBSIZE = 132. ;Maximum record length STSIZ = 4096. ;Symbol table size (bytes) CTRLC = 3 ;Control/C HT = 11 ;Horizontal tab LF = 12 ;Line feed VT = 13 ;Vertical tab FF = 14 ;Form feed CR = 15 ;Carriage return CTRLZ = 32 ;Control/Z ESC = 33 ;Escape SPA = 40 ;Space EXCLAM = 41 ;Exclamation mark DQUOT = 42 ;Double quote LB = 43 ;Pound PERCNT = 45 ;Percent sign APOS = 47 ;Apostr. LPAREN = 50 ;Left paren. RPAREN = 51 ;Right paren. ASTER = 52 ;Asterisk PLS = 53 ;Plus sign COMMA = 54 ;Comma DOT = 56 ;Dot ZERO = 60 ;ASCII zero COLON = 72 ;Colon SEMIC = 73 ;Semi-colon LESTHN = 74 ;Less than sign EQUAL = 75 ;Equal GRTHN = 76 ;Greater than ATSIGN = 100 ;Atsign OPBRK = 133 ;Open bracket CLBRK = 135 ;Close bracket ;+ ;Symbol types. ;- TF == 0 ;Logical LOGT == TF ;Logical - value 'TRUE' LOGF == TF!1 ;Logical - value 'FALSE' ALTTYP == LOGF ;Alternative type NUM == 2 ;Numeric NUMOCT == NUM ;Octal NUMDEC == NUM!1 ;Decimal STR == 4 ;String ;+ ;Bit definitions for LIFLG. ;- TIMOUT == 1 ;Set when timeout enabled TRACE == 2 ;Set when trace listing desired DELETE == 4 ;Delete file on closing KMON == 10 ;Suppress execution of DCL commands OCTAL == 20 ;OCTAL mode (default is on) DATEX == 40 ;DATA mode DEFGLS == 100 ;Global symbols enabled DEFSUB == 200 ;Default to string substitution LOWCAS == 400 ;1 = don't convert lower case to upper ESCAPE == 1000 ;1 = escape is a valid line terminator QUIET == 2000 ;Suppress KMON command output on screen PREFIX == 4000 ;0 = suppress * and ; as 1st char of display PRIDOT == 10000 ;Print a dot before the kmon command SUFFIX == 20000 ;Sup. default & range spec for ASKx statements ABORT == 40000 ;Disable control/c and control/z from keyboard CNTRLZ == 100000 ;Disable CTRL/Z on .ASKx statements DFLMOD = DEFSUB+LOWCAS+SUFFIX+PREFIX+OCTAL+KMON+ABORT+CNTRLZ ;+ ;Bit definitions for LFLG2 (Second status flag word) ;- TYPAHD == 1 ;1 = typeahead enabled ERRPRC == 2 ;1 = ERROR processing in progress DFLMD2 = TYPAHD ;+ ;Bit definitions for BLKFLG (blocking context status). ;- LEAVE == 4 ;Tell root to look for .END SEENIF == 10 ;Set if command line contains .IF GSUB == 20 ;Set if looking for GOSUB label DATASW == 40 ;Set if scanning through data ;+ ;Offsets in symbol table entry: ; ; Symbol table entries always start at word boundaries. Bytes 0-3 always ; contain symbol name in RADIX 50. No symbolic offset defined. Logical ; symbols always have length of value field = 0. The value is encoded in the ; type byte. Numeric symbols always have length of value field = 2. String ; symbols have length of value field in range 0-132. If length is odd, an ; un-defined byte is appended in the symbol table entry. ;- SETYP == 4 ;Symbol type SELEN == 5 ;Length of value field SEVAL == 6 ;Start of value field ;+ ;.MACRO ROUNDUP ;Round up overlay to block boundary. ;This macro determines if the overlay end is pass the required limit (OVLYEN). ;If so, a PHASE error is generated at assembly time. If FILL is set to YES, ;the module will be ROUNDED up to a block boundary (the size of OVLYEN). ;- .MACRO ROUNDUP FILL=NO .IF GT .-ROUND-OVLYEN .ERROR <.-ROUND-OVLYEN>/2 ;Over by this many words .ENDC .IIF IDN , . = ROUND+OVLYEN .ENDM ;+ ;.MACRO OPSECT NAME ;Set PSECT in overlay file ;Defines a PSECT name in an overlay and defines the start of the PSECT ;as ROUND. Used with ROUNDUP macro. ;- .MACRO OPSECT NAME .PSECT NAME ROUND = . .ENDM ;+ ;.MACRO .ASSUME A1 CND A2 ;Verify an assumption ;Generates an error if the expression 'A1" does not bear the relation ;'CND' to the expression 'A2'. For example ; .ASSUME SYMBOL EQ 200 ;- .MACRO .ASSUME A1,CND,A2 .IF CND - .IFF .ERROR ;"A1 CND A2" IS NOT TRUE .ENDC .ENDM ;+ ;.MACRO .BR TO ;Verify that one routine falls into another. The target, "TO' ;must immediately follow the .BR. ;- .MACRO .BR TO .IF DF TO .IF NE TO-. .ERROR ; NOT AT LOCATION "TO" .ENDC .ENDC .ENDM ;+ ;.MACRO SAVE REGS ;Save registers on stack. ;- .MACRO SAVE REGS .IRP X, MOV X,-(SP) .ENDR .ENDM SAVE ;+ ;.MACRO RESTOR REGS ;Restore registers from stack ;- .MACRO RESTOR REGS .IRP X, MOV (SP)+,X .ENDR .ENDM RESTOR ;+ ;.MACRO ERR SYM,LAB ;Create error strings ;- .MACRO ERR SYM,LAB .WORD EM'SYM,LAB .ENDM ERR ;+ ; Ellipsis ;- .MACRO ...... .ENDM .LIST .ENDM DEFIN$