flat assembler
Message board for the users of flat assembler.
Index
> Windows > How to create a 'hello world' without include files? |
Author |
|
Tomasz Grysztar 29 May 2006, 19:30
The package of fasm for Windows contains the PEDEMO example that doesn't use Win32 headers.
|
|||
29 May 2006, 19:30 |
|
saigon 29 May 2006, 19:53
Thanks for pointing me to it Tomasz. I like this product much more
I used to use Turbo Assembler (TASM) from Borland, but it's very expensive and doesn't even have it's own IDE. FASM is free and is by far better than TASM. I am really impressed of this compiler. I hope to program some good and useful programs using FASM. I'm looking forward to this project. Thanks! |
|||
29 May 2006, 19:53 |
|
blacky 29 May 2006, 20:29
Quote: I used to use Turbo Assembler (TASM) from Borland, but it's very expensive and doesn't even have it's own IDE. Theres always the RadASM IDE that supports the tasm assembler but i would still stick to fasm.. it rox.. |
|||
29 May 2006, 20:29 |
|
saigon 30 May 2006, 05:50
I have some questions concerning the PEDEMO included with FASM.
1: If I specify an import to one of my own made DLLs, does the user have to include my DLL along with the executable package? 2: How do I optimize this import data section to the minimum? Code: section '.idata' import data readable writeable dd 0,0,0,RVA kernel_name,RVA kernel_table dd 0,0,0,RVA user_name,RVA user_table dd 0,0,0,0,0 kernel_table: ExitProcess dd RVA _ExitProcess dd 0 user_table: MessageBox dd RVA _MessageBoxA dd 0 kernel_name db 'KERNEL32.DLL',0 user_name db 'USER32.DLL',0 _ExitProcess dw 0 db 'ExitProcess',0 _MessageBoxA dw 0 db 'MessageBoxA',0 I want to have a very small footprint on my applications, so that I ensure there is speed and compactness. 3. I also want to ask, do I have to include the empty fixups data section (.reloc) ? Thank you very much! |
|||
30 May 2006, 05:50 |
|
Reverend 30 May 2006, 15:35
1. Such DLL will have to be in program directory or SYSTEM32 directory
2. It cannot be smaller 3. No, you don't have to. .reloc section is not needed in .exe files (but DO NOT rip it off when coding a DLL) |
|||
30 May 2006, 15:35 |
|
saigon 30 May 2006, 15:57
Thanks for the information!
Could someone explain me how RVA works? I don't fully understand the import data section I posted above. Also, I want to ask if it's possible to create a static lib using FASM only. Does anyone have examples? Thanks! |
|||
30 May 2006, 15:57 |
|
Quantum 31 May 2006, 03:09
2 Reverend:
Quote:
Or in the current directory, or in the Windows direcory, or in the directories that are listed in the PATH environment variable. Quote:
Try stripping the .DLL extension (XP only) Try using ordinals (only for a particular DLL version) For speed optimization try using DLL binding. 2 saigon: Quote:
A static lib is just a container for object files. MS link.exe produces such files. If you have a single object file, there's little sense to make a lib for it. BTW, you'd better take a look at a topic down there about a couple of bugs in PEDEMO example. |
|||
31 May 2006, 03:09 |
|
saigon 31 May 2006, 05:53
OK, thanks for the info. I guess I'll make a MS COFF program in FASM and link it to a static lib. The PE GUI format makes everything a bit harder to understand and when I use MS COFF, I can use a more dedicated set of functions.
Thanks again! |
|||
31 May 2006, 05:53 |
|
Reverend 31 May 2006, 19:11
Quantum: 1 - yes, I simplified it a bit . Of course you're right.
2 - I didn't mention such methods as they will make executable not work on every version of indows saigon: Just compile how many MS COFFs you need, and then use lib.exe from masm package (or polib from pelles compilation of tools). Usage: lib.exe *.obj /out:name.lib |
|||
31 May 2006, 19:11 |
|
Quantum 31 May 2006, 22:51
2 Reverend:
Quote:
But it's very useful when binding your own DLLs. Significant speed and a little size improvements obtained. "Remove Fatty Deposits from Your Applications Using Our 32-Bit Liposuction Tools" by Matt Pietrek: http://www.microsoft.com/msj/archive/S572.aspx A bit out of date but not yet obsolete 2 saigon: Quote:
FASM gives you much more control than any other assembler (well, nasm rules too). You can layout the import in a separate section, inside your data/code section or even spread it all over your PE32 file, if you like. That's a very useful feature in some cases. |
|||
31 May 2006, 22:51 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.