flat assembler
Message board for the users of flat assembler.
Index
> Windows > How to use library with include 'win***x.inc'??? |
Author |
|
revolution 08 Feb 2017, 01:15
AFAICT you can't add arbitrary libraries when using the standard .end macro.
You can write a custom .end macro of your own design. Then you don't have to edit any of the files that come in the fasm download. |
|||
08 Feb 2017, 01:15 |
|
Estece 08 Feb 2017, 01:48
I know You are professional but understanding assembly is hard for starters.
Writing a macro is harder than using it. Your's answer approves that standard .end macro is useless for people who want use macros for easy approach. I know that i can write a custom macro. For now i'm grasping x86_64 assembly , opengl api , windows x64 calling conversion and You want me to start understanding fasm macro preprocessor on top off that!?! Do i have to always rewrite the .end macro when i add other library? What this macro code do??? ... import_kernel32 import_user32 import_gdi32 import_advapi32 import_comctl32 import_comdlg32 import_shell32 import_wsock32 all_api ... |
|||
08 Feb 2017, 01:48 |
|
revolution 08 Feb 2017, 02:43
If you need to import libraries not normally included with the usual .end macro then you will need to make your own set of imports.
This can be a macro, or can can simply be put into your code directly, the end result is the same. The examples included in the fasm download show various ways of making import sections. Ranging form completely manually all the way up to using just the high level macros. Note that the code you show above are also just macros defined in another file. The .end macro really just includes other macros. Which in turn might include other macros. And so on until you finally get to the real bytes. It's turtles all the way down. |
|||
08 Feb 2017, 02:43 |
|
Estece 08 Feb 2017, 04:32
Quote: 'AFAICT you can't add arbitrary libraries when using the standard .end macro. Quote: ...make your own set of imports. This can be a macro, or can can simply be put into your code directly, the end result is the same.' No , i can't do it without rewriting useless 'win***x*.inc' group of files. If i put it directly then it doesn't work because library macro don't work. Yours 2nd answer is bad because you said it already that i need to write own macro. This is the same as 1st answer but expressed in other words. Is there more useless macros that conflict with each other?!? I'm looking for easy approach such as invoke macro or .if macro. Various ways shown in examples don't resolve my problem here when i want to use standard .end macro without knowledge of it's internal workings and add non standard library. Why i have to have knowledge of all the default macros, if the purpose of this .end macro is to simplify my coding experience as manual says or i'm missing something and there is example to use .end macro with non standard library??? |
|||
08 Feb 2017, 04:32 |
|
revolution 08 Feb 2017, 06:29
The unaltered .end macro won't include other libraries for you. And you can't add libraries one by one with the current default set of macros. So the only answer here it to modify something somewhere. And usually the thing you need to alter is a macro because that would be the easiest place to do it. There really isn't another answer.
There are many examples already on this board of people wanting to include the MSVCRT labrary (to access printf there) and you will see that they also have to make their own import section in some way. Perhaps you can search for some of those examples and see if one of those methods is going to work for you. |
|||
08 Feb 2017, 06:29 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.