Advertisement
Guest User

Untitled

a guest
Oct 26th, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. ; preprocessor directives
  2. .586
  3. .MODEL FLAT
  4.  
  5. ; external files to link with
  6.  
  7. ; stack configuration
  8. .STACK 4096
  9.  
  10. ; named memory allocation and initialization
  11. .DATA
  12.  
  13. numberOne DWORD 24 ;18 h
  14. numberTwo DWORD 12 ;c h
  15.  
  16. ; procedure code
  17. .CODE
  18. main PROC
  19.  
  20.  
  21. mov ECX, numberOne
  22. push ecx
  23. mov ecx, numberTwo
  24.  
  25. push ECX
  26.  
  27.  
  28. call myfunction
  29.  
  30.  
  31.  
  32. mov eax, 0
  33. ret
  34. main ENDP
  35.  
  36. myfunction PROC
  37. push ebp
  38. mov ebp,esp
  39. push ebx
  40.  
  41.  
  42. mov eax, [ebp+8]
  43. mov ebx, [ebp+12]
  44.  
  45.  
  46. add eax, ebx
  47.  
  48.  
  49. pop ebx
  50. pop ebp
  51.  
  52. ret
  53. myfunction ENDP
  54. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement