상세 컨텐츠

본문 제목

structure의 데이터 구조는?

C++/기본

by nowpassion 2008. 5. 1. 11:54

본문

#include <iostream>
struct Time{
       int hour;
       int min;
       int sec;
};

int main()
{
    Time t;
    t.hour=10;
    t.min=20;
    t.sec=30;
    return 0;
}


6.o:     file format elf32-i386

Disassembly of section .text:

00000000 <main>:
   0:    8d 4c 24 04              lea    0x4(%esp),%ecx
   4:    83 e4 f0                 and    $0xfffffff0,%esp
   7:    ff 71 fc                 pushl  -0x4(%ecx)
   a:    55                       push   %ebp
   b:    89 e5                    mov    %esp,%ebp
   d:    51                       push   %ecx
   e:    83 ec 10                 sub    $0x10,%esp
  11:    c7 45 f0 0a 00 00 00     movl   $0xa,-0x10(%ebp)
  18:    c7 45 f4 14 00 00 00     movl   $0x14,-0xc(%ebp)
  1f:    c7 45 f8 1e 00 00 00     movl   $0x1e,-0x8(%ebp)
  26:    b8 00 00 00 00           mov    $0x0,%eax
  2b:    83 c4 10                 add    $0x10,%esp
  2e:    59                       pop    %ecx
  2f:    5d                       pop    %ebp
  30:    8d 61 fc                 lea    -0x4(%ecx),%esp
  33:    c3                       ret   

00000034 <_Z41__static_initialization_and_destruction_0ii>:
  34:    55                       push   %ebp
  35:    89 e5                    mov    %esp,%ebp
  37:    83 ec 18                 sub    $0x18,%esp
  3a:    89 45 fc                 mov    %eax,-0x4(%ebp)
  3d:    89 55 f8                 mov    %edx,-0x8(%ebp)
  40:    83 7d fc 01              cmpl   $0x1,-0x4(%ebp)
  44:    75 31                    jne    77 <_Z41__static_initialization_and_destruction_0ii+0x43>
  46:    81 7d f8 ff ff 00 00     cmpl   $0xffff,-0x8(%ebp)
  4d:    75 28                    jne    77 <_Z41__static_initialization_and_destruction_0ii+0x43>
  4f:    c7 04 24 00 00 00 00     movl   $0x0,(%esp)
  56:    e8 fc ff ff ff           call   57 <_Z41__static_initialization_and_destruction_0ii+0x23>
  5b:    c7 44 24 08 00 00 00     movl   $0x0,0x8(%esp)
  62:    00
  63:    c7 44 24 04 00 00 00     movl   $0x0,0x4(%esp)
  6a:    00
  6b:    c7 04 24 92 00 00 00     movl   $0x92,(%esp)
  72:    e8 fc ff ff ff           call   73 <_Z41__static_initialization_and_destruction_0ii+0x3f>
  77:    c9                       leave 
  78:    c3                       ret   
  79:    90                       nop   

0000007a <_GLOBAL__I_main>:
  7a:    55                       push   %ebp
  7b:    89 e5                    mov    %esp,%ebp
  7d:    83 ec 08                 sub    $0x8,%esp
  80:    ba ff ff 00 00           mov    $0xffff,%edx
  85:    b8 01 00 00 00           mov    $0x1,%eax
  8a:    e8 a5 ff ff ff           call   34 <_Z41__static_initialization_and_destruction_0ii>
  8f:    c9                       leave 
  90:    c3                       ret   
  91:    90                       nop   

00000092 <__tcf_0>:
  92:    55                       push   %ebp
  93:    89 e5                    mov    %esp,%ebp
  95:    83 ec 08                 sub    $0x8,%esp
  98:    c7 04 24 00 00 00 00     movl   $0x0,(%esp)
  9f:    e8 fc ff ff ff           call   a0 <__tcf_0+0xe>
  a4:    c9                       leave 
  a5:    c3                       ret   
Disassembly of section .bss:

00000000 <_ZSt8__ioinit>:
    ...
Disassembly of section .ctors:

00000000 <.ctors>:
   0:    7a 00                    jp     2 <.ctors+0x2>
    ...
Disassembly of section .eh_frame:

00000000 <.eh_frame>:
   0:    18 00                    sbb    %al,(%eax)
   2:    00 00                    add    %al,(%eax)
   4:    00 00                    add    %al,(%eax)
   6:    00 00                    add    %al,(%eax)
   8:    01 7a 50                 add    %edi,0x50(%edx)
   b:    00 01                    add    %al,(%ecx)
   d:    7c 08                    jl     17 <.eh_frame+0x17>
   f:    05 00 00 00 00           add    $0x0,%eax
  14:    00 0c 04                 add    %cl,(%esp,%eax,1)
  17:    04 88                    add    $0x88,%al
  19:    01 00                    add    %eax,(%eax)
  1b:    00 20                    add    %ah,(%eax)
  1d:    00 00                    add    %al,(%eax)
  1f:    00 20                    add    %ah,(%eax)
  21:    00 00                    add    %al,(%eax)
  23:    00 34 00                 add    %dh,(%eax,%eax,1)
  26:    00 00                    add    %al,(%eax)
  28:    45                       inc    %ebp
  29:    00 00                    add    %al,(%eax)
  2b:    00 00                    add    %al,(%eax)
  2d:    04 01                    add    $0x1,%al
  2f:    00 00                    add    %al,(%eax)
  31:    00 0e                    add    %cl,(%esi)
  33:    08 85 02 04 02 00        or     %al,0x20402(%ebp)
  39:    00 00                    add    %al,(%eax)
  3b:    0d 05 00 00 00           or     $0x5,%eax
  40:    20 00                    and    %al,(%eax)
  42:    00 00                    add    %al,(%eax)
  44:    44                       inc    %esp
  45:    00 00                    add    %al,(%eax)
  47:    00 7a 00                 add    %bh,0x0(%edx)
  4a:    00 00                    add    %al,(%eax)
  4c:    17                       pop    %ss
  4d:    00 00                    add    %al,(%eax)
  4f:    00 00                    add    %al,(%eax)
  51:    04 01                    add    $0x1,%al
  53:    00 00                    add    %al,(%eax)
  55:    00 0e                    add    %cl,(%esi)
  57:    08 85 02 04 02 00        or     %al,0x20402(%ebp)
  5d:    00 00                    add    %al,(%eax)
  5f:    0d 05 00 00 00           or     $0x5,%eax
  64:    20 00                    and    %al,(%eax)
  66:    00 00                    add    %al,(%eax)
  68:    68 00 00 00 92           push   $0x92000000
  6d:    00 00                    add    %al,(%eax)
  6f:    00 14 00                 add    %dl,(%eax,%eax,1)
  72:    00 00                    add    %al,(%eax)
  74:    00 04 01                 add    %al,(%ecx,%eax,1)
  77:    00 00                    add    %al,(%eax)
  79:    00 0e                    add    %cl,(%esi)
  7b:    08 85 02 04 02 00        or     %al,0x20402(%ebp)
  81:    00 00                    add    %al,(%eax)
  83:    0d 05 00 00 00           or     $0x5,%eax
Disassembly of section .comment:

00000000 <.comment>:
   0:    00 47 43                 add    %al,0x43(%edi)
   3:    43                       inc    %ebx
   4:    3a 20                    cmp    (%eax),%ah
   6:    28 47 4e                 sub    %al,0x4e(%edi)
   9:    55                       push   %ebp
   a:    29 20                    sub    %esp,(%eax)
   c:    34 2e                    xor    $0x2e,%al
   e:    31 2e                    xor    %ebp,(%esi)
  10:    33 20                    xor    (%eax),%esp
  12:    32 30                    xor    (%eax),%dh
  14:    30 37                    xor    %dh,(%edi)
  16:    30 39                    xor    %bh,(%ecx)
  18:    32 39                    xor    (%ecx),%bh
  1a:    20 28                    and    %ch,(%eax)
  1c:    70 72                    jo     90 <_GLOBAL__I_main+0x16>
  1e:    65                       gs
  1f:    72 65                    jb     86 <_GLOBAL__I_main+0xc>
  21:    6c                       insb   (%dx),%es:(%edi)
  22:    65                       gs
  23:    61                       popa  
  24:    73 65                    jae    8b <_GLOBAL__I_main+0x11>
  26:    29 20                    sub    %esp,(%eax)
  28:    28 55 62                 sub    %dl,0x62(%ebp)
  2b:    75 6e                    jne    9b <__tcf_0+0x9>
  2d:    74 75                    je     a4 <__tcf_0+0x12>
  2f:    20 34 2e                 and    %dh,(%esi,%ebp,1)
  32:    31 2e                    xor    %ebp,(%esi)
  34:    32 2d 31 36 75 62        xor    0x62753631,%ch
  3a:    75 6e                    jne    aa <__tcf_0+0x18>
  3c:    74 75                    je     b3 <__tcf_0+0x21>
  3e:    32 29                    xor    (%ecx),%ch
    ...

'C++ > 기본' 카테고리의 다른 글

return ;  (0) 2008.05.01
message passing?  (0) 2008.05.01
전처리기(preprocessor)  (0) 2008.05.01
할당 실패시 NULL포인터를 제공한다.이유는?  (0) 2008.05.01
함수의 지역변수는 레퍼런스로 리턴하지 마라. 이유는?  (0) 2008.05.01

관련글 더보기