Advertisement
MichaelPetch

SO78838831 - ver1

Aug 6th, 2024
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. Include irvine32.inc
  2.  
  3. ;irvine32.inc already uses this directive for us:
  4. ; .model flat, STDCALL
  5.  
  6. .data
  7. result DWORD ?
  8.  
  9. .code
  10.  
  11. add_func PROC C
  12.  
  13. ; Save the base pointer
  14. push ebp
  15. mov ebp, esp
  16.  
  17. ; Get the arguments
  18. mov eax, [ebp+8] ; a
  19. mov ecx, [ebp+12] ; b
  20.  
  21. ; Add a and b
  22. add eax, ecx
  23.  
  24. ; Store the result in a variable
  25. mov result, eax
  26.  
  27. call WriteInt
  28.  
  29. exit_function:
  30.  
  31. ; Restore the base pointer
  32. pop ebp
  33.  
  34. ; Return the result in EAX
  35. mov eax, result
  36. ret
  37.  
  38. add_func ENDP
  39.  
  40. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement