I kinda like to use a little pattern for structures. I use ecx for the struct pointer, eax for the data, and if need be (ie, for a 2nd struct) I keep edx in reserve.
So the proc might go like so:
So the proc might go like so:
Code: |
Function proc structaddr:DWORD mov ecx, structaddr mov eax, FirstElementVal mov [ecx].STRUCTURE.member, eax add ecx, SIZEOF DWORD mov eax, SecondElementVal mov [ecx].STRUCTURE.member, eax ; and so on ret Function endp |