Created
December 23, 2024 12:49
-
-
Save ryonagana/a4d0b832caec1880c48bbe27c6b791ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
format PE console 4.0 | |
entry start | |
include 'win32a.inc' | |
section '.data' data readable writeable | |
_fmt db "%s",0 | |
num1 dd 0 | |
num2 dd 0 | |
res dd 0 | |
_result db "Resultado soma: %d",10,0 | |
system_pause db "pause",0 | |
section '.text' code readable executable | |
start: | |
push ebp | |
mov ebp, esp | |
push num1 | |
push _fmt | |
call [scanf] | |
push num2 | |
push _fmt | |
call [scanf] | |
mov eax, [num1] | |
mov eax,eax | |
invoke printf,_fmt,num2 | |
push system_pause | |
call [system] | |
call exit_prg | |
ret | |
exit_prg: | |
push 0 | |
call [ExitProcess] | |
section '.idata' import data readable writeable | |
library kernel, 'KERNEL32.DLL',\ | |
msvcrt,'MSVCRT.DLL' | |
import kernel,\ | |
ExitProcess,'ExitProcess' | |
import msvcrt,\ | |
scanf,'scanf',\ | |
printf,'printf',\ | |
system,'system' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment