〔リスト1〕-floop-optimizeオプションを使う例(test222.c)
|
//ループ内最適化の例
#include <stdio.h>
int main()
{
int xx;
int ix;
int xx1 = 100;
int xx2 = 10;
xx = xx1 * xx2;
for(ix=0;ix<10;ix++)
{
xx = 100;
}
xx = 0;
for(ix=0;ix<4;ix++)
{
xx1 = 200;
xx = xx1 +xx;
}
return xx2 * 20;
}
|
|
〔リスト2〕-floop-optimizeオプションを付けて生成されたアセンブラ・ソース(test222a.s)
|
.file "test222.c"
.text
.p2align 2,,3
.globl main
.type main, @function
main:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
andl $-16, %esp
movl $9, %eax
.p2align 2,,3
.L6:
decl %eax
jns .L6
movl $200, %eax
leave
ret
.size main, .-main
.section .note.GNU-stack,"",@progbits
.ident "GCC: (GNU) 3.3.3 20040412 (Red Hat Linux 3.3.3-7)"
|
|
〔リスト3〕-fno-loop-optimizeオプションを付けて生成されたアセンブラ・ソース(test222.s)
|
.file "test222.c"
.text
.p2align 2,,3
.globl main
.type main, @function
main:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
andl $-16, %esp
xorl %eax, %eax
.p2align 2,,3
.L6:
incl %eax
cmpl $9, %eax
jle .L6
xorl %eax, %eax
.p2align 2,,3
.L11:
incl eax
cmpl $3, %eax
jle .L11
movl $200, %eax
leave
ret
.size main, .-main
.section .note.GNU-stack,"",@progbits
.ident "GCC: (GNU) 3.3.3 20040412 (Red Hat Linux 3.3.3-7)"
|
|
〔リスト4〕-fmerge-all-constantsオプションを使う例(test223.c)
|
//fmerge-constantsの例
#include <math.h>
const float f_d1 = 4.672299837f;
const float f_d2 = 4.672299837f;
float test(float f1)
{
return f1 * f_d1 / f_d2;
}
int main()
{
float xx;
xx = test(0.25);
return 0;
}
|
|
〔リスト5〕-fmerge-all-constantsオプションを付けて生成されたオブジェクト・ダンプ・リスト(test223.txt)
|
test223: ファイル形式 elf32-i386
セクション .interp の逆アセンブル:
08048114 <.interp>:
8048114: 2f das
8048115: 6c insb (%dx),%es:(%edi)
----------省略-------------
8048124: 2e 32 00 xor %cs:(%eax),%al
セクション .note.ABI-tag の逆アセンブル:
08048128 <.note.ABI-tag>:
8048128: 04 00 add $0x0,%al
----------省略-------------
8048145: 00 00 add %al,(%eax)
...
セクション .hash の逆アセンブル:
08048148 <.hash>:
8048148: 03 00 add (%eax),%eax
----------省略-------------
804816d: 00 00 add %al,(%eax)
...
セクション .dynsym の逆アセンブル:
08048170 <.dynsym>:
...
8048180: 3d 00 00 00 00 cmp $0x0,%eax
----------省略-------------
80481bd: 00 00 add %al,(%eax)
...
セクション .dynstr の逆アセンブル:
080481c0 <.dynstr>:
80481c0: 00 5f 4a add %bl,0x4a(%edi)
----------省略-------------
8048217: 30 00 xor %al,(%eax)
セクション .gnu.version の逆アセンブル:
0804821a <.gnu.version>:
804821a: 00 00 add %al,(%eax)
804821c: 02 00 add (%eax),%al
804821e: 01 00 add %eax,(%eax)
8048220: 00 00 add %al,(%eax)
...
セクション .gnu.version_r の逆アセンブル:
08048224 <.gnu.version_r>:
8048224: 01 00 add %eax,(%eax)
----------省略-------------
8048241: 00 00 add %al,(%eax)
...
セクション .rel.dyn の逆アセンブル:
08048244 <.rel.dyn>:
8048244: 14 95 adc $0x95,%al
8048246: 04 08 add $0x8,%al
8048248: 06 push %es
8048249: 04 00 add $0x0,%al
...
セクション .rel.plt の逆アセンブル:
0804824c <.rel.plt>:
804824c: 24 95 and $0x95,%al
804824e: 04 08 add $0x8,%al
8048250: 07 pop %es
8048251: 01 00 add %eax,(%eax)
...
セクション .init の逆アセンブル:
08048254 <_init>:
8048254: 55 push %ebp
8048255: 89 e5 mov %esp,%ebp
8048257: 83 ec 08 sub $0x8,%esp
804825a: e8 51 00 00 00 call 80482b0
<call_gmon_start>
804825f: e8 ac 00 00 00 call 8048310
<frame_dummy>
8048264: e8 7f 01 00 00 call 80483e8
<__do_global_ctors_aux>
8048269: c9 leave
804826a: c3 ret
セクション .plt の逆アセンブル:
0804826c <.plt>:
804826c: ff 35 1c 95 04 08 pushl 0x804951c
----------省略-------------
8048287: e9 e0 ff ff ff jmp 804826c <_init+0x18>
セクション .text の逆アセンブル:
0804828c <_start>:
804828c: 31 ed xor %ebp,%ebp
804828e: 5e pop %esi
804828f: 89 e1 mov %esp,%ecx
8048291: 83 e4 f0 and $0xfffffff0,%esp
8048294: 50 push %eax
8048295: 54 push %esp
8048296: 52 push %edx
8048297: 68 a4 83 04 08 push $0x80483a4
804829c: 68 5c 83 04 08 push $0x804835c
80482a1: 51 push %ecx
80482a2: 56 push %esi
80482a3: 68 4c 83 04 08 push $0x804834c
80482a8: e8 cf ff ff ff call 804827c <_init+0x28>
80482ad: f4 hlt
80482ae: 90 nop
80482af: 90 nop
080482b0 <call_gmon_start>:
80482b0: 55 push %ebp
80482b1: 89 e5 mov %esp,%ebp
80482b3: 53 push %ebx
80482b4: e8 00 00 00 00 call 80482b9
<call_gmon_start+0x9>
80482b9: 5b pop %ebx
80482ba: 81 c3 5f 12 00 00 add $0x125f,%ebx
80482c0: 50 push %eax
80482c1: 8b 83 fc ff ff ff mov
0xfffffffc(%ebx),%eax
80482c7: 85 c0 test %eax,%eax
80482c9: 74 02 je 80482cd
<call_gmon_start+0x1d>
80482cb: ff d0 call *%eax
80482cd: 8b 5d fc mov
0xfffffffc(%ebp),%ebx
80482d0: c9 leave
80482d1: c3 ret
80482d2: 90 nop
80482d3: 90 nop
080482d4 <__do_global_dtors_aux>:
80482d4: 55 push %ebp
80482d5: 89 e5 mov %esp,%ebp
80482d7: 83 ec 08 sub $0x8,%esp
80482da: 80 3d 34 95 04 08 00 cmpb $0x0,0x8049534
80482e1: 75 29 jne 804830c
<__do_global_dtors_aux+0x38>
80482e3: a1 30 95 04 08 mov 0x8049530,%eax
80482e8: 8b 10 mov (%eax),%edx
80482ea: 85 d2 test %edx,%edx
80482ec: 74 17 je 8048305
<__do_global_dtors_aux+0x31>
80482ee: 89 f6 mov %esi,%esi
80482f0: 83 c0 04 add $0x4,%eax
80482f3: a3 30 95 04 08 mov %eax,0x8049530
80482f8: ff d2 call *%edx
80482fa: a1 30 95 04 08 mov 0x8049530,%eax
80482ff: 8b 10 mov (%eax),%edx
8048301: 85 d2 test %edx,%edx
8048303: 75 eb jne 80482f0
<__do_global_dtors_aux+0x1c>
8048305: c6 05 34 95 04 08 01 movb $0x1,0x8049534
804830c: c9 leave
804830d: c3 ret
804830e: 89 f6 mov %esi,%esi
08048310 <frame_dummy>:
8048310: 55 push %ebp
----------省略-------------
804833b: 90 nop
0804833c <test>:
804833c: d9 05 30 84 04 08 flds 0x8048430
8048342: d9 44 24 04 flds 0x4(%esp)
8048346: d8 c9 fmul %st(1),%st
8048348: de f1 fdivp %st,%st(1)
804834a: c3 ret
804834b: 90 nop
0804834c <main>:
804834c: 55 push %ebp
804834d: 89 e5 mov %esp,%ebp
804834f: 83 ec 08 sub $0x8,%esp
8048352: 83 e4 f0 and $0xfffffff0,%esp
8048355: 31 c0 xor %eax,%eax
8048357: c9 leave
8048358: c3 ret
8048359: 90 nop
804835a: 90 nop
804835b: 90 nop
0804835c <__libc_csu_init>:
804835c: 55 push %ebp
----------省略-------------
80483a3: c3 ret
080483a4 <__libc_csu_fini>:
80483a4: 55 push %ebp
----------省略-------------
80483e6: eb e5 jmp 80483cd
<__libc_csu_fini+0x29>
080483e8 <__do_global_ctors_aux>:
80483e8: 55 push %ebp
80483e9: 89 e5 mov %esp,%ebp
80483eb: 53 push %ebx
80483ec: 52 push %edx
80483ed: a1 38 94 04 08 mov 0x8049438,%eax
80483f2: 83 f8 ff cmp $0xffffffff,%eax
80483f5: bb 38 94 04 08 mov $0x8049438,%ebx
80483fa: 74 0c je 8048408
<__do_global_ctors_aux+0x20>
80483fc: 83 eb 04 sub $0x4,%ebx
80483ff: ff d0 call *%eax
8048401: 8b 03 mov (%ebx),%eax
8048403: 83 f8 ff cmp $0xffffffff,%eax
8048406: 75 f4 jne 80483fc
<__do_global_ctors_aux+0x14>
8048408: 58 pop %eax
8048409: 5b pop %ebx
804840a: c9 leave
804840b: c3 ret
セクション .fini の逆アセンブル:
0804840c <_fini>:
804840c: 55 push %ebp
----------省略-------------
8048426: c3 ret
セクション .rodata の逆アセンブル:
08048428 <_fp_hw>:
8048428: 03 00 add (%eax),%eax
...
0804842c <_IO_stdin_used>:
804842c: 01 00 add %eax,(%eax)
804842e: 02 00 add (%eax),%al
08048430 <f_d1>:
8048430: 7b 83 jnp 80483b5
<__libc_csu_fini+0x11>
8048432: 95 xchg %eax,%ebp
8048433: 40 inc %eax
セクション .eh_frame の逆アセンブル:
08048434 <__FRAME_END__>:
8048434: 00 00 add %al,(%eax)
...
セクション .ctors の逆アセンブル:
08049438 <__CTOR_LIST__>:
8049438: ff (bad)
8049439: ff (bad)
804943a: ff (bad)
804943b: ff 00 incl (%eax)
0804943c <__CTOR_END__>:
804943c: 00 00 add %al,(%eax)
...
セクション .dtors の逆アセンブル:
08049440 <__DTOR_LIST__>:
8049440: ff (bad)
8049441: ff (bad)
8049442: ff (bad)
8049443: ff 00 incl (%eax)
08049444 <__DTOR_END__>:
8049444: 00 00 add %al,(%eax)
...
セクション .jcr の逆アセンブル:
08049448 <__JCR_END__>:
8049448: 00 00 add %al,(%eax)
...
セクション .dynamic の逆アセンブル:
0804944c <_DYNAMIC>:
804944c: 01 00 add %eax,(%eax)
----------省略-------------
80494e2: 04 08 add $0x8,%al
...
セクション .got の逆アセンブル:
08049514 <.got>:
8049514: 00 00 add %al,(%eax)
...
セクション .got.plt の逆アセンブル:
08049518 <_GLOBAL_OFFSET_TABLE_>:
8049518: 4c dec %esp
8049519: 94 xchg %eax,%esp
804951a: 04 08 add $0x8,%al
...
8049524: 82 (bad)
8049525: 82 (bad)
8049526: 04 08 add $0x8,%al
セクション .data の逆アセンブル:
08049528 <__data_start>:
8049528: 00 00 add %al,(%eax)
...
0804952c <__dso_handle>:
804952c: 00 00 add %al,(%eax)
...
08049530 <p.0>:
8049530: 44 inc %esp
8049531: 94 xchg %eax,%esp
8049532: 04 08 add $0x8,%al
セクション .bss の逆アセンブル:
08049534 <completed.1>:
8049534: 00 00 add %al,(%eax)
...
セクション .comment の逆アセンブル:
00000000 <.comment>:
0: 00 47 43 add %al,0x43(%edi)
----------省略-------------
12f: 33 29 xor (%ecx),%ebp
...
|
|
〔リスト6〕-fno-merge-all-constantsオプションを付けて生成されたオブジェクト・ダンプ・リスト(test223a.txt)
|
test223: ファイル形式 elf32-i386
セクション .interp の逆アセンブル:
08048114 <.interp>:
8048114: 2f das
8048115: 6c insb (%dx),%es:(%edi)
----------省略-------------
8048124: 2e 32 00 xor %cs:(%eax),%al
セクション .note.ABI-tag の逆アセンブル:
08048128 <.note.ABI-tag>:
8048128: 04 00 add $0x0,%al
----------省略-------------
8048145: 00 00 add %al,(%eax)
...
セクション .hash の逆アセンブル:
08048148 <.hash>:
8048148: 03 00 add (%eax),%eax
----------省略-------------
804816d: 00 00 add %al,(%eax)
...
セクション .dynsym の逆アセンブル:
08048170 <.dynsym>:
...
8048180: 3d 00 00 00 00 cmp $0x0,%eax
----------省略-------------
80481bd: 00 00 add %al,(%eax)
...
セクション .dynstr の逆アセンブル:
080481c0 <.dynstr>:
80481c0: 00 5f 4a add %bl,0x4a(%edi)
----------省略-------------
8048217: 30 00 xor %al,(%eax)
セクション .gnu.version の逆アセンブル:
0804821a <.gnu.version>:
804821a: 00 00 add %al,(%eax)
804821c: 02 00 add (%eax),%al
804821e: 01 00 add %eax,(%eax)
8048220: 00 00 add %al,(%eax)
...
セクション .gnu.version_r の逆アセンブル:
08048224 <.gnu.version_r>:
8048224: 01 00 add %eax,(%eax)
----------省略-------------
8048241: 00 00 add %al,(%eax)
...
セクション .rel.dyn の逆アセンブル:
08048244 <.rel.dyn>:
8048244: 1c 95 sbb $0x95,%al
8048246: 04 08 add $0x8,%al
8048248: 06 push %es
8048249: 04 00 add $0x0,%al
...
セクション .rel.plt の逆アセンブル:
0804824c <.rel.plt>:
804824c: 2c 95 sub $0x95,%al
804824e: 04 08 add $0x8,%al
8048250: 07 pop %es
8048251: 01 00 add %eax,(%eax)
...
セクション .init の逆アセンブル:
08048254 <_init>:
8048254: 55 push %ebp
8048255: 89 e5 mov %esp,%ebp
8048257: 83 ec 08 sub $0x8,%esp
804825a: e8 51 00 00 00 call 80482b0
<call_gmon_start>
804825f: e8 ac 00 00 00 call 8048310
<frame_dummy>
8048264: e8 7f 01 00 00 call 80483e8
<__do_global_ctors_aux>
8048269: c9 leave
804826a: c3 ret
セクション .plt の逆アセンブル:
0804826c <.plt>:
804826c: ff 35 24 95 04 08 pushl 0x8049524
----------省略-------------
8048287: e9 e0 ff ff ff jmp 804826c
<_init+0x18>
セクション .text の逆アセンブル:
0804828c <_start>:
804828c: 31 ed xor %ebp,%ebp
804828e: 5e pop %esi
804828f: 89 e1 mov %esp,%ecx
8048291: 83 e4 f0 and $0xfffffff0,%esp
8048294: 50 push %eax
8048295: 54 push %esp
8048296: 52 push %edx
8048297: 68 a4 83 04 08 push $0x80483a4
804829c: 68 5c 83 04 08 push $0x804835c
80482a1: 51 push %ecx
80482a2: 56 push %esi
80482a3: 68 4c 83 04 08 push $0x804834c
80482a8: e8 cf ff ff ff call 804827c
<_init+0x28>
80482ad: f4 hlt
80482ae: 90 nop
80482af: 90 nop
080482b0 <call_gmon_start>:
80482b0: 55 push %ebp
80482b1: 89 e5 mov %esp,%ebp
80482b3: 53 push %ebx
80482b4: e8 00 00 00 00 call 80482b9
<call_gmon_start+0x9>
80482b9: 5b pop %ebx
80482ba: 81 c3 67 12 00 00 add $0x1267,%ebx
80482c0: 50 push %eax
80482c1: 8b 83 fc ff ff ff mov
0xfffffffc(%ebx),%eax
80482c7: 85 c0 test %eax,%eax
80482c9: 74 02 je 80482cd
<call_gmon_start+0x1d>
80482cb: ff d0 call *%eax
80482cd: 8b 5d fc mov
0xfffffffc(%ebp),%ebx
80482d0: c9 leave
80482d1: c3 ret
80482d2: 90 nop
80482d3: 90 nop
080482d4 <__do_global_dtors_aux>:
80482d4: 55 push %ebp
80482d5: 89 e5 mov %esp,%ebp
80482d7: 83 ec 08 sub $0x8,%esp
80482da: 80 3d 3c 95 04 08 00 cmpb $0x0,0x804953c
80482e1: 75 29 jne 804830c
<__do_global_dtors_aux+0x38>
80482e3: a1 38 95 04 08 mov 0x8049538,%eax
80482e8: 8b 10 mov (%eax),%edx
80482ea: 85 d2 test %edx,%edx
80482ec: 74 17 je 8048305
<__do_global_dtors_aux+0x31>
80482ee: 89 f6 mov %esi,%esi
80482f0: 83 c0 04 add $0x4,%eax
80482f3: a3 38 95 04 08 mov %eax,0x8049538
80482f8: ff d2 call *%edx
80482fa: a1 38 95 04 08 mov 0x8049538,%eax
80482ff: 8b 10 mov (%eax),%edx
8048301: 85 d2 test %edx,%edx
8048303: 75 eb jne 80482f0
<__do_global_dtors_aux+0x1c>
8048305: c6 05 3c 95 04 08 01 movb $0x1,0x804953c
804830c: c9 leave
804830d: c3 ret
804830e: 89 f6 mov %esi,%esi
08048310 <frame_dummy>:
8048310: 55 push %ebp
----------省略-------------
804833b: 90 nop
0804833c <test>:
804833c: d9 05 38 84 04 08 flds 0x8048438
8048342: d9 44 24 04 flds 0x4(%esp)
8048346: d8 c9 fmul %st(1),%st
8048348: de f1 fdivp %st,%st(1)
804834a: c3 ret
804834b: 90 nop
0804834c <main>:
804834c: 55 push %ebp
804834d: 89 e5 mov %esp,%ebp
804834f: 83 ec 08 sub $0x8,%esp
8048352: 83 e4 f0 and $0xfffffff0,%esp
8048355: 31 c0 xor %eax,%eax
8048357: c9 leave
8048358: c3 ret
8048359: 90 nop
804835a: 90 nop
804835b: 90 nop
0804835c <__libc_csu_init>:
804835c: 55 push %ebp
----------省略-------------
80483a3: c3 ret
080483a4 <__libc_csu_fini>:
80483a4: 55 push %ebp
----------省略-------------
80483e6: eb e5 jmp 80483cd
<__libc_csu_fini+0x29>
080483e8 <__do_global_ctors_aux>:
80483e8: 55 push %ebp
80483e9: 89 e5 mov %esp,%ebp
80483eb: 53 push %ebx
80483ec: 52 push %edx
80483ed: a1 40 94 04 08 mov 0x8049440,%eax
80483f2: 83 f8 ff cmp $0xffffffff,%eax
80483f5: bb 40 94 04 08 mov $0x8049440,%ebx
80483fa: 74 0c je 8048408
<__do_global_ctors_aux+0x20>
80483fc: 83 eb 04 sub $0x4,%ebx
80483ff: ff d0 call *%eax
8048401: 8b 03 mov (%ebx),%eax
8048403: 83 f8 ff cmp $0xffffffff,%eax
8048406: 75 f4 jne 80483fc
<__do_global_ctors_aux+0x14>
8048408: 58 pop %eax
8048409: 5b pop %ebx
804840a: c9 leave
804840b: c3 ret
セクション .fini の逆アセンブル:
0804840c <_fini>:
804840c: 55 push %ebp
----------省略-------------
8048426: c3 ret
セクション .rodata の逆アセンブル:
08048428 <_fp_hw>:
8048428: 03 00 add (%eax),%eax
...
0804842c <_IO_stdin_used>:
804842c: 01 00 add %eax,(%eax)
804842e: 02 00 add (%eax),%al
08048430 <f_d1>:
8048430: 7b 83 jnp 80483b5
<__libc_csu_fini+0x11>
8048432: 95 xchg %eax,%ebp
8048433: 40 inc %eax
08048434 <f_d2>:
8048434: 7b 83 jnp 80483b9
<__libc_csu_fini+0x15>
8048436: 95 xchg %eax,%ebp
8048437: 40 inc %eax
8048438: 7b 83 jnp 80483bd
<__libc_csu_fini+0x19>
804843a: 95 xchg %eax,%ebp
804843b: 40 inc %eax
セクション .eh_frame の逆アセンブル:
0804843c <__FRAME_END__>:
804843c: 00 00 add %al,(%eax)
...
セクション .ctors の逆アセンブル:
08049440 <__CTOR_LIST__>:
8049440: ff (bad)
8049441: ff (bad)
8049442: ff (bad)
8049443: ff 00 incl (%eax)
08049444 <__CTOR_END__>:
8049444: 00 00 add %al,(%eax)
...
セクション .dtors の逆アセンブル:
08049448 <__DTOR_LIST__>:
8049448: ff (bad)
8049449: ff (bad)
804944a: ff (bad)
804944b: ff 00 incl (%eax)
0804944c <__DTOR_END__>:
804944c: 00 00 add %al,(%eax)
...
セクション .jcr の逆アセンブル:
08049450 <__JCR_END__>:
8049450: 00 00 add %al,(%eax)
...
セクション .dynamic の逆アセンブル:
08049454 <_DYNAMIC>:
8049454: 01 00 add %eax,(%eax)
----------省略-------------
80494ea: 04 08 add $0x8,%al
...
セクション .got の逆アセンブル:
0804951c <.got>:
804951c: 00 00 add %al,(%eax)
...
セクション .got.plt の逆アセンブル:
08049520 <_GLOBAL_OFFSET_TABLE_>:
8049520: 54 push %esp
8049521: 94 xchg %eax,%esp
8049522: 04 08 add $0x8,%al
...
804952c: 82 (bad)
804952d: 82 (bad)
804952e: 04 08 add $0x8,%al
セクション .data の逆アセンブル:
08049530 <__data_start>:
8049530: 00 00 add %al,(%eax)
...
08049534 <__dso_handle>:
8049534: 00 00 add %al,(%eax)
...
08049538 <p.0>:
8049538: 4c dec %esp
8049539: 94 xchg %eax,%esp
804953a: 04 08 add $0x8,%al
セクション .bss の逆アセンブル:
0804953c <completed.1>:
804953c: 00 00 add %al,(%eax)
...
セクション .comment の逆アセンブル:
00000000 <.comment>:
0: 00 47 43 add %al,0x43(%edi)
----------省略-------------
12f: 33 29 xor (%ecx),%ebp
...
|
|
〔リスト7〕-fmove-all-movablesオプションを使う例(test224.c)
|
//ループ中の不変式計算すべてをループ外に移動する例
#include <stdio.h>
int main()
{
int xx;
int ix;
int xx1 = 100;
int xx2 = 10;
int xx3;
for(ix=0;ix<10;ix++)
{
int x1;
x1 = 20;
xx = xx1 * xx2;
printf("%d\n",ix+xx);
}
}
|
|
〔リスト8〕-fmove-all-movablesオプションを付けて生成されたアセンブラ・ソース(test224a.s)
|
.file "test224.c"
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "%d\n"
.text
.p2align 2,,3
.globl main
.type main, @function
main:
pushl %ebp
movl %esp, %ebp
pushl %esi
pushl %ebx
andl $-16, %esp
movl $1000, %esi
movl $9, %ebx
.p2align 2,,3
.L6:
subl $8, %esp
pushl %esi
pushl $.LC0
call printf
incl %esi
addl $16, %esp
decl %ebx
jns .L6
leal -8(%ebp), %esp
popl %ebx
popl %esi
leave
ret
.size main, .-main
.section .note.GNU-stack,"",@progbits
.ident "GCC: (GNU) 3.3.3 20040412 (Red Hat Linux 3.3.3-7)"
|
|
〔リスト9〕-fmove-all-movablesオプションを付けて生成されたアセンブラ・ソース(test224.s)
|
.file "test224.c"
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "%d\n"
.text
.p2align 2,,3
.globl main
.type main, @function
main:
pushl %ebp
movl %esp, %ebp
pushl %ebx
pushl %eax
andl $-16, %esp
xorl %ebx, %ebx
.p2align 2,,3
.L6:
subl $8, %esp
leal 1000(%ebx), %edx
pushl %edx
pushl $.LC0
incl %ebx
call printf
addl $16, %esp
cmpl $9, %ebx
jle .L6
movl -4(%ebp), %ebx
leave
ret
.size main, .-main
.section .note.GNU-stack,"",@progbits
.ident "GCC: (GNU) 3.3.3 20040412 (Red Hat Linux 3.3.3-7)"
|
|
 記事内インデックス 連載インデックスはこちら Interfaceのトップ |
|
|
Copyright 2004 岸 哲夫
Copyright 1997-2004 CQ Publishing Co.,Ltd.
|