

                22-Aug-1978 02:51:41	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 1   

					BITOUTPUT.FOR.4     



0001    	SUBROUTINE BITS_OUTPUT (LUN,REG,BITNAM,BEG,END,FLAG)

        C++

        C

        C	FACILITY:

        C

        C	ABSTRACT:

        C

        C

        C	ENVIRONMENT:

        C

        C	AUTHOR: V.L. MCMILLEN,	CREATION DATE:

        C

         

        C

        C

        C

        C	MODIFIED BY:

        C

        C	 , VERSION  ,

        C	01	-

        C

        C--

         

        C

        C	INCLUDE FILES:

        C		NONE

         

        C

        C	EQUATED SYMBOLS:

0002    	PARAMETER	CLEAR=1

0003    	PARAMETER	SET=0

         

        C

        C	OWN STORAGE:

        C

0004    	INTEGER*2	L

0005    	INTEGER*4	STATUS

0006    	BYTE		SIZE

0007    	INTEGER*4	FPOS

        C

        C	EXTERNAL ROUTINES:

0008    	INTEGER*2 	VBITCNT

        C

        C++	

        C

        C	FUNCTIONAL DESCRIPTION:

        C

        C	FORMAL PARAMETERS:

        C

0009    	BYTE		LUN,FLAG

0010    	INTEGER*4	REG

0011    	INTEGER*4	BEG,END,INDEX

0012    	CHARACTER *(*)	BITNAM (BEG:END)

        C--

0013    	INDEX=BEG			!INDEX INTO BIT FIELD

0014    	L=VBITCNT(REG,BEG,END)		!COUNT BITS SET IN FIELD



BITS_OUTPUT     22-Aug-1978 02:51:41	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 2   

					BITOUTPUT.FOR.4     



0015    	SIZE=(END-BEG)+1		!SET UP SIZE OF FIELD

0016    	IF (FLAG .EQ. CLEAR)

        	1	THEN

0017    			L=SIZE-L	!L IS LOOP CONTROL 

        					!THIS FOR BITS CLEAR

0018    	ENDIF

        C

        C	PRINT EACH BIT DESCRIPTION AS DESCRIBED BY FLAG

        C

0019    	IF (L .EQ. 0) RETURN

0020    	DO 50, I=L,1,-1

0021    		IF (FLAG .EQ. SET)

        	1		THEN

0022    				STATUS=LIB$FFS (INDEX,SIZE,REG,FPOS)

0023    			ELSE

0024    				STATUS=LIB$FFC (INDEX,SIZE,REG,FPOS)

0025    		ENDIF

0026    		IF (.NOT. STATUS) RETURN

0027    		INDEX=FPOS+1

0028    		WRITE (LUN,500) BITNAM (FPOS)

0029    	IF (FPOS .GE. END) RETURN

0030    	SIZE=END-FPOS

0031    50	CONTINUE

0032    500	FORMAT (' ',T40,A)

0033    	RETURN

0034    	END



BITS_OUTPUT     22-Aug-1978 02:51:41	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 3   

					BITOUTPUT.FOR.4     



		.TITLE	BITS_OUTPUT

		.IDENT	01



    0014	.PSECT	$LOCAL

    0014	.LONG	^X00000000,^X00000000

    001C	.LONG	^X040E0000

    0020	.LONG	^X00000000

    0024	.LONG	^X01E00000,^X00000000

    002C	.LONG	^X00000000

    0030	.LONG	^X00000000,^X00000000,^X00000000

    003C	.LONG	^X00000003

    0040	.LONG	^X00000000

    0044	.LONG	^X00000000

    0048	.LONG	^X00000000

    004C	.LONG	^X00000004

    0050	.ADDR	INDEX

    0054	.ADDR	SIZE

    0058	.LONG	^X00000000

    005C	.ADDR	FPOS

    0060	.LONG	^X010E0000

    0064	.LONG	^X00000000



    0000	.PSECT	$PDATA

    0000  .500:

    0000	.XBYTE	0F,01,20,0D,28,29,04



    0000	.PSECT	$CODE

    0000  BITS_OUTPUT::

    0000	.WORD	^M<IV,R2,R10,R11>

    0002	MOVAL	$LOCAL+^X4, R11

									    ; 0012

    0009	MOVL	@BEG(AP), $LOCAL+^X34(R11)

    000E	MOVL	@END(AP), $LOCAL+^X38(R11)

    0013	MOVQ	@BITNAM(AP), R0

    0017	MOVL	R1, $LOCAL+^X20(R11)

    001B	MOVW	R0, $LOCAL+^X1C(R11)

    001F	MOVAL	$LOCAL+^X1C(R11), R0

    0023	JSB	FOR$INI_DES1_R2

									    ; 0013

    0029	MOVL	@BEG(AP), INDEX(R11)

									    ; 0014

    002E	MOVAL	@REG(AP), $LOCAL+^X40(R11)

    0033	MOVAL	@BEG(AP), $LOCAL+^X44(R11)

    0038	MOVAL	@END(AP), $LOCAL+^X48(R11)

    003D	CALLG	$LOCAL+^X3C(R11), VBITCNT

    0045	MOVW	R0, L(R11)

									    ; 0015

    0049	SUBL3	@BEG(AP), @END(AP), R1

    004F	INCL	R1

    0051	CVTLB	R1, SIZE(R11)

									    ; 0016

    0055	CMPB	@FLAG(AP), #1

    0059	BNEQ	L$IAII

									    ; 0017

    005B	CVTBW	R1, R2

    005E	SUBW3	R0, R2, L(R11)



BITS_OUTPUT     22-Aug-1978 02:51:41	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 4   

					BITOUTPUT.FOR.4     



									    ; 0018

    0063  L$IAII:

									    ; 0019

    0063	TSTW	L(R11)

    0066	BNEQ	L$IAOI

    0068	RET	

    0069  L$IAOI:

									    ; 0020

    0069	CVTWL	L(R11), I(R11)

    006E	MOVAB	@$LOCAL+^X2C(R11), R10

    0072  L$IACK:

									    ; 0021

    0072	TSTB	@FLAG(AP)

    0075	BNEQ	L$IADL

									    ; 0022

    0077	MOVAL	@REG(AP), $LOCAL+^X58(R11)

    007C	CALLG	$LOCAL+^X4C(R11), LIB$FFS

    0084	MOVL	R0, STATUS(R11)

									    ; 0023

    0087	BRB	L$IABM

    0089  L$IADL:

									    ; 0024

    0089	MOVAL	@REG(AP), $LOCAL+^X58(R11)

    008E	CALLG	$LOCAL+^X4C(R11), LIB$FFC

    0096	MOVL	R0, STATUS(R11)

									    ; 0025

    0099  L$IABM:

									    ; 0026

    0099	BLBS	STATUS(R11), L$IAPM

    009C	RET	

    009D  L$IAPM:

									    ; 0027

    009D	ADDL3	#1, FPOS(R11), INDEX(R11)

									    ; 0028

    00A3	PUSHAL	.500

    00A9	CVTBL	@LUN(AP), -(SP)

    00AD	CALLS	#2, FOR$WRITE_SF

    00B4	MOVZWL	$LOCAL+^X1C(R11), R0

    00B8	MULL2	FPOS(R11), R0

    00BC	MOVW	$LOCAL+^X1C(R11), $LOCAL+^X60(R11)

    00C1	MOVAB	(R10)[R0], $LOCAL+^X64(R11)

    00C6	PUSHAB	$LOCAL+^X60(R11)

    00C9	CALLS	#1, FOR$IO_T_DS

    00D0	CALLS	#0, FOR$IO_END

									    ; 0029

    00D7	CMPL	FPOS(R11), @END(AP)

    00DC	BLSS	L$IALN

    00DE	RET	

    00DF  L$IALN:

									    ; 0030

    00DF	SUBL3	FPOS(R11), @END(AP), R0

    00E5	CVTLB	R0, SIZE(R11)

									    ; 0031

    00E9	SOBGTR	I(R11), L$IACK

									    ; 0033

    00ED	RET	



BITS_OUTPUT     22-Aug-1978 02:51:41	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 5   

					BITOUTPUT.FOR.4     



		.END



BITS_OUTPUT     22-Aug-1978 02:51:41	VAX-11 FORTRAN IV-PLUS V1.0-2      Page 6   

					BITOUTPUT.FOR.4     



PROGRAM SECTIONS



    Name                 Bytes   Attributes



  0 $CODE                  238   PIC CON REL LCL   SHR   EXE   RD NOWRT LONG

  1 $PDATA                   7   PIC CON REL LCL   SHR NOEXE   RD NOWRT LONG

  2 $LOCAL                 104   PIC CON REL LCL NOSHR NOEXE   RD   WRT LONG





ENTRY POINTS



    Address  Type Name           



  0-00000000      BITS_OUTPUT    





VARIABLES



    Address  Type Name               Address  Type Name               Address  Type Name               Address  Type Name           



 AP-00000010@ I*4 BEG             AP-00000014@ I*4 END             AP-00000018@ L*1 FLAG             2-00000008  I*4 FPOS           

  2-00000010  I*4 I                2-0000000C  I*4 INDEX            2-00000002  I*2 L               AP-00000004@ L*1 LUN            

 AP-00000008@ I*4 REG              2-00000000  L*1 SIZE             2-00000004  I*4 STATUS         





ARRAYS



    Address  Type Name		       Bytes  Dimensions



 AP-0000000C@ CHR BITNAM                  **  (*:*)





LABELS



    Address   Label       Address   Label   



      **      50        1-00000000  500'    





FUNCTIONS AND SUBROUTINES REFERENCED



LIB$FFC           LIB$FFS           VBITCNT        





Total Space Allocated = 349 Bytes





COMPILER OPTIONS



/CHECK=(NOBOUNDS,OVERFLOW)

/DEBUG=(NOSYMBOLS,TRACEBACK)

/OPTIMIZE  /WARNINGS  /I4  /NOD_LINES  

