Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .model flat,c
- printf proto c: vararg
- .data
- fmt db "%d",0
- fizz db "fizz",0
- buzz db "buzz",0
- fizzbuzz db "fizzbuzz",0
- nl db 0ah,0
- .code
- fbz proc
- mov ecx,1
- loop1:
- push ecx
- mov eax,ecx
- xor edx,edx
- mov ebx,15
- div ebx
- cmp edx,0
- jne next1
- invoke printf, offset fizzbuzz
- jmp newline
- next1:
- xor edx,edx
- mov ebx,5
- mov eax,ecx
- div ebx
- cmp edx,0
- jne next2
- invoke printf, offset buzz
- jmp newline
- next2:
- xor edx,edx
- mov ebx,3
- mov eax,ecx
- div ebx
- cmp edx,0
- jne next3
- invoke printf, offset fizz
- jmp newline
- next3:
- invoke printf, offset fmt,ecx
- newline:
- invoke printf, offset nl
- pop ecx
- inc ecx
- cmp ecx,101
- jne loop1
- ret
- fbz endp
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement