FORTRAN IV-PLUS V02-51D		02:41:26    22-AUG-78		PAGE 1   

HEXDMP.FTN   	/TR:BLOCKS/WR


        C

        C

        C

        C	HEXDMP  --  HEXADECIMAL DUMP

        C

        C

        C

        C	COPYRIGHT (C) 1976

        C	DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

        C

        C	THIS SOFTWARE IS FURNISHED UNDER  A LICENSE FOR USE ONLY  ON  A

        C	SINGLE COMPUTER SYSTEM AND MAY BE  COPIED ONLY WITH  THE INCLU-

        C	SION OF  THE  ABOVE  COPYRIGHT NOTICE.  THIS SOFTWARE,  OR  ANY

        C	OTHER COPIES THEREOF, MAY NOT BE  PROVIDED  OR  OTHERWISE  MADE

        C	AVAILABLE TO ANY OTHER PERSON EXCEPT  FOR  USE  ON  SUCH SYSTEM

        C	AND TO  ONE WHO AGREES  TO  THESE LICENSE  TERMS.  TITLE TO AND

        C	OWNERSHIP OF THE SOFTWARE SHALL AT ALL TIMES REMAIN IN DEC.

        C

        C	THE INFORMATION IN THIS SOFTWARE  IS  SUBJECT TO CHANGE WITHOUT

        C	NOTICE AND SHOULD NOT BE CONSTRUED  AS  A COMMITMENT BY DIGITAL

        C	EQUIPMENT CORPORATION.

        C

        C	DEC ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY OF ITS

        C	SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

        C	T.J. PROTRER AND REVISIONS BY K.D. MORSE   07-NOV-76

        C

        C

        C

        C

        C	THIS SUBROUTINE WRITES A HEXADECIMAL DUMP OF A STREAM OF BYTES

        C	PROVIDED BY THE CALLER.  IT INDENTS EACH LINE THE DESIRED NUMBER

        C	OF SPACES AND WRITES AS MANY HEXADECIMAL VALUES AS POSSIBLE GIVEN

        C	THE SIZE OF THE LINE.

        C

        C

        C

        C

        C

        C

        C  VARIABLES:

        C

        C

        C	ARRAY--ARRAY OF BYTES TO BE CONVERTED TO HEXADECIMAL

        C	ICHAR--ASCII CHARACTER OF HEXADECIMAL NUMBER

        C	ISTART--SUBSCRIPT INTO ARRAY OF FIRST BYTE TO BE CONVERTED

        C	LENGTH--NUMBER OF BYTES TO BE CONVERTED

        C	LINWID--ARRAY CONTAINING THE WIDTH OF THE LINE AND THE NUMBER OF

        C		SPACES TO INDENT SEQUENTIAL LINES

        C	OLUN--OUTPUT CHANNEL

        C	PRBUF--OUTPUT BUFFER TO HOLD ASCII DATA

        C

        C

0001    	SUBROUTINE HEXDMP(ARRAY,ISTART,LENGTH,LINWID,OLUN)

        C

        C

        C

FORTRAN IV-PLUS V02-51D		02:41:26    22-AUG-78		PAGE 2   

HEXDMP.FTN   	/TR:BLOCKS/WR


0002    	BYTE ARRAY(ISTART - 1 + LENGTH),PRBUF(64)

0003    	INTEGER OLUN,LINWID(2)

        C

        C

0004    10	FORMAT('+',<LINWID(1)>(2X,A1,A1))

0005    20	FORMAT(' ',<LINWID(2)>X,<LINWID(1)>(2X,A1,A1))

0006    40	FORMAT()

        C

        C

        C

0007    230	LINE = 0

        C

0008    	DO 500 I = ISTART,ISTART -1 + LENGTH

0009    		IZ = I + 1 - ISTART

0010    		IX = (IZ - 1)/LINWID(1)

0011    		J = IZ - LINWID(1)*IX

0012    		IK = 2*J - 1

0013    		DO 350 K = IK,IK+1

0014    			ICHAR = ARRAY(I) .AND. (240+225*(IK-K))

0015    			ICHAR = ICHAR/(16+15*(IK-K))

0016    			IF(ICHAR .GT. 9)GO TO 250

0017    				ICHAR = ICHAR + 48

0018    				GO TO 300

0019    250				ICHAR = ICHAR + 55

0020    300			PRBUF(K) = ICHAR

0021    350		CONTINUE

0022    		IY = IZ/LINWID(1)

0023    		IF(LINWID(1)*IY .EQ. IZ) GO TO 400

0024    		IF(IZ .NE. LENGTH) GO TO 500

0025    400		IF (LINE .EQ. 0)WRITE(OLUN,10)(PRBUF(N),N=1,IK+1)

0026    		IF (LINE .GT. 0) WRITE(OLUN,20)(PRBUF(N),N=1,IK+1)

0027    430		LINE=LINE+LINWID(1)

0028    500	CONTINUE

        C

        C----->		OUTPUT A BLANK LINE

        C

0029    	WRITE(OLUN,40)

0030    600	RETURN

0031    	END

FORTRAN IV-PLUS V02-51D		02:41:26    22-AUG-78		PAGE 3   

HEXDMP.FTN   	/TR:BLOCKS/WR


PROGRAM SECTIONS



NUMBER	 NAME	    SIZE		ATTRIBUTES



  1	$CODE1	001034   270		RW,I,CON,LCL

  3	$IDATA	000102    33		RW,D,CON,LCL

  4	$VARS	000124    42		RW,D,CON,LCL

  5	$TEMPS	000006     3		RW,D,CON,LCL





ENTRY POINTS



 NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS   



 HEXDMP	      1-000000





VARIABLES



 NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS    NAME   TYPE  ADDRESS   



 I	I*2   4-000102	 ICHAR	I*2   4-000116	 IK	I*2   4-000112	 ISTART	I*2   F-000004*	 IX	I*2   4-000106

 IY	I*2   4-000120	 IZ	I*2   4-000104	 J	I*2   4-000110	 K	I*2   4-000114	 LENGTH	I*2   F-000006*

 LINE	I*2   4-000100	 N	I*2   4-000122	 OLUN	I*2   F-000012*





ARRAYS



 NAME   TYPE  ADDRESS	    SIZE 	DIMENSIONS



 ARRAY	L*1   F-000002*	     **     	(*)

 LINWID	I*2   3-000100*	000004     2	(2)

 PRBUF	L*1   4-000000	000100    32	(64)





LABELS



 LABEL   ADDRESS 	 LABEL   ADDRESS 	 LABEL   ADDRESS 	 LABEL   ADDRESS 	 LABEL   ADDRESS 	



 10'	 3-000000	 20'	 3-000020	 40'	 3-000044	 230	    **   	 250	 1-000360

 300	 1-000374	 350	    **   	 400	 1-000476	 430	    **   	 500	 1-000726

 600	    **   





TOTAL SPACE ALLOCATED = 001270   348



NO FPP INSTRUCTIONS GENERATED



OBJ$:HEXDMP,LIS$:HEXDMP/-SP=SRC$:HEXDMP

