(なければ作るかもしれないけど、誰か作ってるに違いない。)
石尾孝弘/BERO
be...@mxp.meshnet.or.jp
http://www2a.meshnet.or.jp/‾bero/
gasでアセンブルしてオブジェクトもしくはEXEに変換した後、
インテル表記をサポートする逆アセンブラで
逆アセンブルするってのはどうでしょう。
--
§ NTTS○FT ニュービジネス事業本部第2プロジェクト 上原 潤二 §
In article <34BFF3...@mxp.meshnet.or.jp> BERO <be...@mxp.meshnet.or.jp> writes:
| x86のアセンブラについて質問です。
| fj.comp.archでもなし、fj.lang.asm.x86はないし、
| 適当な所が見つからなかったのでここにかきます。
| MASM,TASM等の一般的なアセンブラはオペランドの右から左へ代入するintel表記
| ですが、
| GCCで使用するGASでは、左から右へ代入するAT&T表記となっています。(レジス
| タ表記等も違う)
| これらを変換するようなコンバータは存在するのでしょうか?
|
| (なければ作るかもしれないけど、誰か作ってるに違いない。)
直接の回答ではないんですが、gcc の DOS ポートである DJGPP の FAQ に以下
のような記述があります。
---------------引用開始---------------引用開始---------------
17.3 Converting Intel ASM syntax to AT&T syntax
===============================================
**Q*: Where can I find an automated conversion tool to convert my
`Intel'-style assembly code into a code acceptable by `Gas'?*
*A* : A `Sed' script which should do most of the conversion was posted to
the DJGPP news group in the past. You can find it in the DJGPP archives, at
this URL:
http://www.delorie.com/djgpp/mail-archives/djgpp/1995/06/06/05:48:34
A conversion program called `TA2AS' which can convert TASM assembly source to
the AT&T format, can be found on the DJGPP server, e.g.
ftp://ftp.delorie.com/pub/djgpp/contrib/ta2asv08.zip and on the Oulu
repository, e.g. ftp://x2ftp.oulu.fi/pub/msdos/programming/convert/ta2as.zip.
`TA2AS' was written by Jan Oonk <j...@stack.urc.tue.nl>.
Alternatively, here is what you can do to make your code linkable with DJGPP
programs:
* Get and install NASM, a portable x86 assembler which supports most of
the Intel syntax and can generate DJGPP-compatible COFF object files (as
well as lots of other formats, such as Microsoft 16-bit OBJ and Win32,
a.out, and ELF). It also supports Pentium and Pentium Pro opcodes.
NASM is free for non-commercial use (see the docs for commercial use
restrictions) and can be compiled with DJGPP. You can get NASM from
sunsite mirrors, e.g.
ftp://sunsite.unc.edu/pub/Linux/devel/lang/asm/nasm-0.90.tar.gz. A
pre-compiled MSDOS binary is available from SimTel.NET sites, e.g.
ftp://ftp.simtel.net/pub/simtelnet/msdos/asmutl/nasm091.zip. The author
and maintainer of NASM is Simon Tatham <sg...@cam.ac.uk>.
* For a small number of relatively short files, consider converting them
with a smart editor (like Emacs or its work-alikes).
* Obtain a copy of Microsoft MASM 6.11. It has a `-coff' option to
generate object code in COFF format which can be submitted to GCC, so you
can compile your original source. You can also use the `LIB32'
librarian from Microsoft C8 to convert object files to COFF by putting
them into a `.lib' library, then extracting them as COFF files. (If you
use MASM or LIB32, please post your experiences to comp.os.msdos.djgpp
news group, so that I can make the above instructions less vague.)
* Use a disassembler to disassemble the object code, then convert it to
the AT&T format either by hand or using `TA2AS'. One place to look for
such a disassembler is on SimTel.NET mirrors, e.g.
ftp://ftp.simtel.net/pub/simtelnet/msdos/disasm/.
Keep in mind that syntax is only one of the aspects of converting code
written for DOS to DJGPP. You should also make sure your code doesn't
violate any of the rules for protected-mode programming (see next question in
Section 17.4).
---------------引用終了---------------引用終了---------------
--
KAJIYAMA, Tamito <kaji...@grad.sccs.chukyo-u.ac.jp>