I'm trying to add 4 numbers to other 4 numbers in assembly language with SSE2 instructions, using XMM registers. I did succeed, but I came over something I didn't understand. If I do the addition this way:
movdqu xmm0, oword [var1]
movdqu xmm1, oword [var2]
paddd xmm0, xmm1
movdqu oword [var1], xmm0
It works perfectly fine.
But if I try it this way:
movdqu xmm0, oword [var1]
paddd xmm0, oword [var2]
movdqu oword [var1], xmm0
It gives me a segmentation fault.
What is wrong with the second way of doing it? I'm using Nasm, Intel Atom N270, Linux Mint 12 32-bit