I have the following:
local events:WSANETWORKEVENTS
local watch[2]:WSAEVENT
What I need to do is set handle1 into watch[0] and handle2 into watch[1] but the
correct way to do it eascapes me right now.
Can someone help please?
Rgs, striker
Something like this:
assume esi : ptr WSANETWORKEVENTS
lea esi, <your array name> ;point to the first struct in the array
mov eax, <your event>
mov esi.lNetworkEvents, eax
add esi, sizeof WSANETWORKEVENTS ;point to the second struct in the array
mov eax, <your event>
mov esi.lNetworkEvents, eax
assume esi : nothing
Of course this can be made to look a lot prettier in your real code :P
Sluggy,
Thanks. Its not exactly what i wanted but it did answer my question.
This is what I have now
local watch[2]:WSAEVENT
:
lea esi, watch
mov esi, handle1
add esi, sizeof WSAEVENT
mov esi, handle2
Ta.
Rgs, striker
Hi,
Shouldn't it be...
local watch[2]:WSAEVENT
:
lea esi, watch
mov [esi], handle1
add esi, sizeof WSAEVENT
mov [esi], handle2
You would have to dereference the address contained in ESI in order to mov the data into the right memory buffer.
Donkey,
When you say "Shouldnt it be" then most likely it should be.
Ill change what I have to what you suggest coz what I have dont work. :(
Thanks Donkey.
ps - im always getting [reg] and reg confused.
Hi Striker,
MASM adds the braces in some cases and not in others, that is what we mean in the GoAsm community when we say the syntax is ambiguous. In GoAsm which is much more explicit you would be required to enclose all memory based labels in braces so you get used to it much faster. This isn't to say that there is anything wrong with the way MASM does it, simply that the lack of braces on memory labels but requiring them for registers is an ambiguous situation. When I program in MASM I usually add the braces anyway, it helps me to differentiate between constants, direct to reg and memory based operations.
Donkey,
I started with goASM and I love it, however, for my current project its MASM as I want to give something to that community.
I dont think the work will be as accepted if it were for goASM.
Rgs, Striker.
Donkey,
If I ever move to GoASM, and it looks like I am going to, it will be because of that one very frustrating point. After all this time, you would think that MASM would have been rewritten to solve this silly ambiguity! Sorry to interrupt, you just struck a chord, as it were.
Paul