日期:2009-12-19  浏览次数:21018 次

  1. <%  
  2. Private Const BITS_TO_A_BYTE = 8 
  3. Private Const BYTES_TO_A_WORD = 4 
  4. Private Const BITS_TO_A_WORD = 32 
  5.  
  6. Private m_lOnBits(30)  
  7. Private m_l2Power(30)  
  8.    
  9. Private Function LShift(lValue, iShiftBits)  
  10.     If iShiftBits = 0 Then  
  11.         LShift = lValue 
  12.         Exit Function  
  13.     ElseIf iShiftBits = 31 Then  
  14.         If lValue And 1 Then  
  15.             LShift = &H80000000  
  16.         Else  
  17.             LShift = 0 
  18.         End If  
  19.         Exit Function  
  20.     ElseIf iShiftBits < 0 Or iShiftBits > 31 Then  
  21.         Err.Raise 6  
  22.     End If  
  23.  
  24.     If (lValue And m_l2Power(31 - iShiftBits)) Then  
  25.         LShift = ((lValue And m_lOnBits(31 - (iShiftBits + 1))) * m_l2Power(iShiftBits)) Or &H80000000  
  26.     Else  
  27.         LShift = ((lValue And m_lOnBits(31 - iShiftBits)) * m_l2Power(iShiftBits))  
  28.     End If  
  29. End Function  
  30.  
  31. Private Function RShift(lValue, iShiftBits)  
  32.     If iShiftBits&nbs