All pastes #804865 Raw Edit

Someone

public text v1 · immutable
·published 2007-12-03 21:05 UTC
rendered paste body
;long long int prodEscalarInv(int* A, short* B,ushort n);
global _generica
section .text
_generica:
%define pA [ebp+8]
%define  pB [ebp+12]
%define  n [ebp+16]
%define  lowres [ebp-4]
%define  hires [ebp-8]
push ebp
mov ebp, esp
sub esp,8
push edi
push esi
push ebx
xor ecx,ecx
mov  cx,n
mov edi,pA
mov esi,pB
xor ebx,ebx
xor eax,eax
dec cx
ciclo:
mov ax,[esi+ 2*ecx]
cwde
mov edx,[edi+4*ebx]
imul edx
add lowres,eax
adc hires,edx
inc ebx
dec ecx
cmp ecx,0
jge ciclo
mov edx,hires
mov eax,lowres
pop ebx
pop esi
pop edi
add esp, 8
pop ebp
ret