flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
AsmGuru62 27 Feb 2023, 18:03
Your code missed something:
Code: section '.idata' import data readable writeable library kernel, 'kernel32.dll',\ ; <--- SLASH IS NOT THERE! user, 'user32.dll' Also, it is much easier to use invoke macro-extension provided by FASM: Code: include 'win32a.inc' format PE GUI entry _start section '.text' code readable executable _start: invoke MessageBox, 0, message, title, 0 invoke ExitProcess, 0 section '.data' data readable writeable message db 'Hello from FASM!', 0x00 title db 'Hello!', 0x00 section '.idata' import data readable writeable library kernel, 'kernel32.dll',\ user, 'user32.dll' import kernel,\ ExitProcess, 'ExitProcess' import user,\ MessageBox, 'MessageBoxA' |
|||
![]() |
|
Iron-Man 27 Feb 2023, 22:23
Hello AsmGuru62 !
Your code works perfect. I made the change to my code but it now reports, Error: write failed. Any ideas? Thanks |
|||
![]() |
|
revolution 27 Feb 2023, 22:32
Windows will lock all executable files that are running.
You need to find the existing task, and close/exit/kill it. |
|||
![]() |
|
AsmGuru62 27 Feb 2023, 22:37
Iron-Man: you should post the code change you did.
Usually, "write failed" happens if your code never calls ExitProcess function. Basically, the previous version of your EXE is still running, as revolution mentioned. |
|||
![]() |
|
Iron-Man 27 Feb 2023, 23:45
Thanks revolution, AsmGuru62 !!
All is working now. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.