Twitterでうっかり"GCCインラインアセンブラ拡張構文の解説でもするか"と発言したら、二人くらいに期待ageされたので、とりあえずCPUIDを例にインラインアセンブラの解説をします。 環境はi486(x86,IA-32)上のGCCが動く環境を想定しています。80386はCPUIDが無いのでごめんなさい。 x86_64(x64,AMD64)の人もそのまま遊べます。MIPSやPPC動かしている人は回れ右。今回はOSは関係ありません。 コンパイラは当然GCC(gcc/g++)です。3.2以降または4.0以降で動くと思います。MSVCやdmdの人は回れ右。最適化は特記の無い限りしてもかまいません。 単純な例から。 とりあえずcpuid命令を発行してみます。 int main() { asm volatile ( "xor %eax, %eax\n\t" "cpuid" ); return 0
A Manual for the Plan 9 assembler Rob Pike rob@plan9.bell-labs.com Machines There is an assembler for each of the MIPS, SPARC, Intel 386, Intel 960, AMD 29000, Motorola 68020 and 68000, Motorola Power PC, AMD64, DEC Alpha, and Acorn ARM. The 68020 assembler, 2a, is the oldest and in many ways the prototype. The assemblers are really just variations of a single program: they share many properties s
現在、以前紹介したことのある360iDevが開催中です。 今回も前回と同様に終了後にまとめて講演資料のページなどを紹介しようと思っていたのですが1つ素晴らしい講演資料があったので先行して紹介します。 内容はiPhoneでアセンブラを使う方法を本当の基礎の基礎から丁寧に解説してあります。それでいてARM CPUの回路図を交えたマニアックな解説となっています。 Games from Within | 360iDev: Cranking Up Floating Point Performance To 11 http://gamesfromwithin.com/360idev-cranking-up-floating-point-performance-to-11 自分も以前、アセンブラについて解説しましたがちょうど良いネタが無くてVFPの解説はしていませんでした。 nakamura001 @
Sandeep.Sv0.1, 01 March 2003. This HOWTO explains the use and usage of the inline assembly feature provided by GCC. There are only two prerequisites for reading this article, and that’s obviously a basic knowledge of x86 assembly language and C. 1. Introduction. 1.1 Copyright and License. 1.2 Feedback and Corrections. 1.3 Acknowledgments. 2. Overview of the whole thing. 3. GCC Assembler Syntax. 4.
The GNU Binutils are a collection of binary tools. The main ones are: ld - the GNU linker. as - the GNU assembler. gold - a new, faster, ELF only linker. But they also include: addr2line - Converts addresses into filenames and line numbers. ar - A utility for creating, modifying and extracting from archives. c++filt - Filter to demangle encoded C++ symbols. dlltool - Creates files for building and
GCCでインラインアセンブリを使用 する方法と留意点等 for x86 (1999〜2006年10回改訂、2006年1月22日注意を追加、最終更新日2006年5月27日) 文: A. SAITOH <s-akira at users.sourceforge.net> home ※システム名、CPU名は一般に開発会社の登録商標です。 以下の情報はあまり過度に信用しないで下さい。より正確な情報は、asやgccのinfoから得て下さい。 個々のプロセッサ命令の解説はここでは述べません。そのような技術資料は、インテルやAMDのウェブ サイトのdeveloper向けのページからpdf形式で入手できます。 以下の文及びプログラム例の運用結果に関して、筆者は一切責任を負いません。 参考文献 [0] D. Stancevic, K. Scheibler, J. Leto, Linux Assembly
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く