DisplayMessageBox extern Import external symbols Start: call. 2 constants ORed together call MessageBoxAĬmp RAX, IDNO Check the return value for "No" je. DisplayMessageBox: xor ECX, ECX 1st parameter lea RDX, 2nd parameter lea R8, 3rd parameter mov R9D, MB_YESNO | MB_DEFBUTTON2 4th parameter. Mov qword, RAX sub RSP, 32 + 8 + 8 Shadow space + 5th parameter + align stack to a multiple of 16 bytes mov RCX, qword 1st parameter lea RDX, 2nd parameter mov R8, MessageLength 3rd parameter mov qword, NULL 5th parameter Message Box, 64 bit. text Code segment Start: sub RSP, 8 Align the stack to a multiple of 16 bytes mov ECX, STD_OUTPUT_HANDLE ![]() ![]() MessageLength EQU $-Message Address of this line ($) - address of Message section. Message db "Console Message 64", 0D h, 0A h STD_OUTPUT_HANDLE EQU - 11 extern GetStdHandle Import external symbols global Start Export symbols. ![]() Highlight.asm-nasm Example file for nasm.xml kate syntax file compile with `nasm example.asm -f elf -o example.o` and link with 'gcc example.o -o example` Public domain kate: hl Intel x86 (NASM) section.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |