VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 3195 ClientLeft = 60 ClientTop = 345 ClientWidth = 2760 LinkTopic = "Form1" ScaleHeight = 213 ScaleMode = 3 'Pixel ScaleWidth = 184 StartUpPosition = 2 'CenterScreen Begin VB.CommandButton TestButton Caption = "Test" Height = 495 Left = 120 TabIndex = 1 Top = 120 Width = 1215 End Begin VB.ListBox DataList Height = 2985 ItemData = "MainForm.frx":0000 Left = 1440 List = "MainForm.frx":0002 TabIndex = 0 Top = 120 Width = 1215 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Option Explicit Private Sub TestButton_Click() Const HighSample = 1023 Dim Error As Long Dim Buf(0 To HighSample) As Integer Dim I As Long Dim oFlags As Byte DataList.Clear For I = 0 To HighSample Buf(I) = &H4242 Next oFlags = InPortB(&H61) OutPortB &H61, oFlags Or 3 Error = INSW(&H40, HighSample + 1, Buf(0)) OutPortB &H61, oFlags For I = 0 To HighSample DataList.AddItem I & ": " & Hex$(Buf(I)) Next TestButton.Caption = "Error = " & Error End Sub