My question is about the assembly result of a long long variable divided by a long variable. Assume two global variable declarations: long long a1 = 3; long a2 = 4; I guess a1/a2 could be assembled to something like (on ia32/linux) : movl a1, %eax movl a1+4, %edx idivl a2 Is this correct ? However the result compiled by GCC 4.1.1 is much more complicated. As a matter of fact, the following C program: long long a1 = 15; long a2 = 5; int f() { return a1/a2; } is compiled to a long assembly program below (gcc -O1 -S tmp1.c) . Why ? .file "tmp1.c" .globl __divdi3 .text .globl f .type f, @function f: pushl %ebp movl %esp, %ebp subl $24, %esp movl a2, %eax movl %eax, 8(%esp) cltd movl %edx, 12(%esp) movl a1, %eax movl a1+4, %edx movl %eax, (%esp) movl %edx, 4(%esp) call __divdi3 leave ret .size f, .-f .globl a1 .data .align 8 .type a1, @object .size a1, 8 a1: .long 15 .long 0 .globl a2 .align 4 .type a2, @object .size a2, 4 a2: .long 5 .ident "GCC: (GNU) 4.1.1" .section .note.GNU-stack,"",@progbits -- View this message in context: http://www.nabble.com/Question%3A-assembly-result-of-a-long-long-variable-divided-by-a-long-variable-tf2677244.html#a7466698 Sent from the gcc - Help mailing list archive at Nabble.com.