i have this code :

OBJETO struct
x dd ?

MAX equ 10

tiros OBJ MAX dup(<>)

mov ecx, MAX
mov esi, offset tiros
.while ecx
mov [esi].OBJ.x, ecx
add esi, sizeof OBJ
dec ecx

the question is...
at the end of the while ill have a ARRAY like this :?:
how this will work ?

please can anyone help me ? plz ?

thx im a newbie :)
Posted on 2005-01-01 09:20:20 by GR33d
no one ??
please ?
Posted on 2005-01-02 14:45:16 by GR33d
Yes, because SIZEOF(Objet0) is 4 and x is at offset 0.

; counter = 10

mov ecx, MAX
; esi points to the first element of the array
mov esi, offset tiros
.while ecx
; set x to counter
; this is equivalent to mov [esi][0]
mov [esi].OBJ.x, ecx
; point to the next element
; this is equivalent to add esi, 4
add esi, sizeof OBJ
; decrement counter
dec ecx
Posted on 2005-01-02 15:25:01 by Dr. Manhattan
oh :-D
thx man

the size of SIZEOF(Objet0) always ahve to be 4 ?
and why its size is 4 ?

thats all :)
Posted on 2005-01-02 15:33:31 by GR33d
its 4 because u defined x as dword - 4 bytes.
Posted on 2005-01-02 15:46:14 by wizzra