Gravatar Avatar

Untitled

By: a guest on December 23, 2015  |  syntax: HTML4STRICT  |  size: 1.0 KB  |  hits: 60  |  expires: never
download  |  raw  |  embed  |  report abuse
Copied
  1. .686
  2. .model flat, STDCALL
  3. option casemap :none
  4.  
  5. include C:\\masm32\\include\\windows.inc
  6. include C:\\masm32\\include\\masm32rt.inc
  7. include C:\\masm32\\include\\kernel32.inc
  8.  
  9. includelib C:\\masm32\\lib\\masm32.lib
  10. includelib C:\\masm32\\lib\\kernel32.lib
  11. includelib C:\\masm32\\lib\\msvcrt.lib
  12.  
  13. .CONST
  14. NextLine DB \' \',13,10,0
  15. Format DB \"%d\\n\", 0
  16. c_num_1 DD 5
  17. c_num_2 DD 0
  18. c_num_3 DD 1
  19.  
  20. .DATA
  21. dD1 DD 5
  22. bB1 DD 1
  23. aA1 DD 0
  24.  
  25. .DATA?
  26. mY1 DB 100 Dup(?)
  27. cC1 DD ?
  28.  
  29. .CODE
  30. Main:
  31. xor eax, eax
  32. xor ebx, ebx
  33. xor ecx, ecx
  34. xor edx, edx
  35. invoke crt_scanf, addr Format, addr cC1
  36. invoke crt_scanf, addr Format, addr mY1
  37. RLabel_0:
  38. mov eax, aA1
  39. mov edx, dD1
  40. cmp eax, edx
  41. jge RLabel_1
  42. push dD1
  43. push c_num_3
  44. pop ecx
  45. pop ebx
  46. xchg ecx, eax
  47. sub ecx, ebx
  48. xchg eax, ecx
  49. mov dD1, ecx
  50.  
  51. push aA1
  52. push cC1
  53. pop ecx
  54. pop ebx
  55. xchg ecx, eax
  56. add ebx, eax
  57. xchg eax, ecx
  58. mov aA1, ecx
  59.  
  60. jmp RLabel_0
  61. RLabel_1:
  62. invoke StdOut, addr mY1
  63. printf(\"%d\\n\", aA1)
  64.  
  65. invoke ExitProcess, 0
  66. end Main
RAW Paste Data