	.TITLE	CB	Compare buffer routine
	.IDENT	/VER 0.1/
;
;	CB IS A FORTRAN CALLABLE MACRO ROUTINE FOR COMPARING ONE
;	BLOCK OF DATA TO ANOTHER AND RETURNING A -1(.TRUE.) IN R0
;	IF THE COMPARE PASSES OR A ZERO(.FALSE.) IF IT FAILS.
;
;	THIS ROUTINE IS APPROXIMATELY SEVEN TIMES FASTER THAN AN
;	EQUIVALENT ROUTINE WRITTEN IN FORTRAN.
;
;	DEFINE DATA BLOCKS AND POINTERS AS INTEGER*2
;
;	FORTRAN SYNTAX -- LOGICAL VAR = CB(BLOCK1,BLOCK2,BLOCK LEN)
;
;	EXAMPLE
;
;	INTEGER*2  BLOCK1(100),BLOCK2(100),WCNT
;	LOGICAL OK,CB
;
;	WCNT = 100
;	OK = CB(BLOCK1,BLOCK2,WCNT)
;		-- OR --
;	IF(CB(BLOCK1,BLOCK2,WCNT))...
;
	.PSECT	$CODE,EXE,SHR,NOWRT,PIC,LONG
	.ENTRY	CB,^M<R2,R3>
	MOVAL	@12(AP),R0			; FETCH WORD COUNT ADDR
	ASHL	#1,(R0),R0			; CONVERT TO BYTE COUNT
	MOVAB	@8(AP),R3			; FETCH BLOCK2 ADDR
	MOVAB	@4(AP),R1			; FETCH BLOCK1 ADDR
	CMPC3	R0,(R1),(R3)			; COMPARE THE BLOCKS
	BEQL	10$				; BRANCH IF EQUAL
	CLRL	R0				; SET .FALSE.
	RET
10$:	MNEGL	#1,R0				; SET .TRUE.
	RET
	.END
