Advertisement
MichaelPetch

SO 78380985

Apr 24th, 2024
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. .386
  2. .model flat, stdcall
  3. .stack 4096
  4. ExitProcess proto, dwExitCode:dword
  5. include Irvine32.inc
  6.  
  7. .data
  8. num1 dword 2
  9.  
  10. .code
  11. modify PROC var : DWORD
  12. mov eax, [var]
  13. mov DWORD PTR [eax], 6
  14. ret
  15. modify endp
  16.  
  17. main proc
  18. ; Call modify and pass the address of num1
  19. invoke modify, addr num1
  20.  
  21. ; Print the updated value directly from num1
  22. mov eax, num1 ;Error, after the function call, num1 doesn't have the updated value of 6
  23. call WriteDec
  24. call Crlf
  25.  
  26. invoke ExitProcess, 0
  27. main endp
  28.  
  29. end main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement