这是我分析汇编程序的,有很多全局变量,主要分析部分在这里。
'[]==========[]
'[]seperate
'[]分离一个字符串,存入数组decom中
'[]==========[]
Public Sub Seperate(ByVal strCodeLine As String)
    Dim i As Long
    Dim leng As Long
    Dim c As String
    Dim j As Long
    Dim n As Long
    leng = Len(strCodeLine)
    n = 0
    For i = 1 To 256
        Decom(i) = ""
    Next i
    i = 0
    Do
        i = i + 1
        c = Mid(strCodeLine, i, 1)
        If c = " " Then
            Do
                i = i + 1
                c = Mid(strCodeLine, i, 1)
            Loop While c = " " And i <= leng
            i = i - 1
        ElseIf c = Chr(vbKeyTab) Then
            Do
                i = i + 1
                c = Mid(strCodeLine, i, 1)
            Loop While c = Chr(vbKeyTab) And i <= leng
            i = i - 1
        ElseIf c = "'" Then
            j = i
            Do
                i = i + 1
                c = Mid(strCodeLine, i, 1)
            Loop While c <> "'" And i <= leng
            n = n + 1
            Decom(n) = Trim(Mid(strCodeLine, j, i - j + 1))
        ElseIf c = "<" Then
            n = n + 1
            Decom(n) = "<"
        ElseIf c = ">" Then
            n = n + 1
            Decom(n) = ">"
        ElseIf c = "[" Then
            n = n + 1
            Decom(n) = "["
        ElseIf c = "]" Then
            n = n + 1
            Decom(n) = "]"
        ElseIf c = "{" Then
            n = n + 1
            Decom(n) = "{"
        ElseIf c = "}" Then
            n = n + 1
            Decom(n) = "}"
        ElseIf c = "(" Then
            n = n + 1
            Decom(n) = "("
        ElseIf c = ")" Then
            n = n + 1
            Decom(n) = ")"
        ElseIf c = "+" Then
            n = n + 1
            Decom(n) = "+"
        ElseIf c = "-" Then
            n = n + 1
            Decom(n) = "-"
        ElseIf c = "*" Then
            n = n + 1
            Decom(n) = "*"
        ElseIf c = "/" Then
            n = n + 1
            Decom(n) = "/"
        ElseIf c = "=" Then
            n = n + 1
            Decom(n) = "="
        ElseIf c = "," Then
            n = n + 1
            Decom(n) = ","
        ElseIf c = ":" Then
            n = n + 1
            Decom(n) = ":"
        Else
            j = i
            Do
                i = i + 1
                c = Mid(strCodeLine, i, 1)
            Loop While c <> " " And c <> Chr(vbKeyTab) And c <> "'" And c <> "{" And c <> "}" _
                                And c <> "[" And c <> "]" And c <> "<" And c <> ">" _
                                And c <> "(" And c <> ")" And c <> "+" And c <> "-" _
                                And c <> "*" And c <> "/" And c <> "=" And c <> "," _
                                And c <> ":" And i <= leng
            n = n + 1
            Decom(n) = Trim(Mid(strCodeLine, j, i - j))
            i = i - 1
        End If
    Loop While i <= leng
End Sub