Google
 

Trailing-Edge - PDP-10 Archives - BB-R595B-SM_11-9-85 - mcb/xpt/xptmac.r16
There is 1 other file named xptmac.r16 in the archive. Click here to see a list.
!                    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.

!+
!
!  Macros and structures for MCB in general
!
!-

library 'MCB:XPORTX';
library 'MCB:MCBLIB';
library 'MCB:NMXLIB';
library 'XPTLIB';

macro GETW(PTR) =
    begin
    stacklocal X;
    X<0,8,0> = ch$rchar_a(PTR);
    X<8,8,0> = ch$rchar_a(PTR);
    .X
    end%;
macro PUTW(VALUE,PTR) =
    %IF %ctce(VALUE) %THEN
	begin
	ch$wchar_a((VALUE) mod 256,PTR);
	ch$wchar_a((VALUE)^-8,PTR);
	end
    %ELSE
	begin
	stacklocal X;
	X = VALUE;
	ch$wchar_a(.X<0,8,0>,PTR);
	ch$wchar_a(.X<8,8,0>,PTR);
	end
    %FI %;
macro GETQ(ADDRESS,PTR) =
    begin
    getw(.(ADDRESS),PTR);
    getw(.vector[(ADDRESS),1],PTR);
    end%;
macro PUTQ(ADDRESS,PTR) =	! ADDRESS is assumed to be word-aligned
    %IF %ctce(ADDRESS) %THEN	! ADDRESS is really a value:
	begin
	ch$wchar_a(ADDRESS mod 256,PTR);
 	ch$wchar_a((ADDRESS/256) mod 256,PTR);
	ch$wchar_a(0,PTR);
	ch$wchar_a(0,PTR);
	end
    %ELSE			! ADDRESS is an address
	begin
	putw(.(ADDRESS),PTR);
	putw(.vector[(ADDRESS),1],PTR);
	end
    %FI %;
macro ZEROQ(ADDRESS) =		! ADDRESS is assumed to be word-aligned
    (ADDRESS) = 0;
    vector[ADDRESS,1] = 0;
%;

structure MATRIX [I,J,NL; M,N,UNIT=%upval] =	!Rows are one-based,
    [M * N * UNIT]				! columns zero-based
    (MATRIX + ((I-1)*(NL+1)+J)*UNIT)<0,%bpunit*UNIT,0>;

%IF %VARIANT NEQ 0 %THEN
    macro BPT(CODE) =
	SIGNAL(CODE
	    %IF NOT %null(%REMAINING) %THEN , %remaining %FI
	)%;
    %IF NOT %DECLARED(%QUOTE BUFCHK) %THEN
	macro BUFCHK =
	    begin
	    external routine CHKBUF;
	    CHKBUF
	    end %;
    %FI
%ELSE
    macro BPT = NOP%;			!Ignore debug traps
    builtin NOP;
    %IF NOT %DECLARED(%QUOTE BUFCHK) %THEN
	macro BUFCHK = NOP%; %FI	!Don't do buffer checking
%FI