[ask] structure

allopiloping

Member
Joined
Apr 4, 2008
Messages
7
Programming Experience
Beginner
why from function branch don't show any result
plz help me
 

Attachments

  • source.txt
    8.5 KB · Views: 26
It would be very helpful if you could be a little more descriptive than that.

Also, have you tried stepping through the code line by line to see if it's even running correctly?
 
i want to make an output form Function Branch

thx before

now i can show the output of branch function

but i have one new question,
i made Function Addw.....i want to make all addW operation mod by 2^32
i don't know about the correct data type
there'a always an error if i do that.

example ( A + B) mod 2^32

is there anyone can help me

thx a lot:) :) :) :)
 
Last edited:
help about structure

VB.NET:
Private Structure word
        Dim b1 As Byte
        Dim b2 As Byte
        Dim b3 As Byte
        Dim b4 As Byte
    End Structure

Private Function DoubleToWord(ByVal n As Double) As word
        DoubleToWord.b1 = Int(DMod(n, 2 ^ 32) / (2 ^ 24))
        DoubleToWord.b2 = Int(DMod(n, 2 ^ 24) / (2 ^ 16))
        DoubleToWord.b3 = Int(DMod(n, 2 ^ 16) / (2 ^ 8))
        DoubleToWord.b4 = Int(DMod(n, 2 ^ 8))
    End Function

Private Function WordToDouble(ByVal w As word) As Double
        WordToDouble = (w.b1 * (2 ^ 24)) + (w.b2 * (2 ^ 16)) + (w.b3 * (2 ^ 8)) + w.b4
    End Function

Private Function HexToWord(ByVal H As String) As word
        HexToWord = DoubleToWord(Val("&H" & H & "#"))
    End Function

Private Function WordToHex(ByVal w As word) As String
        WordToHex = Hex(w.b1).PadLeft(2, "0") & Hex(w.b2).PadLeft(2, "0") & Hex(w.b3).PadLeft(2, "0") & Hex(w.b4).PadLeft(2, "0")
    End Function

i have a few function...this function is to convert from word to hex

i don't knw how to make the convert from word to binary......plz help me

what should i do...????
thx
 
Back
Top