flat assembler
Message board for the users of flat assembler.
Index
> Windows > Compiling error |
Author |
|
revolution 12 Dec 2008, 06:24
Please post your code. It is very hard to help you without code to refer to.
Do you have any "include" statements in the source? Perhaps your source tries to include other files? |
|||
12 Dec 2008, 06:24 |
|
greeneyehawk13 12 Dec 2008, 06:25
oh, I took code from an example just so I could get used to compiling things with flat assembler. Here it is (oh, if this helps, I have windows vista):
; example of simplified Win32 programming using complex macro features include 'win32ax.inc' .code start: invoke MessageBox,HWND_DESKTOP,"Hi! I'm the example program!","Win32 Assembly",MB_OK invoke ExitProcess,0 .end start |
|||
12 Dec 2008, 06:25 |
|
revolution 12 Dec 2008, 07:17
You need to set your "include=" environment variable. It is described in the manual. Just set the path to where you have put fasm. e.g. "include=c:\mystuff\fasm\include"
|
|||
12 Dec 2008, 07:17 |
|
asmcoder 12 Dec 2008, 11:21
[content deleted]
Last edited by asmcoder on 14 Aug 2009, 14:54; edited 1 time in total |
|||
12 Dec 2008, 11:21 |
|
revolution 12 Dec 2008, 13:34
asmcoder wrote: first of all, dont use exit process. on stack you have return address to ExitThread, eax pass return code. asmcoder wrote: Second, try to use orginal function names. Not MessageBox, but MessageBoxA/MessageBoxW. Thats very important, you will have problems in future. asmcoder wrote:
|
|||
12 Dec 2008, 13:34 |
|
vid 12 Dec 2008, 13:56
Quote: first of all, dont use exit process. on stack you have return address to ExitThread, eax pass return code. Why not? Use ExitProcess if it is more convient for you than returning from the entry point function. Quote: this is a relative path to file. fasm will default search it in his directory. change it to ./includes/win32ax.inc or smth like this. Actually, intended solution is to set up environment variable "INCLUDE" (i think, not sure) to point to INCLUDES directory in FASM directory. Whenever FASM searches for file, it looks to directory pointed by "INCLUDE" env var. |
|||
12 Dec 2008, 13:56 |
|
baldr 12 Dec 2008, 17:01
asmcoder,
ret is not enough, because ExitThread() is not. See below. revolution & vid, ret was useful some time ago (SP1?); now WMI injects some thread (MessageBox() is enough to activate this behaviour, may be it's some user32/gdi32 statistics?) which will not die after your ExitThread(), so the process will remain alive. ExitProcess() will do the trick. _________________ "Don't belong. Never join. Think for yourself. Peace." – Victor Stone. |
|||
12 Dec 2008, 17:01 |
|
LocoDelAssembly 12 Dec 2008, 17:32
baldr, do you mean ANY executable that calls MessageBox()?
The following code under a WinXP (SP3, 32-bit) ends and the process disappears from the task manager's process list: Code: include 'win32axp.inc' .code start: invoke MessageBox, 0, "testing", "testing", 0 ret .end start It is a bad idea to use RET anyway of course and these are the results of the scenario that baldr comments: Code: include 'win32axp.inc' .code start: invoke CreateThread, NULL, 0, threadProc, NULL, 0, dummy ret ; invoke ExitProcess, 0 threadProc: invoke Sleep, 60000 ; Process die after 1 minute invoke ExitThread, 0 .data dummy dd ? .end start A DLL hook could create a thread so it is important to not assume the inexistence of threads other than those created by you. If I remember right GDIplus creates a thread so OS-provided DLLs are on the list of possible threads creators too. |
|||
12 Dec 2008, 17:32 |
|
baldr 12 Dec 2008, 18:03
LocoDelAssembly,
I'll try to reproduce that, I have backups. I'd discovered that while experimenting with macros and simple WndProc. Compiled, run, tried to compile again… no access… found it still running some evil thread started from WmipXXX() ;-( Did I said that I hate anything that does something on my behalf and doesn't clean up after itself? _________________ "Don't belong. Never join. Think for yourself. Peace." – Victor Stone. |
|||
12 Dec 2008, 18:03 |
|
asmcoder 12 Dec 2008, 19:58
[content deleted]
Last edited by asmcoder on 14 Aug 2009, 14:54; edited 1 time in total |
|||
12 Dec 2008, 19:58 |
|
LocoDelAssembly 12 Dec 2008, 20:17
Quote:
All the run-time libraries must be in a mistake then, even those provided by Microsoft. Microsoft must have written the documentation wrong too. What an idiots, I will tell them they must contact you so they can learn something. Quote:
And how could it know you want to end the process? |
|||
12 Dec 2008, 20:17 |
|
asmcoder 12 Dec 2008, 21:25
[content deleted]
|
|||
12 Dec 2008, 21:25 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.