.section .rodata .LC0: .string "Hello world! (%d)\n" formato: /* la stringa di formato per la scanf */ .string "%d" .data x: /* una variabile x */ .int .text .globl main .type main, @function main: .LFB0: .cfi_startproc pushl %ebp .cfi_def_cfa_offset 8 .cfi_offset 5, -8 movl %esp, %ebp .cfi_def_cfa_register 5 andl $-16, %esp subl $32, %esp push $x /* oppure: movl $x, 4(%esp) */ push $formato /* oppure: movl $formato, (%esp) */ call scanf subl $1, (x) /* da 0 a x-1 */ movl $0, 28(%esp) jmp .L2 .L3: movl 28(%esp), %eax addl $1, %eax movl %eax, 4(%esp) movl $.LC0, (%esp) call printf movl $1, (%esp) call sleep addl $1, 28(%esp) .L2: movl (x), %eax /* compara con x */ cmpl %eax, 28(%esp) jle .L3 movl $0, (%esp) call exit .cfi_endproc .LFE0: .size main, .-main .ident "GCC: (Debian 4.7.2-5) 4.7.2" .section .note.GNU-stack,"",@progbits