Professional Documents
Culture Documents
Comparing Strings
Comparing Strings
Comparing Strings
pushl %ebp
int i=0; movl %esp, %ebp
subl $4, %esp
while(*a++!=0) movl $0, -4(%ebp)
next:
i++; movl 8(%ebp), %eax
incl 8(%ebp)
• Extended inline
__asm__( assembly code
: output operands /* optional */
: input operands /* optional */
: list of clobbered registers /* optional */
);
Example:
__asm__( "cld\n\t"
"rep\n\t“
"stosl"
: /* no output registers */
: "c" (count), "a" (fill_value), "D" (dest)
: "%ecx", "%edi"
);