

; Bliss-32 7.352	Saturday 21-AUG-1978 23:50:43	DBB3:[MOUNT.SRC]CHKSM2.B32;8					Page 1

; Digital Equipment Corporation

;

;	0001	MODULE CHKSM2 (

;	0002			LANGUAGE (BLISS32),

;	0003			IDENT = 'X0002'

;	0004			) =

;	0005	BEGIN

;	0006	

;	0007	!

;	0008	! Copyright (c) 1977

;	0009	! Digital Equipment Corporation, Maynard, Massachusetts 01754

;	0010	!

;	0011	! This software is furnished  under a license for use only on a single

;	0012	! computer  system and  may be  copied only with  the inclusion of the

;	0013	! above copyright notice.  This software, or any other copies thereof,

;	0014	! may not be provided or  otherwise made available to any other person

;	0015	! except for use on such system and to one who agrees to these license

;	0016	! terms.  Title to and  ownership of the  software  shall at all times

;	0017	! remain in DEC.

;	0018	!

;	0019	! The information in this software is subject to change without notice

;	0020	! and should  not be construed  as a commitment  by Digital  Equipment

;	0021	! Corporation.

;	0022	!

;	0023	! DEC assumes  no  responsibility  for  the use or  reliability of its

;	0024	! software on equipment which is not supplied by DEC.

;	0025	

;	0026	!++

;	0027	!

;	0028	! FACILITY:  MOUNT Utility Structure Levels 1 & 2

;	0029	!

;	0030	! ABSTRACT:

;	0031	!

;	0032	!	This routine computes the block checksum over the indicated

;	0033	!	byte count.

;	0034	!

;	0035	! ENVIRONMENT:

;	0036	!

;	0037	!	STARLET operating system, including privileged system services

;	0038	!	and internal exec routines.

;	0039	!

;	0040	!--

;	0041	!

;	0042	!

;	0043	! AUTHOR:  Andrew C. Goldstein,	 CREATION DATE:  24-Nov-1977  14:58

;	0044	!

;	0045	! REVISION HISTORY:

;	0046	!

;	0047	!   Andrew C. Goldstein, 4-Jan-1978  16:33

;	0048	!   X0002 - Store computed checksum

;	0049	!

;	0050	!**

;	0051	

;	0052	

;	0053	LIBRARY 'SYS$LIBRARY:LIB.L32';

;	0054	REQUIRE 'SRC$:MOUDEF.B32';

;	0361	REQUIRE 'LIBD$:[VMSLIB.OBJ]MOUNTMSG.B32';



; Bliss-32 7.352	Saturday 21-AUG-1978 23:50:43	DBB3:[MOUNT.SRC]CHKSM2.B32;8					Page 1-1

; Digital Equipment Corporation

;



; Bliss-32 7.352	Saturday 21-AUG-1978 23:50:43	DBB3:[MOUNT.SRC]CHKSM2.B32;8					Page 2

; Digital Equipment Corporation

;

;	0461	GLOBAL ROUTINE CHECKSUM2 (BUFFER, COUNT) =

;	0462	

;	0463	!++

;	0464	!

;	0465	! FUNCTIONAL DESCRIPTION:

;	0466	!

;	0467	!	This routine computes the additive block checksum over the indicated

;	0468	!	count. It stores the checksum at the given byte offset and returns

;	0469	!	a match or mismatch status.

;	0470	!

;	0471	!

;	0472	! CALLING SEQUENCE:

;	0473	!	CHECKSUM (ARG1, ARG2)

;	0474	!

;	0475	! INPUT PARAMETERS:

;	0476	!	ARG1: address of block to checksum

;	0477	!	ARG2: byte count of block

;	0478	!

;	0479	! IMPLICIT INPUTS:

;	0480	!	NONE

;	0481	!

;	0482	! OUTPUT PARAMETERS:

;	0483	!	NONE

;	0484	!

;	0485	! IMPLICIT OUTPUTS:

;	0486	!	NONE

;	0487	!

;	0488	! ROUTINE VALUE:

;	0489	!	1 if checksum is correct

;	0490	!	0 if not

;	0491	!

;	0492	! SIDE EFFECTS:

;	0493	!	NONE

;	0494	!

;	0495	!--

;	0496	

;	0497	BEGIN

;	0498	

;	0499	MAP

;	0500		BUFFER		: REF VECTOR [,WORD];

;	0501	

;	0502	LOCAL

;	0503		SUM		: WORD,		! running checksum

;	0504		STATUS;				! return status

;	0505	

;	0506	

;	0507	SUM = 0;

;	0508	INCR J FROM 0 TO .COUNT/2-1 DO

;	0509	    SUM = .SUM + .BUFFER[.J];

;	0510	

;	0511	STATUS = .SUM EQL .BUFFER[.COUNT/2];

;	0512	BUFFER[.COUNT/2] = .SUM;

;	0513	RETURN .STATUS;

;	0514	

;	0515	END;					! end of routine CHECKSUM2



; Bliss-32 7.352	Saturday 21-AUG-1978 23:50:43	DBB3:[MOUNT.SRC]CHKSM2.B32;8					Page 2-1

; Digital Equipment Corporation

;





							    .TITLE  CHKSM2

							    .IDENT  \X0002\







							    .PSECT  $CODE$,NOWRT,2



					 0004 00000 	    .ENTRY  CHECKSUM2, Save R2					      ; 0461

				       52  B4 00002 	    CLRW    SUM							      ; 0507

	   50	    08   AC	       02  C7 00004 	    DIVL3   #2, COUNT, R0					      ; 0508

		         51	       01  CE 00009 	    MNEGL   #1, J						      ;

				       05  11 0000C 	    BRB     2$							      ;

		         52	  04 BC41  A0 0000E 1$:     ADDW2   @BUFFER[J], SUM					      ; 0509

	   F7	         51	       50  F2 00013 2$:     AOBLSS  R0, J, 1$						      ; 0508

				       51  D4 00017 	    CLRL    R1							      ; 0511

		    04 BC40	       52  B1 00019 	    CMPW    SUM, @BUFFER[R0]					      ;

				       02  12 0001E 	    BNEQ    3$							      ;

				       51  D6 00020 	    INCL    R1							      ;

		    04 BC40	       52  B0 00022 3$:     MOVW    SUM, @BUFFER[R0]					      ; 0512

		         50	       51  D0 00027 	    MOVL    STATUS, R0						      ; 0513

					   04 0002A 	    RET     							      ; 0461



; Routine Size:  43 bytes





;	0516	

;	0517	END

;	0518	ELUDOM













;				       PSECT SUMMARY

;

;	Name		 Bytes			       Attributes

;

;  $CODE$         	    43  NOWRT,  RD ,  EXE,NOSHR,  LCL,  REL,  CON,NOPIC,ALIGN(2)









;				LIBRARY STATISTICS

;

;					     -------- Symbols --------    Blocks

;	File				     Total    Loaded   Percent      Read

;

;  DBA4:[SYSLIB]LIB.L32;1		      5582         4         0       223











; Bliss-32 7.352	Saturday 21-AUG-1978 23:50:43	DBB3:[MOUNT.SRC]CHKSM2.B32;8					Page 2-2

; Digital Equipment Corporation

;



; Size:		43 code + 0 data bytes

; Run Time:	00:10.8

; Elapsed Time:	00:33.3

; Memory Used:	263 pages

; Compilation Complete

