flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
sleepsleep 06 Feb 2008, 13:22
benefits = a lot
i like the following style mov eax, address ; address for that variable mov eax, [address] ; value on that address |
|||
![]() |
|
drhowarddrfine 06 Feb 2008, 13:40
For one, MASM only runs on Windows so FASM has an advantage in that alone.
|
|||
![]() |
|
itsnobody 06 Feb 2008, 14:55
FASM is more low-level than MASM and doesn't have any linkers and all that other BS
The benefit is that it's a Flat Assembler |
|||
![]() |
|
dap 06 Feb 2008, 15:35
There is little difference between the basic syntax of these assemblers, which is what you will learn first (you won't need more advanced things like macros).
With MASM you will address global variables like that : Code: mov eax, var And with FASM : Code: mov eax, [var] The assemblers also provide short mnemonics for the FPU which are different. To me these are the main differences a beginner would encounter. You will also learn more about executable files structure when building them with FASM, but it's also more difficult to understand at the begining (you have to create yourself the sections, including the imports one). I would sugget you to first take a look at MASM since its syntax is still the most used nowadays (it is recognized by MSVC++, ICC, GCC and other tools, for example IDA). |
|||
![]() |
|
LocoDelAssembly 06 Feb 2008, 15:42
Quote:
Quickly solvable by "include 'win32ax.inc'", then you use .code, .data, .ends entrypoint, like MASM. |
|||
![]() |
|
rugxulo 08 Feb 2008, 01:28
Unless you're using MASM code in your projects, I'd suggest not to use it. FASM can do pretty much anything you need. See the following links for more details.
Why do you like FASM? http://en.wikipedia.org/wiki/FASM |
|||
![]() |
|
vid 08 Feb 2008, 02:03
big benefit of NASM/FASM/YASM is it's synax, which is quite more logical than MASM/TASM syntax, and much nicer than gas (GNU assembler) syntax.
FASM compared to NASM/YASM: - basic assembly code is pretty much the same + FASM can output executable directly (not THAT important but may help if you can't use linker yet) + FASM has more powerful macrosyntax than NASM/YASM - FASM is written in FASM (self-compiling), so there is no native 64bit version of FASM, and it's seldom included in application package of linux distros. no "apt-get" or "emerge" |
|||
![]() |
|
rugxulo 08 Feb 2008, 02:23
FASM has official syntax-highlighting IDEs w/ itself built-in as well as being faster and smaller than NASM. But NASM supports more object and debug formats (but see OBJCONV) and listing (officially ... at least 1.67.23 supported a hack for that). I think you now need a C99 compiler (e.g. GCC) to make NASM, too (although they do have hacks for OpenWatcom). Oh, and personally, I like FASM only reporting one error at a time (instead of a billion).
GAS supports Intel-style now, but it's one-pass only (I think), so encodings are bigger. Plus, it's kinda goofy. But some people prefer it (e.g. UPX), probably because it's ubiquitous. |
|||
![]() |
|
drhowarddrfine 08 Feb 2008, 03:30
Quote:
I have no problems with it and use it all the time. It's called ATT syntax, btw. Quote:
It's not just one pass so I don't know why encodings would be bigger. Quote:
I think I prefer it, too, but, in any case, I have no problem with it. |
|||
![]() |
|
dap 08 Feb 2008, 20:02
LocoDelAssembly wrote: Quickly solvable by "include 'win32ax.inc'", then you use .code, .data, .ends entrypoint, like MASM. Thanks I didn't know that. BTW .data? and .const are also commonly used with MASM. rugxulo wrote: I think you now need a C99 compiler (e.g. GCC) to make NASM, too (although they do have hacks for OpenWatcom). Note that GCC isn't a C99 compiler yet. |
|||
![]() |
|
LocoDelAssembly 08 Feb 2008, 21:50
Well, for .const you can use this macro
Code: macro .const { section '.const' data readable } As for .data? well that one would be harder but I suggest you using regular .data and make sure that any data definition you do is "?" or any other kind of definition that doesn't defines at any constant. If you have both, initialized and uninitialized data then use a single .data for both but place the initialized data first and the uninitialized data last so the virtual size will be the size of both kind of data but the file size will be only the size of the initialized data. Try to use less sections as possible, only use a different one if you need diferent types of properties (check them at http://flatassembler.net/docs.php?article=manual#2.4.2). Note that actually you can have only one section and use it for all, but since that would make all bytes readable, executable and writable perhaps you will like to use separated sections (and maybe some anti-virus will mark you executable as virus for being so unconventional for having one section). I hope I have not confused you much ![]() |
|||
![]() |
|
rugxulo 13 Feb 2008, 04:18
dap wrote:
No, it's not complete yet, but what parts it does have implemented are now (mostly?) required to build the latest NASM. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.