flat assembler
Message board for the users of flat assembler.
Index
> Windows > [solved] Call a function add two numbers |
| Author |
|
|
frankobach26 12 May 2026, 17:27
New edit: I have found my correct solution:
WsprintfA Code: format PE64 GUI entry start include 'win64ax.inc' section '.data' data readable writeable text db 'Ergebnis: %d',0 title db 'calculation OK',0 buffer db 64 dup(0) section '.text' code readable executable start: sub rsp, 28h call pobamain invoke ExitProcess, 0 pobamain: sub rsp, 28h call AddNumbers ; RAX = Ergebnis ; wsprintfA(buffer, text, eax) invoke wsprintfA, buffer, text, eax invoke MessageBoxA, 0, buffer, title, MB_OK add rsp, 28h ret AddNumbers: mov rax, 5 add rax, 7 ret section '.idata' import data readable writeable library kernel32,'KERNEL32.DLL',\ user32,'USER32.DLL' import kernel32,\ ExitProcess,'ExitProcess' import user32,\ MessageBoxA,'MessageBoxA',\ wsprintfA,'wsprintfA' |
|||
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2026, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.