flat assembler
Message board for the users of flat assembler.
Index
> Windows > API calls |
Author |
|
vid 19 Jul 2006, 07:49
examples are in FASM win32 package
|
|||
19 Jul 2006, 07:49 |
|
revolution 19 Jul 2006, 10:52
Have a look at "BEER.ASM" in the examples. It is short and simple and show the usage of macros to ease the task of API calls.
|
|||
19 Jul 2006, 10:52 |
|
Firefall 19 Jul 2006, 14:46
ThX! I'ma check it out.
Edit: Ok. Quite easy! But what about the included files? How do I know what to include? |
|||
19 Jul 2006, 14:46 |
|
vid 19 Jul 2006, 15:14
include "win32axp.inc" and then you don't have to care what to include.
PS: if you would care to read docs... http://flatassembler.net/docs.php you would see "Win32 headers" as second thing there |
|||
19 Jul 2006, 15:14 |
|
Firefall 19 Jul 2006, 15:25
Yeah but I don't want to include too much. I want my programm to be as small as possible. Sorry for not reading the docs, but I'm absolutely new to FASM and this board... Well I'll have a look at them.
|
|||
19 Jul 2006, 15:25 |
|
okasvi 19 Jul 2006, 16:27
fasm has proper includes, and nothing will be there if not used.
|
|||
19 Jul 2006, 16:27 |
|
Firefall 19 Jul 2006, 17:06
So if I include a whole file and use only one "function" of it, only this function will be imported? Beer.exe is exactly 1024 Bytes big... Is that size normal for the 2 API calls used?!
|
|||
19 Jul 2006, 17:06 |
|
vid 19 Jul 2006, 17:48
yes, exactly.
it's size could be somewhat smaller, but FASM rounds size of PE to nearest higher 512B bound |
|||
19 Jul 2006, 17:48 |
|
Firefall 19 Jul 2006, 20:34
Is that useful?
|
|||
19 Jul 2006, 20:34 |
|
okasvi 19 Jul 2006, 20:45
It's called 'following the standards'.
|
|||
19 Jul 2006, 20:45 |
|
Firefall 19 Jul 2006, 21:16
Oh.Ok! Sorry I do really have no idea about Win32 ASM, EXE-Format and so on. I just wanna do some easy API stuff So when assembling the mentioned example (beer.asm), FASM includes only the things that are ABSOLUTELY necessary and/or standard?
|
|||
19 Jul 2006, 21:16 |
|
okasvi 19 Jul 2006, 21:34
View it with hex-editor, you can see that it's so big because of alignment
|
|||
19 Jul 2006, 21:34 |
|
Firefall 19 Jul 2006, 22:06
All I see is that the actual Code ist at the end of the file. So Header must be very big, huh?!? Could you provide a boolean answer to my question above? ("So when assembling the mentioned example (beer.asm), FASM includes only the things that are ABSOLUTELY necessary and/or standard?")
|
|||
19 Jul 2006, 22:06 |
|
okasvi 19 Jul 2006, 22:14
TRUE
edit: as you can see, there is 3 times blocks of 96bytes nothing but alignment |
|||
19 Jul 2006, 22:14 |
|
RedGhost 20 Jul 2006, 00:15
Firefall you should really read/test for yourself man
_________________ redghost.ca |
|||
20 Jul 2006, 00:15 |
|
vid 20 Jul 2006, 09:07
in small PEs header is 512 bytes (has to be... otherwise it's VERY unstandard), in larger PEs (more than 3 sections) header has 10B
|
|||
20 Jul 2006, 09:07 |
|
Firefall 21 Jul 2006, 09:47
@ RedGhost: As I have already mentioned I have no clue about WinASM, and neither about PE EXE's. It's hard to test things if you don't know Header definitions and OP-Codes. Yeah I could look 'em up. But it'd take me a few days or weeks to find, apply, check. So why not searching the answer there where it already exists, and that's in the brains of you experts. ThX for your help!
|
|||
21 Jul 2006, 09:47 |
|
madmatt 21 Jul 2006, 12:25
Firefall, I wouldn't worry about size when it comes to the includes. The includes you see at the top of an fasm Windows assembly file 95% of the time don't define any data, just constant's used by many of the windows functions. At the bottom of the assembly you find api includes, but even though you include whole api defines, only the ones you use in the program are actually turned into function table data. And, finally, a lot of times you'll see resource data also at the bottom of an assembly file. These almost always produce some kind of data, but, this is what you want in this situation.
Anyways, bottom line is don't waste your time worrying about the size of a file, especially in a windows assembly file (Today's systems have 100's and sometimes thousands of megabytes of memory). Assembly files unoptimized, are in most case's many times smaller than there C/C++ equivalents. Instead, worry about how to speed up critical sections of your code #1, and how to make your program's interface look terrific and user friendly #2, How to comment your code #3, so when you leave your code for a while, and then come back to it later on, you'll have a clue as to what you were doing when you left it (I still need to work on this myself. ) |
|||
21 Jul 2006, 12:25 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.