flat assembler
Message board for the users of flat assembler.
Index
> Main > Agner Fog's OBJCONV |
Author |
|
DOS386 16 Jun 2009, 11:43
http://www.agner.org/optimize/#objconv
2.08 released, what's new (not sure in what version exactly, but it is in 2.08 and was not in cca 2.02 some months ago) - Added support of NASM syntax into the disassembler YES it works (tested on a 32-bit PE DLL), the output is NASM syntax, has labels instead of absolute addresses, has function names, has data separated from code, works in DOS and ... haven't tried to recompile the output yet Code: Object file converter version 2.08 for x86 and x86-64 platforms. Copyright (c) 2008 by Agner Fog. Gnu General Public License. Usage: objconv options inputfile [outputfile] Options: -fXXX[SS] Output file format XXX, word size SS. Supported formats: PE, COFF, ELF, OMF, MACHO -fasm Disassemble file (-fmasm, -fnasm, -fyasm, -fgasm) -dXXX Dump file contents to console. Values of XXX (can be combined): f: File header, h: section Headers, s: Symbol table, r: Relocation table, n: string table. -xs Strip exception handling info and other incompatible info. -xp Preserve exception handling info and other incompatible info. -nu change symbol Name Underscores to the default for the target format. -nu- remove Underscores from symbol Names. -nu+ add Underscores to symbol Names. -nd replace Dot/underscore in nonstandard section names. -nr:N1:N2 Replace symbol Name N1 with N2. -ar:N1:N2 make Alias N2 for existing public name N1. -np:N1:N2 Replace symbol Prefix N1 with N2. -nw:N1 make public symbol Name N1 Weak (ELF and MAC64 only). -nl:N1 make public symbol Name N1 Local (invisible). -lx eXtract all members from Library. -lx:N1:N2 eXtract member N1 from Library to file N2. -ld:N1 Delete member N1 from Library. -la:N1:N2 Add object file N1 to Library as member N2. Alternative: -lib LIBRARYNAME OBJECTFILENAMES. -vN Verbose options. Values of N: 0: Silent, 1: Print file names and types, 2: Tell about conversions. -wdNNN Disable Warning NNN. -weNNN treat Warning NNN as Error. -wex: treat all warnings as errors. -edNNN Disable Error number NNN. -ewNNN treat Error number NNN as Warning. -h Print this help screen. @RFILE Read additional options from response file RFILE. Example: objconv -felf32 -nu filename.obj filename.o -fasm brews MASM syntax, as well as -fmasm and -ftasm -fnasm and -fyasm brew NASM syntax -fgasm reportedly GAS INTEL similar to TASM IDEAL syntax -ffasm for FASM syntax is not supported Possibly the most promising disassembler for other-than-DOS-COM stuff. Haven't tried the object conversion, but I doubt it will bypass FASM's lack of OMF output for 16-bit programming (and I don't really need it anyway ). |
|||
16 Jun 2009, 11:43 |
|
bitRAKE 17 Jun 2009, 05:24
IMHO, only assembly language programmers like FASM. The other assemblers are only used by HLL programmers who dabble in asm. So, they want something written in a HLL, and designed specifically for HLL programmers (i.e. mirrors HLL coding constructs).
|
|||
17 Jun 2009, 05:24 |
|
DOS386 17 Jun 2009, 08:32
> Why don't people like Fasm or is it just unpopular?
> It's much better than Nasm, at least how it was back then > when I checked it. The syntax is both more clear and > much more powerful... Contact Agner Fog > Is the output compatible with Fasm at least? The NASM syntax is much better now. > Does it even compile with Fasm? Disassembled code might not compile well even if syntax matches well. Also the comments generated by OBJCONV are usually not as smart as those in original source. |
|||
17 Jun 2009, 08:32 |
|
Japheth 17 Jun 2009, 11:33
bitRAKE wrote: IMHO, only assembly language programmers like FASM. The other assemblers are only used by HLL programmers who dabble in asm. Maybe true! But what are your "results" in assembly so far? Or - since I happen to know that you're used to switch your favorite assembler frequently - you probably think that for true assembly language programmers like you "the way is the goal"? |
|||
17 Jun 2009, 11:33 |
|
Madis731 17 Jun 2009, 13:01
Why so offensice Japheth? To the others, just contact Agner, maybe he just forgot...
|
|||
17 Jun 2009, 13:01 |
|
Raedwulf 17 Jun 2009, 17:21
nasm is more portable in the sense its written in C, so its not as architecture dependent.
|
|||
17 Jun 2009, 17:21 |
|
Borsuc 17 Jun 2009, 22:52
Japheth wrote: Maybe true! But what are your "results" in assembly so far? Or - since I happen to know that you're used to switch your favorite assembler frequently - you probably think that for true assembly language programmers like you "the way is the goal"? Fasm is much more powerful in its macro capabilities and multi-pass assembling, that's all I'm saying. _________________ Previously known as The_Grey_Beast |
|||
17 Jun 2009, 22:52 |
|
bitRAKE 18 Jun 2009, 02:39
Japheth wrote:
(You are one of the few exceptions to my humble opinion - only a fool attempts to generalize.) _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
18 Jun 2009, 02:39 |
|
bitRAKE 18 Jun 2009, 02:54
Raedwulf wrote: nasm is more portable in the sense its written in C, so its not as architecture dependent. Who? Aliens want to program in x86 - how cool! _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
18 Jun 2009, 02:54 |
|
revolution 18 Jun 2009, 03:01
bitRAKE wrote: Someone needs to program in x86 assembler from another architechture, why? |
|||
18 Jun 2009, 03:01 |
|
Borsuc 18 Jun 2009, 20:56
Platform? FASM works in Windows, DOS and Linux. If you can't get one of these, use a virtual machine to compile
|
|||
18 Jun 2009, 20:56 |
|
vid 23 Jun 2009, 12:47
Quote: Why don't people like Fasm or is it just unpopular? It's much better than Nasm, at least how it was back then when I checked it. The syntax is both more clear and much more powerful... Problems of syntax: - (major) No simple preprocess-time #ifdef, #elseif, #else, #endif. - (mild) lack of string handling by preprocessor - (minor) lack of inline macros - (minor) unusual (even though very powerful) macro system - (major/minor, depends on POV) lack of built-in HLL features like MASM Problems of assembler: - (cruical) command line params not available by default until very recently - (mild) written in Asm, eg. not portable over architectures and must be self-compiled - (major) no official support in linux package systems (has a bit to do with previous point as well) Reason for many of previous points is that FASM is more a Tomasz's hobby project than a serious "industrial" assembler, and as such, given its limitation, you hardly can expect someone to use it in serious big project. PS: Of course I acknowledge vast amount of features that FASM has better than all other ASMs, that is another reason why I think it is such a shame there is no FASM clone done "properly" (eg. as usual in industry). |
|||
23 Jun 2009, 12:47 |
|
edfed 21 Sep 2011, 13:07
the opcode traduction part of disassembly cannot be so complicated, as the CPU does it naturally, it can be possible i think to do a simple function
disasm(bin_input,file_output) and of course, a simple function asm(file_input,bin_output) after, if we develop around these functions, it can be possible to do a very smart disassembler. if the disasm is like fasm, it will be powerfull, and able to generate a flat source code from a binary file, even if not executable or if not with the correct extension, because it will just take the executable or binary as a flat file, and output a source as a flat file. the hard thing i think is to detect the code and data zones in the binary. |
|||
21 Sep 2011, 13:07 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.