Google
 

Trailing-Edge - PDP-10 Archives - AP-D471B-SB_1978 - dmr.bli
There are no other files named dmr.bli in the archive.
!***COPYRIGHT (C) 1974, 1975, 1976, 1977 DIGITAL EQUIPMENT CORP., MAYNARD, MASS.***
MODULE DMR(RESERVE(#11, #12, #13, #14), SREG = #17, FREG = #16,
 DREGS = 4, VREG = #15, MLIST, TIMER = EXTERNAL(SIX12), FSAVE,  ENTRIES=(DMR)) = 
    BEGIN
	REQUIRE	 DATA.BLI;			! EVERYONE NEEDS THIS

COMMENT;

!SPECIAL.BLI
!======= ===

! LAST MODIFIED:	29 JUN 76  BY  CDO

	EXTERNAL
		DMRLEAF,
		KILGROUP,
		UNDEFER,
		GETREQUEST,
		MAKEMSG,
		SKIPCHUNKS,
		MAKEBP,
		OUTMSG;
COMMENT;

! ROUTINE DMR
! ======= ===
! THIS ROUTINE HANDLES THE REQUEST FOR DEFERRED MESSAGES TRANSACTION CODE
	!NOTE: TO OBTAIN THE NUMBER OF DEFERRED MESSAGES DESIRED, THE
	!	FOLLOWING ASSUMPTIONS ARE MADE:
	!
	!	1. THE TEXT IS ASCII
	!	2. LEADING BLANKS ( SPACES AND TABS ) ARE IGNORED
	!	3. ANY NON-NUMERIC CHARACTER OR END INDICATOR STOPS THE
	!	   CONVERSION.

GLOBAL ROUTINE DMR =
    BEGIN
	REGISTER
		COUNT,
		SRCPTR,
		GHPTR,
		CHAR;

	LOCAL	CHARLEFT,
		MSGCHUNKS,
		MHPTR,
		CHUNKPTR,
		BPIN;

	MAP	FORMAT GHPTR;
	MAP	FORMAT SRCPTR;
	MAP	FORMAT CHUNKPTR;
	MAP	FORMAT MHPTR;

	MACRO
		NEXTCHAR = 
			BEGIN
				LABEL LOOP;
				LOOP: BEGIN
					WHILE ( CHARLEFT _ .CHARLEFT - 1 ) LSS 0 DO	! IF NO CHARACTERS LEFT
										! IN THIS CHUNK GET ANOTHER
					    BEGIN
						IF ( CHUNKPTR _ .CHUNKPTR[C0LINK]) EQL 0 THEN
							LEAVE LOOP WITH CHAR _ 0;
						BPIN<RH> _ CHUNKPTR[C0DATA];
						BPIN<POS> _ 36;
						CHARLEFT _ .CHUNKPTR[C0BCNT]
					    END;
					CHAR _ SCANI(BPIN)
				    END
			END$;

	IF (GHPTR _ GETREQUEST(DMRLEAF)) EQL 0 THEN RETURN;

	IF .GHPTR[G0TYPEOFSENDER] EQL LEAFTYPE THEN RETURN;

	SRCPTR _ .GHPTR[G0SENDER];		! GET THE SENDER

	MHPTR _ .GHPTR[ G0FMHPTR ];
	CHUNKPTR _ .MHPTR[ M0INCHNK ];
	IF ( CHUNKPTR _ SKIPCHUNKS( .CHUNKPTR, .MHPTR[ M0SOT ], FALSE ) ) NEQ 0 THEN
	    BEGIN
		COUNT _ .CHUNKPTR<LH>;
		BPIN _ MAKEBP( .CHUNKPTR, .COUNT );
		CHARLEFT _ .CHUNKPTR[ C0BCNT ] - .COUNT;
		COUNT _ 0;				! START WITH COUNT OF 0

		NEXTCHAR;				! GET FIRST CHARACTER
		! OBTAIN THE NUMBER WANTED FROM THE MESSAGE TEXT
		WHILE .CHAR EQL SPACECHAR OR .CHAR EQL TABCHAR DO	!SKIP LEADING SPACES OR TABS
			NEXTCHAR;

		IF .CHAR NEQ 0 THEN
			WHILE .CHAR LEQ "9" AND .CHAR GEQ "0" DO	! GATHER THE NUMBER WANTED
			    BEGIN
				COUNT _ .COUNT * 10 + ( .CHAR - "0" );
				NEXTCHAR
			    END;

		IF .COUNT EQL 0 THEN COUNT _ 1			! IF NO NUMBER SPECIFIED SEND ONE
	    END
	    ELSE COUNT _ 1;

	IF .SRCPTR[ S0DFGCNT ] EQL 0		!ANY DEFERRED MESSAGES TO OUTPUT?
	    THEN
	    BEGIN				!**NO** TELL USER NONE
		! MAKE MESSAGE WITH DATE AND TIME
		MSGCHUNKS _ MAKEMSG( PAZ '%Z%?M?JNO DEFERRED MESSAGES AVAILABLE?M?J@',0,0,0,0,0);

		! SEND THE MESSAGE
		OUTMSG(.MSGCHUNKS,.SRCPTR[S0PORTPTR],FALSE,FALSE)
	    END
	    ELSE
	    BEGIN				!**YES** OUTPUT THE NUMBER HE WANTED
		! LINK THE MESSAGE TO SEND TO THE IMMEDIATE OUTPUT LIST
		UNDEFER( .SRCPTR, .COUNT )
	    END;

	! CLEAN UP
	KILGROUP( .GHPTR, -1);

	! ALL DONE

    END;



    END;				! END OF DMR