LEFTONE         - FIND LEFTMOST ONE BIT IN LONGWORD              21-AUG-1978 23:47:27   VAX-11 MACRO X0.3-11               Page   1

X0001                                                                                                                            (2)



                                     0000    49 ;

                                     0000    50 ; ASSORTED MACROS USED IN FCP CODE

                                     0000    51 ;

                                     0000    52 

                                     0000    53 	.MACRO	SET_IPL	LEVEL		; SET PROCESSOR IPL (DUMMY NOW)

                                     0000    54 	.ENDM	SET_IPL

                                     0000    55 ;

                                     0000    56 ; MACRO USED TO SIGNAL FATAL ERRORS (INTERNAL CONSISTENCY CHECKS).

                                     0000    57 ;

                                     0000    58 	.MACRO	BUG_CHECK	CODE, TYPE, MESSAGE

                                     0000    59 	HALT			; SIMPLY CALL A HALT FOR NOW

                                     0000    60 	.ENDM	BUG_CHECK

                                     0000    61 ;

                                     0000    62 ; MACRO TO SIGNAL AN ERROR STATUS AND CONTINUE.

                                     0000    63 ;

                                     0000    64 	.MACRO	ERROR	CODE

                                     0000    65 	MOVL	#CODE,USER_STATUS

                                     0000    66 	.ENDM	ERROR

                                     0000    67 ;

                                     0000    68 ; MACRO TO SIGNAL AN ERROR STATUS AND EXIT.

                                     0000    69 ;

                                     0000    70 	.MACRO	ERR_EXIT	CODE

                                     0000    71 	MOVZWL	CODE,-(SP)

                                     0000    72 	HALT			; UNTIL WE FIGURE THIS OUT

                                     0000    73 	.ENDM	ERR_EXIT

                                     0000    74 ;

                                     0000    75 ; TYPE CODES USED TO IDENTIFY BLOCKS BEING READ BY READ_BLOCK.

                                     0000    76 ; NOTE THAT READ_BLOCK CONTAINS A TABLE INDEXED BY THESE CODES.

                                     0000    77 ;

                           00000000  0000    78 	HEADER_TYPE	= 0		; FILE HEADER

                           00000001  0000    79 	BITMAP_TYPE	= 1		; STORAGE BITMAP

                           00000002  0000    80 	DIRECTORY_TYPE	= 2		; DIRECTORY BLOCK

                           00000003  0000    81 	INDEX_TYPE	= 3		; OTHER INDEX FILE BLOCKS

                                     0000    82 ;

                                     0000    83 ; TYPE CODES USED TO IDENTIFY BLOCKS OF MEMORY REQUESTED FROM THE

                                     0000    84 ; ALLOCATOR. NOTE THAT THESE CODES INDEX INTO A TABLE IN ALLOCATE.

                                     0000    85 ;

                           00000000  0000    86 	FCB_TYPE	= 0		; FILE CONTROL BLOCK

                           00000001  0000    87 	WCB_TYPE	= 1		; WINDOW BLOCK

LEFTONE         - FIND LEFTMOST ONE BIT IN LONGWORD              21-AUG-1978 23:47:27   VAX-11 MACRO X0.3-11               Page   2

X0001                                                                                                                            (1)



                                     0000     1 	.TITLE	LEFTONE - FIND LEFTMOST ONE BIT IN LONGWORD

                                     0000     2 	.IDENT	"X0001"

                                     0000     3 

                                     0000     4 ;

                                     0000     5 ; COPYRIGHT (C) 1976

                                     0000     6 ; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASSACHUSETTS 01754

                                     0000     7 ;

                                     0000     8 ; THIS SOFTWARE IS FURNISHED  UNDER A LICENSE FOR USE ONLY ON A SINGLE

                                     0000     9 ; COMPUTER  SYSTEM AND  MAY BE  COPIED ONLY WITH  THE INCLUSION OF THE

                                     0000    10 ; ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE, OR ANY OTHER COPIES THEREOF,

                                     0000    11 ; MAY NOT BE PROVIDED OR  OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON

                                     0000    12 ; EXCEPT FOR USE ON SUCH SYSTEM AND TO ONE WHO AGREES TO THESE LICENSE

                                     0000    13 ; TERMS.  TITLE TO AND  OWNERSHIP OF THE  SOFTWARE  SHALL AT ALL TIMES

                                     0000    14 ; REMAIN IN DEC.

                                     0000    15 ;

                                     0000    16 ; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE WITHOUT NOTICE

                                     0000    17 ; AND SHOULD  NOT BE CONSTRUED  AS A COMMITMENT  BY DIGITAL  EQUIPMENT

                                     0000    18 ; CORPORATION.

                                     0000    19 ;

                                     0000    20 ; DEC ASSUMES  NO  RESPONSIBILITY  FOR  THE USE OR  RELIABILITY OF ITS

                                     0000    21 ; SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY DEC.

                                     0000    22 

                                     0000    23 ;++

                                     0000    24 ;

                                     0000    25 ; FACILITY:  F11ACP STRUCTURE LEVEL 1

                                     0000    26 ;

                                     0000    27 ; ABSTRACT:

                                     0000    28 ;

                                     0000    29 ;	THIS ROUTINE RETURNS THE BIT NUMBER PLUS ONE OF THE LEFTMOST BIT

                                     0000    30 ;	SET IN THE ARGUMENT LONGWORD. IF THE ARGUMENT IS ZERO, ZERO IS

                                     0000    31 ;	RETURNED.

                                     0000    32 ;

                                     0000    33 ; ENVIRONMENT:

                                     0000    34 ;

                                     0000    35 ;	STARLET OPERATING SYSTEM, INCLUDING PRIVILEGED SYSTEM SERVICES

                                     0000    36 ;	AND INTERNAL EXEC ROUTINES. THIS ROUTINE MUST BE CALLED IN

                                     0000    37 ;	KERNEL MODE.

                                     0000    38 ;

                                     0000    39 ; AUTHOR:  ANDREW C. GOLDSTEIN  2-FEB-78  14:53

                                     0000    40 ;

                                     0000    41 ; MODIFIED BY:

                                     0000    42 ;

                                     0000    43 ;  , VERSION  ,

                                     0000    44 ; 01	- 

                                     0000    45 ;--

                                     0000    46 

                                     0000    47 ;

                                     0000    48 ; EQUATED SYMBOLS:

                                     0000    49 ;

                           00000004  0000    50 ARG	= 4				; INPUT ARGUMENT

LEFTONE         - FIND LEFTMOST ONE BIT IN LONGWORD              21-AUG-1978 23:47:27   VAX-11 MACRO X0.3-11               Page   3

X0001                                                                                                                            (2)



                                     0000    52 ;++

                                     0000    53 ;

                                     0000    54 ; FUNCTIONAL DESCRIPTION:

                                     0000    55 ;

                                     0000    56 ;	THIS ROUTINE RETURNS THE BIT NUMBER PLUS ONE OF THE LEFTMOST BIT

                                     0000    57 ;	SET IN THE INPUT ARGUMENT.

                                     0000    58 ;

                                     0000    59 ; CALLING SEQUENCE:

                                     0000    60 ;	CALL	LEFT_ONE (ARG1)

                                     0000    61 ;

                                     0000    62 ; INPUT PARAMETERS:

                                     0000    63 ;	ARG1: RANDOM LONGWORD

                                     0000    64 ;

                                     0000    65 ; IMPLICIT INPUTS:

                                     0000    66 ;	NONE

                                     0000    67 ;

                                     0000    68 ; OUTPUT PARAMETERS:

                                     0000    69 ;	NONE

                                     0000    70 ;

                                     0000    71 ; IMPLICIT OUTPUTS:

                                     0000    72 ;	NONE

                                     0000    73 ;

                                     0000    74 ; ROUTINE VALUE:

                                     0000    75 ;	BIT POSITION PLUS 1

                                     0000    76 ;

                                     0000    77 ; SIDE EFFECTS:

                                     0000    78 ;	NONE

                                     0000    79 ;

                                     0000    80 ;--

                                     0000    81 

                                 00000000    82 	.PSECT	$CODE$,NOWRT,LONG

                                     0000    83 

                                     0000    84 LEFT_ONE::

                               0000  0000    85 	.WORD	^M<>			; NO REGISTERS SAVED

            50            20     D0  0002    86 	MOVL	#32,R0			; ASSUME NEGATIVE

         04 AC            1F     E0  0005    87 	BBS	#31,ARG(AP),10$		; BRANCH TO END IF NEGATIVE

                          09         0009       

            50         04 AC     6E  000A    88 	CVTLD	ARG(AP),R0		; CONVERT TO DOUBLE FLOATING

            07            07     EF  000E    89 	EXTZV	#7,#7,R0,R0		; GET EXPONENT, LESS EXCESS 128

            50            50         0011       

                                 04  0013    90 10$:	RET				; AND THAT'S ALL

                                     0014    91 

                                     0014    92 

                                     0014    93 

                                     0014    94 	.END

LEFTONE         - FIND LEFTMOST ONE BIT IN LONGWORD              21-AUG-1978 23:47:27   VAX-11 MACRO X0.3-11               Page   4

SYMBOL TABLE                                                                                                                     (2)



ARG            = 00000004            

BITMAP_TYPE    = 00000001            

DIRECTORY_TYPE = 00000002            

FCB_TYPE       = 00000000            

HEADER_TYPE    = 00000000            

INDEX_TYPE     = 00000003            

LEFT_ONE         00000000 RG    02   

WCB_TYPE       = 00000001            





PROGRAM SECTION SYNOPSIS



.  ABS  .        00000000      00     NOPIC   USR   CON   ABS   LCL NOSHR NOEXE NORD  NOWRT BYTE  

. BLANK .        00000000      01     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  

$CODE$           00000014      02     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD  NOWRT LONG  





THERE WERE NO ERRORS OR WARNINGS.

28086. BYTES LEFT IN FREE MEMORY POOL.

OBJ$:LEFTONE,LIS$:LEFTONE/-SP=EXECML$/ML,SRC$:FCPDEF,LEFTONE

0 MLB DIR RDS - 0 GETS TO DEFINE 0 MACROS. 1 INTER. FILE WRITES. 

