Here is what I want to do
Lets say I have a structure like this

dummy struct
param1 dd ?
param2 dd ?
param3 dd ?
dummy ends

I want to write a macro so that for a given values and pointer to structure, I want to use values from this structure

Example

UPDATE_HASH macro s:REQ,h:REQ,c:REQ
h= (( (h) shl (dummy PTR.param1) xor (c) ) and (dummy PTR.param3)
endm

Is this macro possible or should I pass macro variables to registers and do long work ?
Thanks.
Posted on 2002-11-22 13:31:12 by LaptoniC
Those operations are only assemble-time. Run-time operations require code.
UPDATE_HASH macro s:REQ,h:REQ,c:REQ

mov ecx, dummy PTR[s].param1
mov eax, h
shl eax, ecx
xor eax, c
and eax, dummy PTR[s].param3
mov h, eax
ENDM
Maybe, I have made an error in the operator precidence?
Posted on 2002-11-22 14:59:06 by bitRAKE
Thanks for clearing them out
Posted on 2002-11-22 17:18:55 by LaptoniC