, , GCC. -S, . -Wa,-al, , , . ,
int foo(char var) {
if (var == 'x')
return 42;
return 17;
}
gcc -c -Wa,-al Windows
GAS LISTING C:\DOCUME~1\Ross\LOCALS~1\Temp/ccyDNLLe.s page 1
1 .file "q3715034.c"
2 .text
3 .p2align 4,,15
4 .globl _foo
5 .def _foo; .scl 2; .type 32;
.endef
6 _foo:
7 0000 55 pushl %ebp
8 0001 31C0 xorl %eax, %eax
9 0003 89E5 movl %esp, %ebp
10 0005 807D0878 cmpb $120, 8(%ebp)
11 0009 5D popl %ebp
12 000a 0F94C0 sete %al
13 000d 48 decl %eax
14 000e 83E0E7 andl $-25, %eax
15 0011 83C02A addl $42, %eax
16 0014 C3909090 ret
16 90909090
16 90909090
7 9 - , , 11 16 - . 8 0. 10 - var == 'x', $120 cmpb $120, 8(%ebp); ASCII 'x' 120 0x78 . 0x78 .text 8, CMPB. , SETE, AL 1, , 0 . DECL, ANDL ADDL 17, 42 AL EAX, .