Advertisement
Guest User

Untitled

a guest
Jun 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. .model flat,c
  2.  
  3. printf proto c: vararg
  4.  
  5. .data
  6.  
  7. fmt db "%d",0
  8. fizz db "fizz",0
  9. buzz db "buzz",0
  10. fizzbuzz db "fizzbuzz",0
  11. nl db 0ah,0
  12.  
  13. .code
  14.  
  15. fbz proc
  16. mov ecx,1
  17. loop1:
  18. push ecx
  19. mov eax,ecx
  20. xor edx,edx
  21. mov ebx,15
  22. div ebx
  23. cmp edx,0
  24. jne next1
  25. invoke printf, offset fizzbuzz
  26. jmp newline
  27. next1:
  28. xor edx,edx
  29. mov ebx,5
  30. mov eax,ecx
  31. div ebx
  32. cmp edx,0
  33. jne next2
  34. invoke printf, offset buzz
  35. jmp newline
  36. next2:
  37. xor edx,edx
  38. mov ebx,3
  39. mov eax,ecx
  40. div ebx
  41. cmp edx,0
  42. jne next3
  43. invoke printf, offset fizz
  44. jmp newline
  45. next3:
  46. invoke printf, offset fmt,ecx
  47. newline:
  48. invoke printf, offset nl
  49. pop ecx
  50. inc ecx
  51. cmp ecx,101
  52. jne loop1
  53. ret
  54. fbz endp
  55.  
  56. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement