Trailing-Edge
-
PDP-10 Archives
-
BB-R595B-SM_11-9-85
-
mcb/tkb36/msgh.bli
There are 4 other files named msgh.bli in the archive. Click here to see a list.
!<REL4A.TKB-VNP>MSGH.BLI.10, 3-Dec-79 14:41:15, Edit by SROBINSON
MODULE MSGH ( ! PRINT MESSAGES
IDENT = 'X2.0'
) =
BEGIN
!
!
!
! COPYRIGHT (c) 1980, 1981, 1982
! DIGITAL EQUIPMENT CORPORATION
! Maynard, Massachusetts
!
! 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.
!
!++
! FACILITY: TKB-20 AND VNP-20
!
! ABSTRACT:
!
!
! THIS MODULE HANDLES PRINTING OF MESSAGES
!
!
! ENVIRONMENT: TOPS-20 USER MODE
!
! AUTHOR: J. SAUTER, CREATION DATE: 14-DEC-77
!
! MODIFIED BY:
!
! Scott G. Robinson, 28-SEP-78 : VERSION X0.1-2A
! - Fix bug with base 0 conversion diagnosis in OUTNUM
!
! Scott G. Robinson, 13-JUN-79 : VERSION X0.2
! - Make all fatal errors terminate the program
!-----------------------------------------------------------------------
!
! Scott G. Robinson, 3-DEC-79 : Version X2.0
! - Ensure DECnet-10 Compatibility
!
! , : VERSION
! 01 -
!--
!<BLF/PAGE>
!
! TABLE OF CONTENTS:
!
FORWARD ROUTINE
PCRLF : NOVALUE, !PRINT CRLF (GLOBAL)
OUTSTR : NOVALUE, !PRINT STRING (GLOBAL)
OUTNUM : NOVALUE, !PRINT NUMBER
ERR_OUTSTR : NOVALUE, !PRINT STRING WITH EDITING
ERRMSG : NOVALUE; !PRINT ERROR MESSAGE
!
! INCLUDE FILES:
!
! NONE
!
! MACROS:
!
! NONE
!
!
! EQUATED SYMBOLS:
!
! NONE
!
! OWN STORAGE:
!
! NONE
!
! EXTERNAL REFERENCES:
!
EXTERNAL ROUTINE
OUTPUT : NOVALUE, !SEND CHARS TO I/O DEVICE
STOP_PROGRAM : NOVALUE; !TERMINATE PROGRAM EXECUTION
GLOBAL ROUTINE PCRLF (CHAN) : NOVALUE = ! PRINT CRLF
!++
! FUNCTIONAL DESCRIPTION:
!
! PRINT CR AND LF
!
! FORMAL PARAMETERS:
!
! CHAN - THE CHANNEL ON WHICH TO SEND CRLF
!
! IMPLICIT INPUTS:
!
! NONE
!
! IMPLICIT OUTPUTS:
!
! NONE
!
! ROUTINE VALUE:
!
! NONE
!
! SIDE EFFECTS
!
! WRITES A CRLF ON THE INDICATED I/O DEVICE
!
!--
BEGIN
OUTPUT (.CHAN, %O'15');
OUTPUT (.CHAN, %O'12');
END;
GLOBAL ROUTINE OUTSTR (CHAN, MESSAGE) : NOVALUE = !PRINT STRING
!++
! FUNCTIONAL DESCRIPTION:
!
! PRINT A STRING TERMINATED WITH A NULL
!
! FORMAL PARAMETERS:
!
! CHAN - THE CHANNEL OVER WHICH TO SEND THE STRING
! MESSAGE - POINTER TO THE STRING
!
! IMPLICIT INPUTS:
!
! NONE
!
! IMPLICIT OUTPUTS:
!
! NONE
!
! ROUTINE VALUE:
!
! NONE
!
! SIDE EFFECTS
!
! WRITES THE SPECIFIED STRING ON THE I/O DEVICE
!
!--
BEGIN
LOCAL
CHAR,
CHPTR;
!
CHPTR = CH$PTR (.MESSAGE, -1);
DO
BEGIN
CHAR = CH$A_RCHAR (CHPTR);
IF (.CHAR NEQ 0) THEN OUTPUT (.CHAN, .CHAR);
END
UNTIL (.CHAR EQL 0);
END;
GLOBAL ROUTINE OUTNUM (CHAN, VALUE, RADIX, LEN) : NOVALUE = !PRINT A NUMBER
!++
! FUNCTIONAL DESCRIPTION:
!
! PRINT A NUMBER. HANDLES NEGATIVE AND RADIX 2 TO 36.
! PADS WITH LEADING ZEROS IF NECESSARY.
!
! FORMAL PARAMETERS:
!
! CHAN - THE CHANNEL ON WHICH TO SEND THE NUMBER
! VALUE - THE NUMBER TO PRINT
! RADIX - THE PRINT RADIX, USUALLY 8 (OCTAL) OR 10 (DECIMAL).
! LEN - MINIMUM LENGTH OF THE NUMBER, OFTEN 0.
!
! IMPLICIT INPUTS:
!
! NONE
!
! IMPLICIT OUTPUTS:
!
! NONE
!
! ROUTINE VALUE:
!
! NONE
!
! SIDE EFFECTS
!
! SENDS A STRING REPRESENTING THE NUMBER TO THE I/O DEVICE
!
!--
BEGIN
LOCAL
CHAR,
LEN1,
QUOTIENT,
REMAINDER,
VAL;
IF ((.RADIX LSS 2) OR (.RADIX GTR 36))
THEN
BEGIN
OUTSTR (.CHAN, UPLIT (%ASCIZ'??????'));
RETURN;
END;
VAL = .VALUE;
LEN1 = .LEN;
IF (.VAL LSS 0)
THEN
BEGIN
OUTPUT (.CHAN, %C'-');
VAL = -.VAL;
LEN1 = .LEN1 - 1;
END;
QUOTIENT = .VAL/.RADIX;
REMAINDER = .VAL MOD .RADIX;
IF (.QUOTIENT NEQ 0)
THEN
OUTNUM (.CHAN, .QUOTIENT, .RADIX, .LEN1 - 1)
ELSE
!
! APPEND LEADING ZEROS IF NECESSARY
!
WHILE ((LEN1 = .LEN1 - 1) GTR 0) DO
OUTPUT (.CHAN, %C'0');
CHAR = .REMAINDER + %C'0';
IF (.CHAR GTR %C'9') THEN CHAR = .CHAR - %C'9' + %C'A';
OUTPUT (.CHAN, .CHAR);
END;
ROUTINE ERR_OUTSTR !PRINT EDITED STRING
(CHAN, MESSAGE, ARG1, ARG2, ARG3, ARG4, ARG5) : NOVALUE =
!++
! FUNCTIONAL DESCRIPTION:
!
! PRINT AN EDITED STRING. VALUE SUBSTITUTION IS INDICATED BY
! A % IN THE STRING, AS FOLLOWS:
!
! %NX
!
! WHERE N IS THE ARGUMENT (1 TO 5) AND X IS THE FORM.
! FORM A = ASCII, D = DECIMAL, O = OCTAL AND V = SYMBOL VALUE.
! USE %% TO PRINT A PERCENT SIGN.
!
! FORMAL PARAMETERS:
!
! CHAN - THE CHANNEL ON WHICH TO SEND THE EDITED STRING
! MESSAGE - POINTER TO THE STRING TO BE EDITED AND PRINTED
! ARG1:ARG5 - VALUES TO BE SUBSTITUTED INTO THE STRING
! AS NEEDED. ASCII ARGUMENTS ARE POINTERS TO STRINGS;
! OCTAL AND DECIMAL ARE THE VALUES THEMSELVES.
! SYMBOL VALUES ARE PRINTED IN OCTAL, WITH
! SIGN EXTENSION ON THE LOW-ORDER 16 BITS, AND THE
! NEXT HIGHER-ORDER BIT MEANING RELOCATABLE.
! UNUSED ARGUMENTS ARE SET TO ZERO.
!
! IMPLICIT INPUTS:
!
! NONE
!
! IMPLICIT OUTPUTS:
!
! NONE
!
! ROUTINE VALUE:
!
! NONE
!
! SIDE EFFECTS
!
! SENDS EDITED STRING TO I/O DEVICE
!
!--
BEGIN
LOCAL
ARG,
CHAR,
CHPTR,
TEMP_ARG;
!
CHPTR = CH$PTR (.MESSAGE, -1);
DO
BEGIN
CHAR = CH$A_RCHAR (CHPTR);
IF (.CHAR NEQ 0)
THEN
IF (.CHAR NEQ %C'%')
THEN
OUTPUT (.CHAN, .CHAR)
ELSE
BEGIN !SPECIAL REFERENCE TO A SUBSTITUTION ARG
CHAR = CH$A_RCHAR (CHPTR);
IF (.CHAR EQL %C'%')
THEN
OUTPUT (.CHAN, .CHAR)
ELSE
BEGIN
ARG = (CASE .CHAR FROM %C'1' TO %C'5' OF
SET
[%C'1'] : .ARG1;
[%C'2'] : .ARG2;
[%C'3'] : .ARG3;
[%C'4'] : .ARG4;
[%C'5'] : .ARG5;
TES);
CHAR = CH$A_RCHAR (CHPTR);
SELECTONE .CHAR OF
SET
[%C'A'] : !ASCII STRING
OUTSTR (.CHAN, .ARG);
[%C'D'] : !DECIMAL NUMBER
OUTNUM (.CHAN, .ARG, 10, 0);
[%C'O'] : !OCTAL NUMBER
OUTNUM (.CHAN, .ARG, 8, 0);
[%C'V'] : !SYMBOL VALUE
BEGIN
TEMP_ARG = (IF (.ARG<15, 1> EQL 0) THEN 0 ELSE -1); !SIGN EXTEND
TEMP_ARG<0, 15> = .ARG<0, 15>;
OUTNUM (.CHAN, .TEMP_ARG, 8, 0);
IF (.ARG<16, 1> NEQ 0) THEN OUTSTR (.CHAN, UPLIT (%ASCIZ'-R'));
END;
TES;
END; !OF NOT JUST %%
END; !OF % PROCESSING
END
UNTIL (.CHAR EQL 0);
END; !OF ROUTINE ERR_OUTSTR
GLOBAL ROUTINE ERRMSG ! ERROR MESSAGE
(CHAN, ERRNO, ARG1, ARG2, ARG3, ARG4, ARG5) : NOVALUE =
!++
! FUNCTIONAL DESCRIPTION:
!
! PRINT AN ERROR MESSAGE WITH UP TO FIVE VARIABLE ARGUMENTS.
! THE ERROR MESSAGES ARE LISTED IN THE HEAD OF THIS MODULE
! WITH THEIR NUMBERS AND THE MEANING OF EACH ARGUMENT.
! UNUSED ARGUMENTS SHOULD BE SET TO ZERO.
!
! FORMAL PARAMETERS:
!
! CHAN - THE CHANNEL ON WHICH TO SEND THE ERROR MESSAGE
! ERRNO - THE NUMBER OF THE ERROR MESSAGE TO PRINT
! ARG1:ARG5 - THE VARIABLE ARGUMENTS IN THE MESSAGE
!
! IMPLICIT INPUTS:
!
! NONE
!
! IMPLICIT OUTPUTS:
!
! NONE
!
! ROUTINE VALUE:
!
! NONE
!
! SIDE EFFECTS
!
! SENDS AN EDITED STRING TO THE I/O DEVICE.
!
!--
BEGIN
LOCAL
MESSAGE;
!
!
!
! HERE ARE THE ERROR MESSAGES, BY ERROR NUMBER.
! A PERCENT SIGN INDICATES ARGUMENT SUBSTITUTION. THE LETTER
! FOLLOWING THE ARGUMENT NUMBER SPECIFIES THE FORMAT: A = ASCII,
! D = DECIMAL, O = OCTAL, V = SYMBOL VALUE.
! %% PRINTS A PERCENT SIGN.
!
MESSAGE = (CASE .ERRNO FROM 1 TO 40 OF
SET
[1] : UPLIT (%ASCIZ'? Storage exhausted -- %1A'); !
! !ARG 1 = ROUTINE NAME
[2] : UPLIT (%ASCIZ'? Invalid file name: "%2A" -- %1A'); !
! !ARG 1 = ROUTINE NAME,
! ! 2 = FILE NAME
[3] : UPLIT (%ASCIZ'? OPEN UUO failed for %2A -- %1A'); !
! !ARG 1 = ROUTINE NAME,
! ! 2 = FILE NAME
[4] : UPLIT (%ASCIZ'? LOOKUP/ENTER UUO failed for %2A, code = %3O -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = FILE NAME
! ! 3 = ERROR CODE
[5] : UPLIT (%ASCIZ'? I/O DATA ERROR on %2A, status = %3O -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = FILE NAME
! ! 3 = STATUS
[6] : UPLIT (%ASCIZ'? Syntax error in command line: "%2A" -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = COMMAND LINE
[7] : UPLIT (%ASCIZ'? Switches must be associated with a file -- %1A'); !
! !ARG 1 = ROUTINE NAME
[8] : UPLIT (%ASCIZ'? Indirect files nested too deep: "%2A" -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = COMMAND LINE
[9] : UPLIT (%ASCIZ'? Input error or unexpected EOF -- %1A'); !
! !ARG 1 = ROUTINE NAME
[10] : UPLIT (%ASCIZ'%% Badly formatted OBJ file %2A -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = OBJ FILE NAME
[11] : UPLIT (%ASCIZ'%% Checksum error in OBJ file %2A; should be %3O, was %4O -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = OBJECT FILE NAME
! ! 3 = COMPUTED CHECKSUM
! ! 4 = CHECKSUM READ
[12] : UPLIT (%ASCIZ'%% Object file feature is unsupported -- %1A'); !
! !ARG 1 = ROUTINE NAME
[13] : UPLIT (%ASCIZ
'%% Global symbol %1A defined in module %2A with value %3V and in module %4A with value %5V');
! !
! !ARG 1 = SYMBOL NAME
! ! 2 = FIRST MODULE NAME
! ! 3 = FIRST VALUE
! ! 4 = SECOND MODULE NAME
! ! 5 = SECOND VALUE
!
[14] : UPLIT (%ASCIZ'? Complex relocation exceeded stack limit of %3D, file %2A -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = FILE NAME
! ! 3 = STACK LIMIT
!
[15] : UPLIT (%ASCIZ'%% Module %2A multiply defines P-section %3A; flags = %5O, were %4O -- %1A');
!
! !ARG 1 = ROUTINE NAME
! ! 2 = MODULE NAME
! ! 3 = PSECT NAME
! ! 4 = OLD FLAGS
! ! 5 = NEW FLAGS
!
[16] : UPLIT (%ASCIZ'%% Global symbol %1A is undefined'); !
! !ARG 1 = SYMBOL NAME
!
[17] : UPLIT (%ASCIZ'%% Divide by zero when resolving relocation in P-section %2A -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = PSECT NAME
[18] : UPLIT (%ASCIZ'%% Relocation value %3O truncated to 8 bits in P-section %2A -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = PSECT NAME
! ! 3 = VALUE TO BE TRUNCATED
!
[19] : UPLIT (%ASCIZ'? Second %3A file in command string: "%2A" -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = FILE NAME
! ! 3 = ASSUMED TYPE
!
[20] : UPLIT (%ASCIZ'%% Unspecified output file: "%2A", ignored - %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = FILE NAME
!
[21] : UPLIT (%ASCIZ'? No input files -- %1A'); !
! !ARG 1 = ROUTINE NAME
!
[22] : UPLIT (%ASCIZ'%% Partition length of %2O less than task length of %3O -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = PARTITION LENGTH
! ! 3 = TASK LENGTH
!
!
[23] : UPLIT (%ASCIZ'%% Only one module allowed in symbol table file %2A -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = FILE NAME
!
!
[24] : UPLIT (%ASCIZ'? Error in text file %2A -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = FILE NAME
!
[25] : UPLIT (%ASCIZ'? Invalid address %2O in file %3A -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = ADDRESS
! ! 3 = FILE NAME
!
[26] : UPLIT (%ASCIZ'? Cannot find %3D bytes in system pool in %2A -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = FILE NAME
! ! 3 = AMOUNT REQUESTED
!
[27] : UPLIT (%ASCIZ'? Failure freeing %3D bytes at %4O in system pool in %2A, code %5D -- %1A');
! !ARG 1 = ROUTINE NAME
! ! 2 = FILE NAME
! ! 3 = AMOUNT IN BLOCK
! ! 4 = ADDRESS OF BLOCK
! ! 5 = ERROR CODE (SEE LISTING)
!
[28] : UPLIT (%ASCIZ'? 22-bit memory management not supported in %2A -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = FILE NAME
!
[29] : UPLIT (%ASCIZ'? Symbol %2A has conflicting values in %3A and %4A -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = SYMBOL NAME
! ! 3 = SYMBOL TABLE FILE 1
! ! 4 = SYMBOL TABLE FILE 2
!
!
[30] : UPLIT (%ASCIZ'? The Communications Executive has already been loaded into %2A -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = KERNEL FILE NAME
!
[31] : UPLIT (%ASCIZ'? The top of the COMM EXEC is too high: %3O .GT. %4O in %2A -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = FILE NAME
! ! 3 = TOP OF COMM EXEC
! ! 4 = MAX EXEC SIZE
!
[32] : UPLIT (%ASCIZ'%% Global symbol %2A is not defined in %3A -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = SYMBOL NAME
! ! 3 = FILE NAME
!
[33] : UPLIT (%ASCIZ'? Program logical address space (PLAS) is not supported - %1A'); !
! !ARG 1 = ROUTINE NAME
!
[34] : UPLIT (%ASCIZ'? File %2A size of %3D bytes is larger than max of %4D - %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = FILE NAME
! ! 3 = FILE SIZE
! ! 4 = MAX SIZE
[35] : UPLIT (%ASCIZ'? Loading library file %2A overflowed network pool by %3D bytes -- $1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = LIBRARY NAME
! ! 3 = OVERFLOW AMOUNT
!
[36] : UPLIT (%ASCIZ'? DDM %2A is unknown -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = DDM NAME
!
[37] : UPLIT (%ASCIZ'? DCP %2A is unknown -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = DLC NAME
!
[38] : UPLIT (%ASCIZ'? LLC %2A is unknown -- %1A'); !
! !ARG 1 = ROUTINE NAME
! ! 2 = LLC NAME
!
[39] : UPLIT (%ASCIZ'? Invalid %2A - %3D found -- %1A'); !
! !ARG 1 = Routine Name
! !ARG 2 = Type of construct in error
! !ARG 3 = Value of construct
!
[40] : UPLIT (%ASCIZ'? Invalid %2A %3A %4A %5O -- %1A');
!
[INRANGE] : UPLIT (%ASCIZ'? Invalid error'); !ERROR MSG HAS NO TEXT
[OUTRANGE] : UPLIT (%ASCIZ'? Illegal error'); !ERROR NUMBER OUT OF RANGE
TES);
PCRLF (.CHAN);
ERR_OUTSTR (.CHAN, .MESSAGE, .ARG1, .ARG2, .ARG3, .ARG4, .ARG5);
!
! DETERMINE PROCESSING OF ERROR:
! NON-FATAL = CONTINUE PROCESSING
! FATAL = TERMINATE PROGRAM
!
CASE .ERRNO FROM 1 TO 40 OF
SET
[1 TO 9, 14, 19, 21, 24 TO 31, 33 TO 40, OUTRANGE] :
BEGIN
PCRLF (.CHAN);
OUTSTR (.CHAN, UPLIT (%ASCIZ'?Terminating - No Recovery Available for Previous Error'));
STOP_PROGRAM ();
END;
[INRANGE] :
;
TES;
END;
!
END
ELUDOM
! Local Modes:
! Comment Start:!
! Mode:Fundamental
! Auto Save Mode:2
! Comment Column:36