Google
 

Trailing-Edge - PDP-10 Archives - BB-J939B-BM - binary/chkc2l.b36
There are 2 other files named chkc2l.b36 in the archive. Click here to see a list.
MODULE CHKC2L(
    MAIN=CHECK,
    LANGUAGE(BLISS36))=
BEGIN

!+
! FUNCTION:
!   Test a BLISS compiler for proper operation on under TOPS-20/KL10.
!-

! First make sure that the default environment information is correct.
%IF NOT %SWITCHES(KL10)
%THEN
    %ERROR('Default processor switch should be KL10 and isn''t.')
%FI

%IF NOT %SWITCHES(TOPS20)
%THEN
    %ERROR('Default monitor switch should be TOPS20 and isn''t.')
%FI

%IF %SWITCHES(KL10) AND %SWITCHES(TOPS20)
%THEN

REQUIRE 'TUTIO';
ROUTINE DUMMY(X, Y, Z):NOVALUE = 0;
ROUTINE CHECK:NOVALUE=
    BEGIN
    LOCAL
	PTR,
	X: VECTOR[21];		! Note: checks ADJSP instruction.

    IF CH$RCHAR(CH$PLUS(CH$PTR(UPLIT('ABCDE')),2)) NEQ %C'C'
    THEN
	BEGIN
	TTY_PUT_CRLF();
	TTY_PUT_QUO('? Adjust byte pointer did not act correctly');
	TTY_PUT_CRLF();
	END;

    TTY_PUT_CRLF();
    TTY_PUT_QUO('Note: an error message here means that the extended');
    TTY_PUT_CRLF();
    TTY_PUT_QUO('instructions are probably not acting correctly.');
    TTY_PUT_CRLF();

    PTR = CH$PTR(X[0]);

    PTR = CH$FILL(%C'A', 5*1, .PTR);
    PTR = CH$FILL(%C'B', 5*19, .PTR);
    PTR = CH$FILL(%C'C', 5*1, .PTR);

    ! If we have gotten this far without blowing up then the extended
    ! instructions think they are working.

    TTY_PUT_CRLF();
    TTY_PUT_QUO('The extended instruction set seems to be operating.');
    TTY_PUT_CRLF();

    ! Now we check to see if it has operated correctly and to see if
    ! the stack was adjusted.  We call a routine to get the "stack"
    ! overwritten in case the ADJSP didn't work right.
    DUMMY(1, 2, 3);

    IF CH$RCHAR(CH$PTR(X[0],4)) NEQ %C'A'
    THEN
	BEGIN
	TTY_PUT_CRLF();
	TTY_PUT_QUO('? Either the extended instruction set is not operating');
	TTY_PUT_CRLF();
	TTY_PUT_QUO('correctly or ADJSP is not.');
	TTY_PUT_CRLF();
	RETURN;
	END;

    IF (
	IF (CH$RCHAR(CH$PTR(X[19],4)) EQL %C'B')
	THEN
	    (CH$RCHAR(CH$PTR(X[20],4)) NEQ %C'C')
	ELSE
	    1)
    THEN
	BEGIN
	TTY_PUT_CRLF();
	TTY_PUT_QUO('? ADJSP doesn''t seem to work correctly');
	TTY_PUT_CRLF();
	END;
    END;
! This is the last page.
%ELSE ! %SWITCHES(KL10) AND %SWITCHES(TOPS20)

    ! Include something so as not to get a empty module error.
    BIND X=0;
%FI

END ELUDOM