Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .section .text
- .global vencedor
- vencedor:
- # prologue
- pushl %ebp
- movl %esp, %ebp
- pushl %ebx
- pushl %esi
- pushl %edi
- movl 8(%ebp), %ecx #int *num_inscricao em ecx
- movl 12(%ebp), %edx #unsigned short *resultados em edx
- movl 16(%ebp), %ebx #int n in %ebx
- movl $0, %esi #melhor pontuacao
- movl $0, %edi #numero de inscricao da equipa com melhor pontuacao
- decl %ebx
- for:
- cmpl $0, %ebx
- jl end
- pushl %eax
- pushl %edx
- pushl %ecx
- pushl (%edx,%ebx,2)
- call pontuacao
- addl $4, %esp
- popl %ecx
- popl %edx
- cmpl %eax, %esi
- jg not_highest_yet
- movl %eax, %esi
- movl (%ecx,%ebx,4) ,%edi
- not_highest_yet:
- popl %eax
- decl %ebx
- jmp for
- end:
- movl %edi, %eax
- popl %edi
- popl %esi
- popl %ebx
- # epilogue
- movl %ebp, %esp
- popl %ebp
- ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement