bits 32
segment .text start: enter 0, 0 ; load arguments into registers mov eax, [ebp+16] mov ebx, [ebp+12] mov ecx, [ebp+8] ; initialize the result to 0 mov dword [eax], 0 mov dword [eax+4], 0 mov dword [eax+8], 0 .process: ; process x mov edx, [eax] add edx, [ebx] mov [eax], edx ; process y mov edx, [eax+4] add edx, [ebx+4] mov [eax+4], edx ; process z mov edx, [eax+8] add edx, [ebx+8] mov [eax+8], edx ; iterate add ebx, 12 loop .process ; return leave ret 16 |