Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .text
- .align 4
- .globl procesar
- .type procesar, @function
- procesar:
- pushl %ebp
- movl %esp, %ebp
- subl $16, %esp
- pushl %ebx
- pushl %esi
- pushl %edi
- # Aqui has de introducir el codigo
- xorl %edi, %edi # edi <- i = 0
- movl 16(%ebp), %esi # esi = N
- imul %esi, %esi # esi = N*N
- movl 8(%ebp), %ecx # ecx = *mata
- movl 12(%ebp), %edx # edx = *matb
- #for 0 -> n^2
- bucle:
- cmpl %esi, %edi
- jge fifor
- movdqu (%ecx, %edi), %xmm0
- paddb %xmm0, %xmm0 # mata[i*n+j]*2
- paddb %xmm0, %xmm0 # mata[i*n+j]*4
- paddb %xmm0, %xmm0 # mata[i*n+j]*8
- paddb %xmm0, %xmm0 # mata[i*n+j]*16
- movdqu %xmm0, (%edx, %edi) # matb[i*n+j] <- mata[i*n+j]*16
- addl $16, %edi #add 16
- jmp bucle
- fifor:
- # El final de la rutina ya esta programado
- emms # Instruccion necesaria si os equivocais y usais MMX
- popl %edi
- popl %esi
- popl %ebx
- movl %ebp,%esp
- popl %ebp
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement