Hello, how would you pass structure arguments into procs treating the argument just (or similarily) to the structure? Is it even possible?

I don't want to have to do stuff like...

proc struc_test,STRUCTURE
enter
mov dword,23
mov byte,245
return
Posted on 2003-05-06 16:11:32 by CyberGuy
Usually a pointer to the structure is passed to the proc:

Test PROC pStruc:DWORD

mov edx, pStruc

mov .A_Struct.item1, 5
mov .A_Struct.item2, 8
mov .A_Struct.item3, 13
...
Posted on 2003-05-06 16:34:30 by bitRAKE
Yes of course.



test1 proc pStruc:dword
mov eax, [ebp+8]
mov [eax],1 ; first dword of the struct
mov [eax+4],4 ; second dword of the struct
...
ret
test1 endp
Posted on 2003-05-07 02:48:34 by roticv
thanks
Posted on 2003-05-07 14:51:37 by CyberGuy