OK this can be preaty lame question but. I have got structure with qwords ...... zzzz

just look at this:

mov .iloscMat,eax
mov .SumaN,qword ptr 0 <--- it's not working of course but i need something like this
Posted on 2004-03-20 18:22:18 by AceEmbler
mov dword ptr [edx].SumaN+00h, 0

mov dword ptr [edx].SumaN+04h, 0
Posted on 2004-03-20 18:23:13 by comrade
thanks Comrade.

i shouldnt work that late :sweat:
Posted on 2004-03-20 18:30:18 by AceEmbler
A more space efficient solution would be:
fld0
fistp qword ptr .SumaN
Posted on 2004-03-20 18:45:37 by Sephiroth3
And more efficiently,
fldz

fstp qword ptr [edx].SumaN
More efficient because the FPU doesn't have to go through the process of converting from a float to an integer. In this case, it would still be the same 0 getting into memory.

Raymond
Posted on 2004-03-20 21:54:41 by Raymond
how about:
pxor MM0, MM0

movq [edx].SumaN, MM0


also its debatable if that FPU code is indeed faster than the two dword moves :)
Posted on 2004-03-20 22:41:04 by comrade
On Northwood, the two dword moves take one tickless than the FPU and MMX ones.

I tested like so:
mov     ebx,OFFSET shit


mov ecx,[rounds]
.next: rdtsc
mov esi,eax
mov edi,edx

;mov dword [ebx+00h],0
;mov dword [ebx+04h],0

;fldz
;fstp qword [ebx]

pxor MM0,MM0
movq [ebx],MM0

rdtsc
add esi,54h
sub eax,esi
sbb edx,edi
add dword [sum+00h],eax
add dword [sum+04h],edx
loop .next

mov edx,dword [sum+04h]
mov eax,dword [sum+00h]
div [rounds]

showhex "ticks",eax

sum dq 0
rounds dd 1000h
shit dq 0
Posted on 2004-03-20 22:54:11 by comrade
blah... damn typos :P
Posted on 2004-03-21 11:04:52 by Sephiroth3