Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % include "util.nasm"
- section .data
- V dw 2,4,11,4,8,12,14,1
- n equ ($-V)/2
- section.bss
- T resid 1
- section.text
- extern proc
- global _start
- _start:
- push dword n
- push V
- call proc
- xor esi,esi
- %include"util.nasm"
- section.data
- V.equ 8
- T equ 12
- n equ 16
- section.text
- global proc
- proc:
- push ebp
- mov ebp,esp
- pushad
- mov eax,[ebp+V]
- mov ebx,[ebp+T]
- mov edi,[ebp+n]
- xor esi,esi
- ciclo_1:
- cmp esi,edi
- jge .esci
- mov cx,[eax+2*esi]
- TEST cx,1
- jnz inc esi
- inc esi
- jmp .ciclo_2
- ciclo_2:
- cmp esi, edi
- jge . esci
- mov dx,[eax+2*esi]
- and dx, 3
- jnz.ciclo
- inc esi
- inc ebx
- .esci:
- popad
- mov esp, ebp
- pop ebp
- ret 16
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement