Attribute VB_Name = "Module1" Public Declare Function InPortB Lib "ACCES32.dll" Alias "VBInPortB" (ByVal Port As Long) As Integer Public Declare Function OutPortB Lib "ACCES32.dll" Alias "VBOutPortB" (ByVal Port As Long, ByVal Value As Byte) As Integer Public Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long) Public Function ShiftRight(ByVal InitNum As Long, ByVal BitsRight As Long) As Long 'Performs a bitwise right-shift. This is equivalent to C++'s >> operator. ShiftRight = CLng(InitNum / (2 ^ BitsRight)) End Function Public Function ShiftLeft(ByVal InitNum As Long, ByVal BitsLeft As Long) As Long 'Performs a bitwise left-shift. This is equivalent to C++'s << operator. 'C++: ' 1024 << 8 //Shift left 8 bits 'VB: ' ShiftLeft(1024, 8) 'Shift left 8 bits ShiftLeft = CLng(InitNum * (2 ^ BitsLeft)) End Function