hi
i have this code :
the question is...
at the end of the while ill have a ARRAY like this :?:
tiros[10,9,8,7,6,5,4,3,2,1]
how this will work ?
please can anyone help me ? plz ?
thx im a newbie :)
i have this code :
OBJETO struct
x dd ?
OBJETO ends
.const
MAX equ 10
.data?
tiros OBJ MAX dup(<>)
.code
mov ecx, MAX
mov esi, offset tiros
.while ecx
mov [esi].OBJ.x, ecx
add esi, sizeof OBJ
dec ecx
.endw
the question is...
at the end of the while ill have a ARRAY like this :?:
tiros[10,9,8,7,6,5,4,3,2,1]
how this will work ?
please can anyone help me ? plz ?
thx im a newbie :)
:shock:
no one ??
please ?
no one ??
please ?
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
.endw
oh :-D
thx man
the size of SIZEOF(Objet0) always ahve to be 4 ?
and why its size is 4 ?
thats all :)
thx man
the size of SIZEOF(Objet0) always ahve to be 4 ?
and why its size is 4 ?
thats all :)
its 4 because u defined x as dword - 4 bytes.