LSR32
Result = LSR32(ValueToShift, Bits)
 
Parameters:

    ValueToShift=Value that will be shifted
    Bits=Number of bits the value will be shifted
Returns:

    Result = Shifted Value
 
     LSR32 is a logical operator that performs a right shift on a 32 bit value. The sign bit of this value is replicated.




FACTS:


      * LSL32, LSL16, LSL8, LSR32, LSR16 and LSR8 replicate the sign bit of the value they shift

      * LSR32(x,y) is equivalent to dividing x by 2^y



Mini Tutorial:


      Showing the effect of the logical right shift function. Try different value, or different numbers of bits to shift. Replace LSR32 with LSR16 or LSR8

  
; Value that will be shifted
  Value = 128
; display this value in binary form
  Print Bin$(Value)
  
; shift value by 4 bits
  Value = LSR32(Value, 4)
  
; Display new value in binary form
  Print Bin$(Value)
  
; Display the Screen and wait for the user to press a key
  Sync
  WaitKey
  



This example would output.

  
  %00000000000000000000000010000000
  %00000000000000000000000000001000
  





 
Related Info: LSL16 | LSL32 | LSL8 | LSR16 | LSR8 :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com