home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Hack-Phreak Scene Programs
/
cleanhpvac.zip
/
cleanhpvac
/
ADV350.ZIP
/
shift.for
< prev
next >
Wrap
Text File
|
1990-11-11
|
411b
|
18 lines
INTEGER FUNCTION SHIFT(VAL,DIST)
C RETURN VAL LEFT-SHIFTED (LOGICALLY) DIST BITS (RIGHT SHIFT IF DIST <0).
IMPLICIT INTEGER*4 (A-Z)
SHIFT=VAL
IF(DIST)10,20,30
10 IDIST=-DIST
DO 11 I=1,IDIST
J=0
IF(SHIFT.LT.0) J=8#10000000000
11 SHIFT=((SHIFT.AND.8#17777777777)/2)+J
20 RETURN
30 SHIFT=ISHFT(VAL,DIST)
RETURN
END