Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. .386
  2. .model flat, stdcall ;32 bit memory model
  3. option casemap :none ;case insensitive
  4.  
  5. include \masm32\include\windows.inc
  6. include \masm32\include\kernel32.inc
  7. include \masm32\include\masm32rt.inc
  8.  
  9. includelib \masm32\lib\kernel32.lib
  10.  
  11. .data
  12. chaine db "Bonjour",0 ; Chaine à répéter
  13. crlf db 10,0 ; Retour chariot
  14. count db 0 ; Compteur initialisé à 0
  15. .data?
  16. asked_value db (?) ; Valeur rentrée par l'utilisateur
  17. .const
  18.  
  19. .code
  20.  
  21. start:
  22.  
  23. demande: invoke StdIn, addr asked_value, 8
  24. invoke atodw, addr asked_value
  25.  
  26. cmp eax, 0
  27. jbe demande
  28.  
  29. mov asked_value, al
  30.  
  31. boucle:
  32. invoke StdOut, addr chaine
  33. invoke StdOut, addr crlf
  34. inc count
  35.  
  36. mov bl, count
  37. cmp bl, asked_value
  38. mov count, bl
  39.  
  40. jb boucle
  41.  
  42. invoke StdOut, addr crlf
  43. invoke StdOut, addr crlf
  44. inkey
  45.  
  46. push 0
  47. call ExitProcess
  48.  
  49. end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement