flat assembler
Message board for the users of flat assembler.
Index
> Windows > [solved] user32.dll, Error illegal instruction |
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' |
|||
27 Feb 2023, 18:03 |
|
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 |
|||
27 Feb 2023, 22:23 |
|
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. |
|||
27 Feb 2023, 22:32 |
|
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. |
|||
27 Feb 2023, 22:37 |
|
Iron-Man 27 Feb 2023, 23:45
Thanks revolution, AsmGuru62 !!
All is working now. |
|||
27 Feb 2023, 23:45 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.