CnUnix

[알림판목록 I] [알림판목록 II] [글목록][이 전][다 음]
[ CnUnix ] in KIDS
글 쓴 이(By): terzeron (microkid)
날 짜 (Date): 2002년 10월 15일 화요일 오후 11시 43분 21초
제 목(Title): Re: [질문] gcc로 컴파일할 때

int a, b = -4, c = 5;
a = b + c;

gcc -S test.c
as -a test.s (gas인 경우, Sun에서는 as -Sa test.s)

GAS LISTING test.s                      page 1


   1                            .file   "test.c"
   2                            .version        "01.01"
   3                    gcc2_compiled.:
   4                    .text
   5                            .p2align 2,0x90
   6                    .globl main
   7                            .type    main,@function
   8                    main:
   9 0000 55                    pushl %ebp
  10 0001 89E5                  movl %esp,%ebp
  11 0003 83EC18                subl $24,%esp
  12 0006 C745F8FC              movl $-4,-8(%ebp)
  12      FFFFFF
  13 000d C745F405              movl $5,-12(%ebp)
  13      000000
  14 0014 8B45F8                movl -8(%ebp),%eax
  15 0017 8B55F4                movl -12(%ebp),%edx
  16 001a 8D0C02                leal (%edx,%eax),%ecx
  17 001d 894DFC                movl %ecx,-4(%ebp)
  18 0020 31C0                  xorl %eax,%eax
  19 0022 EB00                  jmp .L2
  20                            .p2align 2,0x90
  21                    .L2:
  22 0024 C9                    leave
  23 0025 C3                    ret
  24                    .Lfe1:
  25                            .size    main,.Lfe1-main
  26                            .ident  "[ASM_FILE_END]GCC: (c) 2.95.2 19991024 (r
elease)"

GAS LISTING test.s                      page 2


DEFINED SYMBOLS
                            *ABS*:00000000 test.c
              test.s:3      .text:00000000 gcc2_compiled.
              test.s:8      .text:00000000 main

NO UNDEFINED SYMBOLS


---
어떤 성취가, 어떤 조롱이, 또는 어떤 고뇌가 나를 기다리고 있을지 나는 모른다. 
나는 아무 것도 모른다. 그러나 나는 아직 과거의 경이로운 기적의 시대가 영원히 
과거의 것이 되어 버리지는 않았다는 사실을 굳게 믿고 있다.  - Stanislaw Lem -
[알림판목록 I] [알림판목록 II] [글 목록][이 전][다 음]
키 즈 는 열 린 사 람 들 의 모 임 입 니 다.