This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: long long in assembly
- From: Muschick Christian <muschick_christian at aon dot at>
- To: Fabiano Ramos <ramos_fabiano at yahoo dot com dot br>
- Cc: gcc help <gcc-help at gcc dot gnu dot org>, fabramos at bol dot com dot br
- Date: Thu, 16 Sep 2004 15:44:41 +0200
- Subject: Re: long long in assembly
- References: <200409161016.14466.ramos_fabiano@yahoo.com.br>
Hi!
I am trying to increment a 64-bit counter in assembly code.
In fact, it is a variable "unsigned long long" from C code, and
I am trying to increment it from a function written in assembly.
You can inspect the assembly code generated by gcc with the -S option.
Compiling this simple program
int main()
{
unsigned long long a = 1234;
a++;
return a;
}
yields (only relevant lines)
.loc 1 5 0
movl $1234, -8(%ebp)
movl $0, -4(%ebp)
.loc 1 6 0
leal -8(%ebp), %eax
addl $1, (%eax)
adcl $0, 4(%eax) // <- This should be what you are looking for
.loc 1 9 0
movl -8(%ebp), %eax
greets
cm