flat assembler
Message board for the users of flat assembler.
Index
> Windows > Return Value Of Function Goto page 1, 2, 3 Next |
Author |
|
Walter 01 Feb 2017, 04:07
Code: ;****************** ;* FindWindow.asm * ;****************** include 'win32ax.inc' .code start: invoke FindWindow,NULL,"MyFile.txt - Notepad" .if eax <> 0 invoke MessageBox,HWND_DESKTOP,"Window Found!" ,"FindWindow",MB_OK .endif .end start |
|||
01 Feb 2017, 04:07 |
|
revolution 01 Feb 2017, 04:37
You'll need to call ExitProcess also else your code will run off the end and probably crash.
|
|||
01 Feb 2017, 04:37 |
|
Trentie89 01 Feb 2017, 07:32
Thanks heaps guys, but now the compiler seems to have gone nuts, when I copy and paste your code, it says error : illegal instruction .code ( Whats happening ????? ) Thanks so much for your help.
|
|||
01 Feb 2017, 07:32 |
|
revolution 01 Feb 2017, 07:38
Trentie89 wrote: ... but now the compiler seems to have gone nuts, when I copy and paste your code, it says error : illegal instruction .code ( Whats happening ????? ) Thanks so much for your help. revolution wrote: You'll need to call ExitProcess also else your code will run off the end and probably crash. |
|||
01 Feb 2017, 07:38 |
|
Trentie89 01 Feb 2017, 10:26
I'm a bit of a newbie with ASM, I have tried this and it still doesn't work, still says error.
Code: ;****************** ;* FindWindow.asm * ;****************** include 'win32ax.inc' .code start: invoke FindWindow,NULL,"MyFile.txt - Notepad" .if eax <> 0 invoke MessageBox,HWND_DESKTOP,"Window Found!" ,"FindWindow",MB_OK .endif invoke ExitProcess,0 .end start |
|||
01 Feb 2017, 10:26 |
|
revolution 01 Feb 2017, 10:35
Works okay for me in WinXP and Win7
|
|||
01 Feb 2017, 10:35 |
|
Trentie89 01 Feb 2017, 12:42
I'm on Windows 10, is that why it wont work I wonder.?. Look at attached screenshot. Thanks so heaps for helping me btw.[/img]
_________________ I Am the greatest.!. ( NOT YET ). |
||||||||||
01 Feb 2017, 12:42 |
|
revolution 01 Feb 2017, 12:55
Oh, I thought you were talking about runtime errors. You have an assembly time error.
But I can't understand why include would be an illegal instruction? That doesn't make sense to me. Is your fasmw the original .exe? Did you make any changes to it or something? |
|||
01 Feb 2017, 12:55 |
|
system error 01 Feb 2017, 15:50
look at your "fasmw.ini".
Things like these could happen if you unzipped the fasm package at location A, run the FASMW there, and then moving that FASM folder to location B. FASMW.ini is set the first time you open FASMW.exe, that includes setting up the default FASM path where you first run it. Changing the content of .ini file would help. Other than that, you have other problems. Weird problem, I must say. |
|||
01 Feb 2017, 15:50 |
|
revolution 01 Feb 2017, 15:55
system error: If the path is wrong then you still don't get an "illegal instsruction" error. You'd get a "file not found" error.
|
|||
01 Feb 2017, 15:55 |
|
system error 01 Feb 2017, 16:09
@revo Yeah i know that. I was just being general to potential beginners' problems.
This one is weird though. Getting 'illegal instruction' on an include directive is ... just funny. I think he's running a script or something, or even a shortcut with wrong configuration. |
|||
01 Feb 2017, 16:09 |
|
Trentie89 02 Feb 2017, 01:37
Should I download fasm again and unzip it at a new location? I Havent modified anything from memory.
|
|||
02 Feb 2017, 01:37 |
|
Trinitek 02 Feb 2017, 04:07
Trentie89 wrote: Should I download fasm again and unzip it at a new location? I Havent modified anything from memory. |
|||
02 Feb 2017, 04:07 |
|
l_inc 02 Feb 2017, 14:16
Trentie89
If the error persists, would you please zip the source file you're trying to compile and attach it here? _________________ Faith is a superposition of knowledge and fallacy |
|||
02 Feb 2017, 14:16 |
|
Trentie89 03 Feb 2017, 02:05
Hello Guys,
I Tried unzipping fasm to a new location, fresh from my downloaded one. It still says same error. Which file would you like me to zip, the asm file you mean.?. Or my entire fasm file? Thanks so much guys. |
|||
03 Feb 2017, 02:05 |
|
KevinN 03 Feb 2017, 06:52
I haven't used asm or fasm much and in a while but I don't remember ever using double quotes with fasm.. just single quotes
|
|||
03 Feb 2017, 06:52 |
|
zhak 03 Feb 2017, 07:26
Double quotes are OK. Just tried to compile the example as it appears in comments above on Win10 and it's OK. And indeed, after moving fasm dir to another location, I started getting file not found error, but not illegal instruction. My best guess is include directive contains non-latin chars that look like latin
|
|||
03 Feb 2017, 07:26 |
|
revolution 03 Feb 2017, 08:12
zhak wrote: My best guess is include directive contains non-latin chars that look like latin |
|||
03 Feb 2017, 08:12 |
|
revolution 03 Feb 2017, 08:13
Trentie89 wrote: Which file would you like me to zip, the asm file you mean.?. |
|||
03 Feb 2017, 08:13 |
|
Goto page 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.