Google
 

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

! THIS ROUTINE GETS A COMMAND PAGE VIA IPC AND CALLS THE APPROPRIATE
! ROUTINE TO EXECUTE THE FUNCTION REQUESTED BY THE PAGE. UPON
! COMPLETION OF THE COMMAND, THE ORIGINAL PAGE IS EITHER RETURNED TO
! THE SENDER, DESTROYED, OR IGNORED DEPENDING UPON THE VALUE RETURNED
! FROM THE EXECUTION ROUTINE.

GLOBAL ROUTINE CMDPROCESSOR=

    BEGIN

	REQUIRE	 DATA.BLI;

	EXTERNAL
	    INIT,
	    RECV,
	    SEND,
	    AC,
	    DI,
	    DITEIT,
	    DOEO,
	    EI;

	BIND
	    ACTION = PLIT(
		%1%	INIT,
		%2%	RECV,
		%3%	RECV,
		%4%	SEND,
		%5%	SEND,
		%6%	AC,
		%7%	DI,
		%8%	DITEIT,
		%9%	DOEO,
		%10%	EI,
		%11%	DITEIT,
		%12%	DOEO),

	    MAXCMD = 12;

	REGISTER
		JSN,
		PAGEADDR,
		COMMAND;

! BEGIN !

	IF (PAGEADDR _ INIPC()) EQL 0 THEN RETURN FALSE;	! IPC IN A PAGE, IF NONE EXIT NOW

	! BREAK UP THE RESPONSE FROM INIPC INTO IT'S COMPONENTS
	JSN _ .PAGEADDR<LH>;
	PAGEADDR _ .PAGEADDR<RH>;

	COMMAND _ .(.PAGEADDR)[P0FCN];		! PICKUP THE FUNCTION REQUIRED

	IF .COMMAND LEQ 0 OR .COMMAND GTR MAXCMD THEN
		BEGIN
		    (.PAGEADDR)[P0STATUS] _ STSUNKFUNCTION;
		    RETURN (OUTIPC(.PAGEADDR,.JSN); TRUE)
		END;

	! OTHERWISE DO THE COMMAND
	CASE (.ACTION[.COMMAND - 1])(.JSN,.PAGEADDR) OF
	    SET
		%0%	;				! KEEP THE PAGE
		%1%	OUTIPC(.PAGEADDR,.JSN);
		%2%	DPAGE(.PAGEADDR);		! GET RID OF THE PAGE
	    TES;

	TRUE

    END;

END;